//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_Axis"
	Revision           = "1.2"
	GUID               = "{8714C53B-1D08-4F01-BE6B-C4715B8FD529}"
	RealtimeTask       = "false"
	CyclicTask         = "false"
	BackgroundTask     = "false"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\MDD2000_Mng\MDD2000SafetyDrive.ico"
	SharedCommandTable = "true"
	Objectsize         = "(586,120)"
	Comment            = "Represents the axis on the given AxNo">
	<Channels>
		<Client Name="FileHandle" Required="false" Internal="false" Comment="command client to the class _DriveFileHandling&#13;&#10;The client has to be connected to use the RAMFILE for the drive parameters&#13;&#10;or to export the drive parameter into an excel formated file."/>
		<Client Name="MDD2000GeneralParaDS4021" Required="true" Internal="true"/>
		<Client Name="MerkerEx2" Required="true" Internal="true"/>
		<Client Name="OverwriteMotorPara" Required="false" Internal="false" Comment="This client is only important for EnDat, Hiperface or HiperfaceDSL.&#13;&#10;&#13;&#10;0  .. no M-Parameter will be overwritten&#13;&#10;1  .. all M-Parameter except M-ROFF will be overwritten&#13;&#10;99 .. all M-Parameter will be overwritten"/>
		<Client Name="ParaSaveType" Required="false" Internal="false" Comment="Save/Use Type of the drive parameter handling :&#13;&#10;&#13;&#10;0.. User table &#13;&#10;The client ParaTab have to connected to an object of the class _DriveParaTab.&#13;&#10;Is no connection available, the default settings of the drive will be send.&#13;&#10;No parameter changes by an user will be saved.&#13;&#10;&#13;&#10;1.. Lasal2 table&#13;&#10;A Lasal2 table must be connected to a _DriveAxis Object, by selecting the _DriveAxis Object &#13;&#10;in the properties of the lda-File. (see _DriveAxis Documentation).&#13;&#10;Is the Lasal2 drive table not available, the system looks if an user table for the axis exists.(See ParaSaveType = 0)&#13;&#10;No parameter changes by an user will be saved.&#13;&#10;&#13;&#10;2.. drive parameter saved in the SRAM&#13;&#10;In this case the parameter will be saved in the SRAM. The first time of the system start-up, we get the drive parameters of the Lasal2 table.&#13;&#10;(See ParaSaveType = 1). At the second time of the system start-up,the parameters are loaded from the SRAM into the drive&#13;&#10;Any parameter changes by an user will be saved in the SRAM.&#13;&#10;&#13;&#10;3.. drive parameter saved in the RAMFILE&#13;&#10;In this case the parameter will be saved in a RAMFILE if the client cFileHandle is connected to the class _DriveFileHandling.&#13;&#10;This type can only used if a file system is available.&#13;&#10;The first time of the system start-up, we get the drive parameters of the Lasal2 table and save the parameter into the file.&#13;&#10;(See ParaSaveType = 1). At the second time of the system start-up,the parameters are loaded from the file into the drive&#13;&#10;Any parameter changes by an user will be saved in the file.&#13;&#10;&#13;&#10;"/>
		<Client Name="ParaTab" Required="false" Internal="false" Comment="client for connecting a _DriveParaTab"/>
		<Client Name="RAMex2" Required="true" Internal="true"/>
		<Client Name="SDDAxSet1" Required="true" Internal="true"/>
		<Client Name="TableIndex" Required="false" Internal="false" Comment="With the value from this client, the specific Lasal2 Table is used for parameterizing the axis.&#13;&#10;(Only available for ParaSaveType = 1)"/>
	</Channels>
	<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"/>
		<Dokumentation Revision="1.1" Date="22.04.2024" Author="ZoePat" Company="Sigmatek" Description="Change in baseclass: Corrected possible compiler error, if function FetchEncoderData is called without input parameters (there where invalid characters in the init value definition)."/>
		<Dokumentation Revision="1.0" Date="28.08.2023" Author="LanSte" Company="Sigmatek" Description="First library version."/>
	</RevDoku>
	<Network Name="MDD2000_Axis">
		<!-- List of Components in this network -->
		<Components>
			<Object
				Name       = "_base"
				GUID       = "{74E4FE03-ECE5-465A-9B92-9FE55864D913}"
				Class      = "MDD2000_AxisBase"
				Position   = "(1862,120)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="ActCurrent"/>
					<Server Name="ActPos"/>
					<Server Name="ActSpeed"/>
					<Server Name="ActXw"/>
					<Server Name="AxEnable"/>
					<Server Name="AxError"/>
					<Server Name="AxErrorQuit"/>
					<Server Name="AxisState"/>
					<Server Name="AxTorqueControl"/>
					<Server Name="CmdState"/>
					<Server Name="ControlWord"/>
					<Server Name="MDD2000CmdIntfc"/>
					<Server Name="Online"/>
					<Server Name="SetCurrent"/>
					<Server Name="SetPos"/>
					<Server Name="SetSpeed"/>
					<Server Name="SetVerified"/>
					<Server Name="SetVerifiedRsp"/>
					<Server Name="StateWord"/>
					<Server Name="VerifiedState"/>
					<Server Name="ZPulsLatch"/>
					<Client Name="AxisNo"/>
					<Client Name="coLinker"/>
					<Client Name="coStdLib"/>
					<Client Name="DriveAxisSet"/>
					<Client Name="DriveMng"/>
					<Client Name="EncoderBufferSize"/>
					<Client Name="MDD2000GeneralPara"/>
				</Channels>
			</Object>
			<Object
				Name       = "MDD2000GeneralParaDS4021"
				GUID       = "{9E0A2CAD-2F6C-48C6-9369-8787CEB2C72E}"
				Class      = "MDD2000GeneralParaDS402"
				Position   = "(930,1080)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="ErrorQuit"/>
					<Server Name="ParaID"/>
					<Server Name="ParaNr"/>
					<Server Name="ParaRdWr"/>
					<Server Name="ParaSize"/>
					<Server Name="ParaSubID"/>
					<Server Name="ParaValue"/>
					<Server Name="State"/>
					<Client Name="DriveIF"/>
					<Client Name="ErrorCode"/>
				</Channels>
			</Object>
			<Object
				Name       = "MerkerEx2"
				GUID       = "{843D7751-4A03-4F17-9BB4-97F22E7549B9}"
				Class      = "MerkerEx"
				Position   = "(210,420)"
				Visualized = "false">
				<Channels>
					<Server Name="m_udLength"/>
					<Client Name="ThreadSafe" Value="0"/>
				</Channels>
			</Object>
			<Object
				Name       = "RAMex2"
				GUID       = "{2E01B3C0-7468-4D29-A356-8ED9C0DBD1A9}"
				Class      = "RAMex"
				Position   = "(210,600)"
				Visualized = "false">
				<Channels>
					<Server Name="m_udLength"/>
					<Client Name="MultiTask"/>
					<Client Name="ThreadSafe" Value="0"/>
					<Client Name="UseFile"/>
				</Channels>
			</Object>
			<Object
				Name       = "SDDAxSet1"
				GUID       = "{2089B9B6-F44C-41C5-A733-A7350A05E48D}"
				Class      = "MDD2000AxisSet"
				Position   = "(930,420)"
				Visualized = "true"
				Remotely   = "true">
				<Channels>
					<Server Name="Server0"/>
					<Client Name="coLinker"/>
					<Client Name="coMerkerEx"/>
					<Client Name="coRamEx"/>
					<Client Name="FileHandle"/>
					<Client Name="OverwriteMotorPara" Value="0"/>
					<Client Name="ParaSaveType" Value="1"/>
					<Client Name="ParaTab"/>
					<Client Name="TableIndex"/>
				</Channels>
			</Object>
		</Components>
		<Comments>
		</Comments>
		<!-- List of Connections in this network -->
		<Connections>
			<Connection Source="this.CmdState" Destination="_base.CmdState" Vertices="(2544,210),(2372,210),"/>
			<Connection Source="this.Online" Destination="_base.Online" Vertices="(2544,270),(2372,270),"/>
			<Connection Source="this.AxisState" Destination="_base.AxisState" Vertices="(2544,330),(2372,330),"/>
			<Connection Source="this.ActPos" Destination="_base.ActPos" Vertices="(2544,390),(2372,390),"/>
			<Connection Source="this.SetPos" Destination="_base.SetPos" Vertices="(2544,450),(2372,450),"/>
			<Connection Source="this.ActSpeed" Destination="_base.ActSpeed" Vertices="(2544,510),(2372,510),"/>
			<Connection Source="this.SetSpeed" Destination="_base.SetSpeed" Vertices="(2544,570),(2372,570),"/>
			<Connection Source="this.ActCurrent" Destination="_base.ActCurrent" Vertices="(2544,630),(2372,630),"/>
			<Connection Source="this.SetCurrent" Destination="_base.SetCurrent" Vertices="(2544,690),(2372,690),"/>
			<Connection Source="this.ActXw" Destination="_base.ActXw" Vertices="(2544,750),(2372,750),"/>
			<Connection Source="this.StateWord" Destination="_base.StateWord" Vertices="(2544,810),(2372,810),"/>
			<Connection Source="this.ControlWord" Destination="_base.ControlWord" Vertices="(2544,870),(2372,870),"/>
			<Connection Source="this.AxEnable" Destination="_base.AxEnable" Vertices="(2544,930),(2372,930),"/>
			<Connection Source="this.AxError" Destination="_base.AxError" Vertices="(2544,990),(2372,990),"/>
			<Connection Source="this.AxErrorQuit" Destination="_base.AxErrorQuit" Vertices="(2544,1050),(2372,1050),"/>
			<Connection Source="this.ZPulsLatch" Destination="_base.ZPulsLatch" Vertices="(2544,1110),(2372,1110),"/>
			<Connection Source="this.AxTorqueControl" Destination="_base.AxTorqueControl" Vertices="(2544,1170),(2372,1170),"/>
			<Connection Source="this.MDD2000CmdIntfc" Destination="_base.MDD2000CmdIntfc" Vertices="(2544,1230),(2372,1230),"/>
			<Connection Source="SDDAxSet1.ParaSaveType" Destination="this.ParaSaveType" Vertices="(930,510),(690,510),(690,1470),(38,1470),"/>
			<Connection Source="this.SDDAxSet1" Destination="SDDAxSet1.Server0"/>
			<Connection Source="this.MerkerEx2" Destination="MerkerEx2.m_udLength"/>
			<Connection Source="this.RAMex2" Destination="RAMex2.m_udLength"/>
			<Connection Source="SDDAxSet1.coMerkerEx" Destination="MerkerEx2.m_udLength" Vertices="(930,570),(600,570),(600,510),(510,510),"/>
			<Connection Source="SDDAxSet1.coRamEx" Destination="RAMex2.m_udLength" Vertices="(930,630),(600,630),(600,690),(510,690),"/>
			<Connection Source="SDDAxSet1.OverwriteMotorPara" Destination="this.OverwriteMotorPara" Vertices="(930,750),(720,750),(720,1530),(38,1530),"/>
			<Connection Source="SDDAxSet1.ParaTab" Destination="this.ParaTab" Vertices="(930,810),(750,810),(750,1590),(38,1590),"/>
			<Connection Source="SDDAxSet1.FileHandle" Destination="this.FileHandle" Vertices="(930,870),(780,870),(780,1650),(38,1650),"/>
			<Connection Source="SDDAxSet1.TableIndex" Destination="this.TableIndex" Vertices="(930,930),(810,930),(810,1710),(38,1710),"/>
			<Connection Source="_base.DriveMng" Destination="this.DriveMng" Vertices="(1862,210),(38,210),"/>
			<Connection Source="_base.AxisNo" Destination="this.AxisNo" Vertices="(1862,270),(38,270),"/>
			<Connection Source="_base.DriveAxisSet" Destination="SDDAxSet1.Server0" Vertices="(1862,330),(1740,330),(1740,510),(1532,510),"/>
			<Connection Source="_base.EncoderBufferSize" Destination="this.EncoderBufferSize" Vertices="(1862,510),(1650,450),(1650,330),(38,330),"/>
			<Connection Source="this.SetVerified" Destination="_base.SetVerified" Vertices="(2544,1290),(2372,1350),"/>
			<Connection Source="this.VerifiedState" Destination="_base.VerifiedState" Vertices="(2544,1410),(2372,1470),"/>
			<Connection Source="this.SetVerifiedRsp" Destination="_base.SetVerifiedRsp" Vertices="(2544,1350),(2372,1410),"/>
			<Connection Source="this.MDD2000GeneralParaDS4021" Destination="MDD2000GeneralParaDS4021.State"/>
			<Connection Source="MDD2000GeneralParaDS4021.DriveIF" Destination="_base.CmdState" Vertices="(930,1170),(900,1170),(900,1620),(2490,1620),(2490,240),(2372,210),"/>
			<Connection Source="_base.MDD2000GeneralPara" Destination="MDD2000GeneralParaDS4021.State" Vertices="(1862,570),(1800,570),(1800,1170),(1490,1170),"/>
		</Connections>
		<!-- Headerfiles -->
		<Options>
		</Options>
	</Network>
