//This file was generated by the LASAL2 CodeGenerator  -- 
//Please, do not edit this file (it might be overwritten by the next generator run)
//{{LSL_DECLARATION

(*!
<Class
	Name               = "MDD2000_Mng"
	Revision           = "1.2"
	GUID               = "{B248373C-D003-42BB-B605-BCC3ADC98811}"
	RealtimeTask       = "false"
	CyclicTask         = "true"
	DefCyclictime      = "10 ms"
	BackgroundTask     = "false"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\MDD2000_Mng\MDD2000SafetyDrive.ico"
	SharedCommandTable = "true"
	Objectsize         = "(516,120)"
	Comment            = "This class provides the interface to the MDD 2000 drive. Up to three axes can be controlled.">
	<Channels>
		<Server Name="Input1" GUID="{38E85C1F-4179-4638-A457-3424D31257EC}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 1 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="Input2" GUID="{2925DF6E-F191-4097-B02A-090E3C883F7F}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 2 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="Input3" GUID="{5BE0B76B-E6E7-4FF4-8763-5F62FEC157D6}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 3 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="Input4" GUID="{16401853-6A88-4875-96C4-6BDCF16FEE24}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 4 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="Input5" GUID="{6946362A-0449-4E34-BAE6-DD3ED28E731C}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 5 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="Input6" GUID="{CD44DC0F-B8FC-48B9-907A-8D678C6F7DE7}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="State of digital input 6 of drive.&#13;&#10; 0 .. off&#13;&#10; 1 .. on&#13;&#10;-1 .. deactivated"/>
		<Server Name="ProtocolVersion" GUID="{7A90E1DB-D136-46FC-9106-69972CA885E7}" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="Server shows the VARAN Protocol Version in the format xx.y.z&#13;&#10;e.g. 16#0130 means v01.3.0&#13;&#10;If this server is 16#0, then reading the VARAN Protocol Version is not supported by the OS-Interface."/>
		<Server Name="ValidateSerNo" GUID="{3FB59DBC-3309-49A9-93E0-D0083209821A}" Visualized="true" Initialize="false" WriteProtected="false" Retentive="false" Comment="if the validation of the serial number is activated (SerNoValidation = 1)&#13;&#10;the serial number of the actual module can be validated by writing to this server&#13;&#10;&#13;&#10;this server shows also the state of validation:&#13;&#10;-2..validation not acivated&#13;&#10;-1..no module validated on this position&#13;&#10; 0..module is not the validated one&#13;&#10; 1..module is the validated one"/>
		<Server Name="VaranOut_1" GUID="{488189B2-405D-4AB6-A3B2-A60E6B0C4E78}" Class="Hub_Base" Visualized="true" Initialize="false" WriteProtected="true" Retentive="false" Comment="Connect a Varan Client Class"/>
		<Client Name="BusIFVVMDD20001" Required="true" Internal="true"/>
		<Client Name="Hub_Base2" Required="true" Internal="true"/>
		<Client Name="MDD2000VVSafetyBase1" Required="true" Internal="true"/>
		<Client Name="Required" Required="true" Internal="false" DefValue="1" Comment="0 = module is not required&#13;&#10;1 = module is required (CPU will crash if module is missing)"/>
		<Client Name="SerNoValidation" Required="false" Internal="false" Comment="0..serial number of varan client does not matter&#13;&#10;1..serial number of varan client has to be validated, to use the module&#13;&#10;&#13;&#10;validation is done via write(1) to the ValidateSerNo Server"/>
		<Client Name="TimeMultiplier" Required="true" Internal="false" Comment="multiplier of varan time set as init value."/>
		<Client Name="Transparent" Required="false" Internal="false" Comment="If this Client is set to 1 the module is not used for building the VARAN-Tree"/>
		<Client Name="UserAction" Required="false" Internal="false" Comment="optional, connect to server to get Varan states via write method.&#13;&#10;Fore more information check the documentation &quot;General Documentation to the VARAN Library&quot;."/>
		<Client Name="VaranIn" Required="true" Internal="false" Comment="This class must be connected to a VARAN port or a VaranOut_[x] server."/>
	</Channels>
	<Separators>
		<Servers>
			<SepChn Position="0"/>
			<SepChn Position="9"/>
		</Servers>
	</Separators>
	<RevDoku>
		<Owner Company="Sigmatek" Author="LanSte"/>
		<Dokumentation Revision="1.2" Date="16.12.2024" Author="LanSte" Company="Sigmatek" Description="Fixed function of commands _ MDD2000INIT and _ MDD2000URINIT&#13;&#10;Correced bound exceed error in MDD2000VVSafetyBase::StopDO()&#13;&#10;Removed GetRequiredWaitTime.  Instead the wait time will be fetched from HWControl and apply to all required modules."/>
		<Dokumentation Revision="1.1" Date="13.06.2024" Author="ZoePat" Company="Sigmatek" Description="Increased array &quot;G_SDD_HW_DATA&quot; to 255 in baseclass."/>
		<Dokumentation Revision="1.0" Date="28.08.2023" Author="LanSte" Company="Sigmatek" Description="First library version."/>
	</RevDoku>
	<Network Name="MDD2000_Mng">
		<!-- List of Components in this network -->
		<Components>
			<Object
				Name       = "_base"
				GUID       = "{4C2D9682-273F-4FFF-A9CA-865E94149FB9}"
				Class      = "MDD2000MngBase"
				Position   = "(1628,120)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="AxisAvailable"/>
					<Server Name="ClassState"/>
					<Server Name="CmdState"/>
					<Server Name="DeviceAddress"/>
					<Server Name="DeviceID"/>
					<Server Name="DriveType"/>
					<Server Name="FwVersionDrive"/>
					<Server Name="FwVersionSafety"/>
					<Server Name="HWVersion"/>
					<Server Name="Online"/>
					<Server Name="Release"/>
					<Server Name="RetryCounter"/>
					<Server Name="SafetyNumber"/>
					<Server Name="SafetyRunState"/>
					<Server Name="SerialNo"/>
					<Server Name="StrDriveType"/>
					<Server Name="VendorID"/>
					<Client Name="cOnline"/>
					<Client Name="coStdLib"/>
					<Client Name="To_TaskObjectControl"/>
					<Client Name="ToBusIF"/>
					<Client Name="toSafetyRunState"/>
				</Channels>
			</Object>
			<Object
				Name       = "BusIFVVMDD20001"
				GUID       = "{EA2A5F0C-A430-4647-A359-E3AAB0559DCA}"
				Class      = "BusIFVVMDD2000"
				Position   = "(210,180)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="CallCommandFSoE"/>
					<Server Name="ClassState"/>
					<Server Name="ConnectCounter"/>
					<Server Name="DeviceAddress"/>
					<Server Name="DeviceID"/>
					<Server Name="DiagControl"/>
					<Server Name="DriveBusIF"/>
					<Server Name="FaultCounter"/>
					<Server Name="HardwareVersion"/>
					<Server Name="Input1"/>
					<Server Name="Input2"/>
					<Server Name="Input3"/>
					<Server Name="Input4"/>
					<Server Name="Input5"/>
					<Server Name="Input6"/>
					<Server Name="Online"/>
					<Server Name="ProtocolVersion"/>
					<Server Name="Release"/>
					<Server Name="RetryCounter"/>
					<Server Name="RXLost"/>
					<Server Name="SafetyRunState"/>
					<Server Name="SerialNo"/>
					<Server Name="State"/>
					<Server Name="TXLost"/>
					<Server Name="ValidateSerNo"/>
					<Server Name="VendorID"/>
					<Client Name="DriveDeviceID" Value="DRIVEMNG_BUSDEVICEID_MDD2000"/>
					<Client Name="Required" Value="1"/>
					<Client Name="SerNoValidation"/>
					<Client Name="TimeMultiplier" Value="1"/>
					<Client Name="Transparent" Value="0"/>
					<Client Name="UserAction"/>
					<Client Name="VaranIn"/>
				</Channels>
			</Object>
			<Object
				Name       = "Hub_Base2"
				GUID       = "{3A17E295-04F7-4430-98A8-47DC41D3403B}"
				Class      = "Hub_Base"
				Position   = "(1620,1710)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="Control"/>
					<Client Name="Splitter_Place" Value="0"/>
					<Client Name="VaranIn"/>
				</Channels>
			</Object>
			<Object
				Name           = "MDD2000VVSafetyBase1"
				GUID           = "{A5249FAF-D5CE-48C2-96F6-1376A39A9A9C}"
				Class          = "MDD2000VVSafetyBase"
				Position       = "(210,1860)"
				Visualized     = "true"
				Remotely       = "true"
				BackgroundTime = "100 ms">
				<Channels>
					<Server Name="ClassSvr"/>
					<Server Name="FirmwareVersion"/>
					<Server Name="SafetyNumber"/>
					<Server Name="SafetyState"/>
					<Client Name="ToBusInterface"/>
					<Client Name="ToMultiTask"/>
					<Client Name="ToSigCLib"/>
				</Channels>
			</Object>
		</Components>
		<Comments>
		</Comments>
		<!-- List of Connections in this network -->
		<Connections>
			<Connection Source="this.CmdState" Destination="_base.CmdState" Vertices="(2290,210),(2118,210),"/>
			<Connection Source="this.Online" Destination="_base.Online" Vertices="(2290,330),(2118,330),"/>
			<Connection Source="this.Release" Destination="_base.Release" Vertices="(2290,390),(2118,390),"/>
			<Connection Source="this.DeviceAddress" Destination="_base.DeviceAddress" Vertices="(2290,450),(2118,450),"/>
			<Connection Source="this.VendorID" Destination="_base.VendorID" Vertices="(2290,510),(2118,510),"/>
			<Connection Source="this.DeviceID" Destination="_base.DeviceID" Vertices="(2290,570),(2118,570),"/>
			<Connection Source="this.RetryCounter" Destination="_base.RetryCounter" Vertices="(2290,630),(2118,630),"/>
			<Connection Source="this.DriveType" Destination="_base.DriveType" Vertices="(2290,690),(2118,690),"/>
			<Connection Source="this.AxisAvailable" Destination="_base.AxisAvailable" Vertices="(2290,810),(2118,810),"/>
			<Connection Source="this.SerialNo" Destination="_base.SerialNo" Vertices="(2290,870),(2118,870),"/>
			<Connection Source="this.ValidateSerNo" Destination="BusIFVVMDD20001.ValidateSerNo" Vertices="(2290,1230),(1230,1230),(1230,810),(976,810),"/>
			<Connection Source="this.BusIFVVMDD20001" Destination="BusIFVVMDD20001.State"/>
			<Connection Source="BusIFVVMDD20001.VaranIn" Destination="this.VaranIn" Vertices="(210,270),(38,1230),"/>
			<Connection Source="BusIFVVMDD20001.Required" Destination="this.Required" Vertices="(210,330),(38,1290),"/>
			<Connection Source="BusIFVVMDD20001.UserAction" Destination="this.UserAction" Vertices="(210,390),(38,1350),"/>
			<Connection Source="BusIFVVMDD20001.SerNoValidation" Destination="this.SerNoValidation" Vertices="(210,450),(38,1410),"/>
			<Connection Source="BusIFVVMDD20001.Transparent" Destination="this.Transparent" Vertices="(210,510),(38,1470),"/>
			<Connection Source="BusIFVVMDD20001.TimeMultiplier" Destination="this.TimeMultiplier" Vertices="(210,630),(38,1530),"/>
			<Connection Source="this.FwVersionDrive" Destination="_base.FwVersionDrive" Vertices="(2290,990),(2118,990),"/>
			<Connection Source="this.SafetyRunState" Destination="_base.SafetyRunState" Vertices="(2290,1170),(2118,1230),"/>
			<Connection Source="_base.cOnline" Destination="BusIFVVMDD20001.Online" Vertices="(1628,210),(1560,210),(1560,210),(1110,210),(1110,330),(976,330),"/>
			<Connection Source="_base.ToBusIF" Destination="BusIFVVMDD20001.DriveBusIF" Vertices="(1628,390),(1560,390),(1560,1200),(1110,1200),(976,1290),"/>
			<Connection Source="this.FwVersionSafety" Destination="_base.FwVersionSafety" Vertices="(2290,1050),(2118,1110),"/>
			<Connection Source="this.Input1" Destination="BusIFVVMDD20001.Input1" Vertices="(2290,1350),(1890,1350),(1890,1350),(976,1350),"/>
			<Connection Source="this.Input2" Destination="BusIFVVMDD20001.Input2" Vertices="(2290,1410),(1920,1410),(1920,1410),(976,1410),"/>
			<Connection Source="this.Input3" Destination="BusIFVVMDD20001.Input3" Vertices="(2290,1470),(1950,1470),(1950,1470),(976,1470),"/>
			<Connection Source="this.Input4" Destination="BusIFVVMDD20001.Input4" Vertices="(2290,1530),(1980,1530),(1980,1530),(976,1530),"/>
			<Connection Source="this.Input5" Destination="BusIFVVMDD20001.Input5" Vertices="(2290,1590),(2010,1590),(2010,1590),(976,1590),"/>
			<Connection Source="this.Input6" Destination="BusIFVVMDD20001.Input6" Vertices="(2290,1650),(2010,1650),(2010,1650),(976,1650),"/>
			<Connection Source="this.Hub_Base2" Destination="Hub_Base2.Control"/>
			<Connection Source="this.VaranOut_1" Destination="Hub_Base2.Control" Vertices="(2290,1710),(2190,1710),(2190,1800),(2046,1800),"/>
			<Connection Source="Hub_Base2.VaranIn" Destination="BusIFVVMDD20001.State" Vertices="(1620,1800),(1140,1800),(1140,270),(976,270),"/>
			<Connection Source="this.MDD2000VVSafetyBase1" Destination="MDD2000VVSafetyBase1.ClassSvr"/>
			<Connection Source="MDD2000VVSafetyBase1.ToBusInterface" Destination="BusIFVVMDD20001.CallCommandFSoE" Vertices="(210,1950),(150,1950),(150,1830),(1020,1830),(1020,1770),(976,1770),"/>
			<Connection Source="this.SafetyNumber" Destination="_base.SafetyNumber" Vertices="(2290,1110),(2118,1170),"/>
			<Connection Source="this.ClassState" Destination="_base.ClassState" Vertices="(2290,270),(2118,270),"/>
			<Connection Source="this.StrDriveType" Destination="_base.StrDriveType" Vertices="(2290,750),(2118,750),"/>
			<Connection Source="this.HWVersion" Destination="_base.HWVersion" Vertices="(2290,930),(2118,930),"/>
			<Connection Source="this.ProtocolVersion" Destination="BusIFVVMDD20001.ProtocolVersion" Vertices="(2290,1290),(1200,1290),(1200,1170),(976,1170),"/>
			<Connection Source="_base.toSafetyRunState" Destination="BusIFVVMDD20001.SafetyRunState" Vertices="(1628,450),(1590,450),(1590,1710),(976,1710),"/>
		</Connections>
		<!-- Headerfiles -->
		<Options>
		</Options>
	</Network>
</Class>
*)
#pragma using MDD2000MngBase