</Class>
*)
#pragma using MDD2000_AxisBase

MDD2000_Axis : CLASS
: MDD2000_AxisBase
  //Servers:
  //Clients:
	MerkerEx2 	: CltChCmd_MerkerEx;
	RAMex2 	: CltChCmd_RAMex;
	ParaSaveType 	: CltCh_DINT;
	OverwriteMotorPara 	: CltCh_DINT;
	ParaTab 	: CltCh_DINT;
	FileHandle 	: CltChCmd_DINT;
	TableIndex 	: CltCh_UDINT;
	SDDAxSet1 	: CltChCmd_MDD2000AxisSet;
	MDD2000GeneralParaDS4021 	: CltChCmd_MDD2000GeneralParaDS402;
  //Variables:
  //Functions:
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

#pragma using MDD2000AxisSet
#pragma using MDD2000GeneralParaDS402
#pragma using MerkerEx
#pragma using RAMex


//}}LSL_DECLARATION


FUNCTION GLOBAL TAB MDD2000_Axis::@CT_
0$UINT,
2#0100000000000000$UINT, //TY_MDD2000_AXIS
1$UINT, 2$UINT, (SIZEOF(::MDD2000_Axis))$UINT, 
0$UINT, 9$UINT, 0$UINT, 
TO_UDINT(626477144), "MDD2000_Axis", //Class
TO_UDINT(955250484), "MDD2000_AxisBase", 1$UINT, 1$UINT, //Baseclass
//Servers:
//Clients:
(::MDD2000_Axis.MerkerEx2.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(1150281633), "MerkerEx2", TO_UDINT(2225119864), "MerkerEx", 1$UINT, 22$UINT, 
(::MDD2000_Axis.RAMex2.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(814559409), "RAMex2", TO_UDINT(933570811), "RAMex", 1$UINT, 17$UINT, 
(::MDD2000_Axis.ParaSaveType.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(3430860999), "ParaSaveType", 
(::MDD2000_Axis.OverwriteMotorPara.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(100162029), "OverwriteMotorPara", 
(::MDD2000_Axis.ParaTab.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(29594727), "ParaTab", 
(::MDD2000_Axis.FileHandle.pCh)$UINT, _CH_CLT_CMD$UINT, 2#0000000000000100$UINT, TO_UDINT(3131334989), "FileHandle", 
(::MDD2000_Axis.TableIndex.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(2619296494), "TableIndex", 
(::MDD2000_Axis.SDDAxSet1.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(1556274862), "SDDAxSet1", TO_UDINT(3685268210), "MDD2000AxisSet", 1$UINT, 0$UINT, 
(::MDD2000_Axis.MDD2000GeneralParaDS4021.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(4109146394), "MDD2000GeneralParaDS4021", TO_UDINT(927349505), "MDD2000GeneralParaDS402", 1$UINT, 1$UINT, 
END_FUNCTION


#define USER_CNT_MDD2000_Axis 35

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

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

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

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

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

END_FUNCTION

//{{LSL_IMPLEMENTATION