MDD2000_Mng : CLASS
: MDD2000MngBase
  //Servers:
	ValidateSerNo 	: SvrCh_DINT;
	ProtocolVersion 	: SvrCh_HDINT;
	Input1 	: SvrCh_DINT;
	Input2 	: SvrCh_DINT;
	Input3 	: SvrCh_DINT;
	Input4 	: SvrCh_DINT;
	Input5 	: SvrCh_DINT;
	Input6 	: SvrCh_DINT;
	VaranOut_1 	: SvrChCmd_DINT;
  //Clients:
	BusIFVVMDD20001 	: CltChCmd_BusIFVVMDD2000;
	VaranIn 	: CltChCmd_Hub_Base;
	Required 	: CltCh_DINT;
	UserAction 	: CltCh_DINT;
	SerNoValidation 	: CltCh_DINT;
	Transparent 	: CltCh_DINT;
	TimeMultiplier 	: CltCh_UDINT;
	Hub_Base2 	: CltChCmd_Hub_Base;
	MDD2000VVSafetyBase1 	: CltChCmd_MDD2000VVSafetyBase;
  //Variables:
  //Functions:
	
	FUNCTION VIRTUAL GLOBAL ValidateSerNo::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL ValidateSerNo::Write
		VAR_INPUT
			input (EAX) 	: DINT;
		END_VAR
		VAR_OUTPUT
			result (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL ProtocolVersion::Read
		VAR_OUTPUT
			output (EAX) 	: HDINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input1::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input2::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input3::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input4::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input5::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL Input6::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
	
	FUNCTION VIRTUAL GLOBAL VaranOut_1::Read
		VAR_OUTPUT
			output (EAX) 	: DINT;
		END_VAR;
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

#pragma using BusIFVVMDD2000
#pragma using Hub_Base
#pragma using MDD2000VVSafetyBase


//}}LSL_DECLARATION


FUNCTION GLOBAL TAB MDD2000_Mng::@CT_
0$UINT,
2#0100000000000000$UINT, //TY_MDD2000_MNG
1$UINT, 2$UINT, (SIZEOF(::MDD2000_Mng))$UINT, 
9$UINT, 9$UINT, 0$UINT, 
TO_UDINT(3318409587), "MDD2000_Mng", //Class
TO_UDINT(4153957792), "MDD2000MngBase", 1$UINT, 2$UINT, //Baseclass
//Servers:
(::MDD2000_Mng.ValidateSerNo.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(1774120368), "ValidateSerNo", 
(::MDD2000_Mng.ProtocolVersion.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(1757312337), "ProtocolVersion", 
(::MDD2000_Mng.Input1.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(1344628668), "Input1", 
(::MDD2000_Mng.Input2.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(3375117830), "Input2", 
(::MDD2000_Mng.Input3.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(3190490768), "Input3", 
(::MDD2000_Mng.Input4.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(542085939), "Input4", 
(::MDD2000_Mng.Input5.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(1464378277), "Input5", 
(::MDD2000_Mng.Input6.pMeth)$UINT, _CH_SVR$UINT, 2#0000000000000000$UINT, TO_UDINT(3460428319), "Input6", 
(::MDD2000_Mng.VaranOut_1.pMeth)$UINT, _CH_SVR_OBJ$UINT, 2#0000000000000000$UINT, TO_UDINT(2138873746), "VaranOut_1", 
//Clients:
(::MDD2000_Mng.BusIFVVMDD20001.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(2468325704), "BusIFVVMDD20001", TO_UDINT(423404954), "BusIFVVMDD2000", 1$UINT, 1$UINT, 
(::MDD2000_Mng.VaranIn.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000110$UINT, TO_UDINT(2999796184), "VaranIn", TO_UDINT(3238133653), "Hub_Base", 1$UINT, 21$UINT, 
(::MDD2000_Mng.Required.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000110$UINT, TO_UDINT(648558917), "Required", 
(::MDD2000_Mng.UserAction.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(615089769), "UserAction", 
(::MDD2000_Mng.SerNoValidation.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(2258645482), "SerNoValidation", 
(::MDD2000_Mng.Transparent.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(2239134692), "Transparent", 
(::MDD2000_Mng.TimeMultiplier.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000110$UINT, TO_UDINT(2421717411), "TimeMultiplier", 
(::MDD2000_Mng.Hub_Base2.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(2591152185), "Hub_Base2", TO_UDINT(3238133653), "Hub_Base", 1$UINT, 21$UINT, 
(::MDD2000_Mng.MDD2000VVSafetyBase1.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(2345410010), "MDD2000VVSafetyBase1", TO_UDINT(2110734413), "MDD2000VVSafetyBase", 1$UINT, 1$UINT, 
END_FUNCTION


#define USER_CNT_MDD2000_Mng 34

TYPE
	_LSL_STD_VMETH	: STRUCT
			CmdTable	: CMDMETH;
			UserFcts	: ARRAY[0..USER_CNT_MDD2000_Mng] OF ^Void;
	END_STRUCT;
END_TYPE

FUNCTION MDD2000_Mng::@STD
	VAR_OUTPUT
		ret_code	: CONFSTATES;
	END_VAR
	VAR
		vmt	: _LSL_STD_VMETH;
		nCmdSize	: UINT;
	END_VAR

	ret_code	:= MDD2000MngBase::@STD();
	IF ret_code <> C_OK THEN
		RETURN;
	END_IF;
	nCmdSize		:= MDD2000MngBase::CmdState.pMeth^.nCmds$UINT*SIZEOF(pVoid) + CMDMETH.Init;

	_memcpy((#vmt.CmdTable)$^USINT, MDD2000MngBase::CmdState.pMeth, nCmdSize);
	vmt.CmdTable.nCmds		:= nSTDCMD + USER_CNT_MDD2000_Mng;
	MDD2000MngBase::CmdState.pMeth		:= StoreCmd (pCmd := #vmt.CmdTable, SHARED);

	IF MDD2000MngBase::CmdState.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	ValidateSerNo.pMeth			:= StoreMethod( #ValidateSerNo::Read(), #ValidateSerNo::Write() );
	IF ValidateSerNo.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	ProtocolVersion.pMeth			:= StoreMethod( #ProtocolVersion::Read(), #M_NO_F() );
	IF ProtocolVersion.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input1.pMeth			:= StoreMethod( #Input1::Read(), #M_NO_F() );
	IF Input1.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input2.pMeth			:= StoreMethod( #Input2::Read(), #M_NO_F() );
	IF Input2.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input3.pMeth			:= StoreMethod( #Input3::Read(), #M_NO_F() );
	IF Input3.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input4.pMeth			:= StoreMethod( #Input4::Read(), #M_NO_F() );
	IF Input4.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input5.pMeth			:= StoreMethod( #Input5::Read(), #M_NO_F() );
	IF Input5.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	Input6.pMeth			:= StoreMethod( #Input6::Read(), #M_NO_F() );
	IF Input6.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;
	_memcpy((#vmt.CmdTable)$^USINT, VaranOut_1.pMeth, SIZEOF(CMDMETH));
	vmt.CmdTable.nCmds		:= nSTDCMD;
	vmt.CmdTable.Read		:= #VaranOut_1::Read();
	VaranOut_1.pMeth		:= StoreCmd (pCmd := #vmt.CmdTable, SHARED);

	IF VaranOut_1.pMeth THEN
		ret_code	:= C_OK;
	ELSE
		ret_code	:= C_OUTOF_NEAR;
		RETURN;
	END_IF;

END_FUNCTION

//{{LSL_IMPLEMENTATION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input1::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input1 := BusIFVVMDD20001.Input1.Read();
	output := Input1;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input2::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input2 := BusIFVVMDD20001.Input2.Read();
	output := Input2;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input3::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input3 := BusIFVVMDD20001.Input3.Read();
	output := Input3;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input4::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input4 := BusIFVVMDD20001.Input4.Read();
	output := Input4;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input5::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input5 := BusIFVVMDD20001.Input5.Read();
	output := Input5;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::Input6::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	Input6 := BusIFVVMDD20001.Input6.Read();
	output := Input6;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::VaranOut_1::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	VaranOut_1 := Hub_Base2.Control.Read();
	output := VaranOut_1;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::ValidateSerNo::Read
	VAR_OUTPUT
		output (EAX) 	: DINT;
	END_VAR

	ValidateSerNo := BusIFVVMDD20001.ValidateSerNo.Read();
	output := ValidateSerNo;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::ValidateSerNo::Write
	VAR_INPUT
		input (EAX) 	: DINT;
	END_VAR
	VAR_OUTPUT
		result (EAX) 	: DINT;
	END_VAR

	ValidateSerNo := input;
	result := (BusIFVVMDD20001.ValidateSerNo.Write(ValidateSerNo))$DINT;

END_FUNCTION


FUNCTION VIRTUAL GLOBAL MDD2000_Mng::ProtocolVersion::Read
	VAR_OUTPUT
		output (EAX) 	: HDINT;
	END_VAR

	ProtocolVersion := BusIFVVMDD20001.ProtocolVersion.Read();
	output := ProtocolVersion;

END_FUNCTION
