//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               = "_DriveAxis"
	Revision           = "1.72"
	GUID               = "{D4A343A9-F912-421E-88C9-1F83FBC77300}"
	RealtimeTask       = "false"
	CyclicTask         = "false"
	BackgroundTask     = "false"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\_DriveMngBase\Drive.ico"
	SharedCommandTable = "true"
	Objectsize         = "(586,120)"
	Comment            = "represents the axis on the given Place / AxNo combination">
	<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="MerkerEx2" Required="true" Internal="true"/>
		<Client Name="OverwriteMotorPara" Required="false" Internal="false" Comment="This client is just important for EnDat or Hiperface:&#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="HasHan"/>
		<Dokumentation Revision="1.72" Date="11.01.2023" Author="StePhi" Company="Sigmatek" Description="Changes in baseclass: Added position of second feedback available on ActPos server when only position of second feedback is used."/>
		<Dokumentation Revision="1.71" Date="02.06.2022" Author="LanSte" Company="Sigmatek" Description="Added support to read the log file from the drive with SDDCmdIntfc =&gt; _SDDEXLOGFILE."/>
		<Dokumentation Revision="1.70" Date="18.11.2021" Author="EisMic" Company="Sigmatek" Description="Removed AVALTT setting 16#20 and added the setting 16#1C for Multiturn Position.&#13;&#10;Added method AddASyncEntryIntHWCValue."/>
		<Dokumentation Revision="1.69" Date="28.07.2021" Author="LanSte" Company="Sigmatek" Description="Added support for encoder parameters for HiperfaceDSL for the MDD2000.&#13;&#10;Added methods to set DriveType-String when exporting driveparameters to xml-File."/>
		<Dokumentation Revision="1.68" Date="21.01.2021&#13;&#10;15.12.2020" Author="ZoePat&#13;&#10;PieSte" Company="Sigmatek" Description="Enable and Speed now get set to zero, in case of an reconnect.&#13;&#10;Add support for new AVALTT setting 16#20 Multiturn Position.&#13;&#10;Add &quot;Place&quot; and &quot;AxisNo&quot; at LHD file script for time and memory calculation."/>
		<Dokumentation Revision="1.67" Date="25.05.2020" Author="LanSte" Company="Sigmatek" Description="Added support for ex/importing drive parameters to xml file."/>
		<Dokumentation Revision="1.66" Date="25.10.2019" Author="PieSte" Company="Sigmatek" Description="Added support for _DriveAxisDiag class."/>
		<Dokumentation Revision="1.65" Date="12.08.2019" Author="LazJos" Company="Sigmatek" Description="Added support for HWAlarms."/>
		<Dokumentation Revision="1.64" Date="03.10.2018" Author="PieSte" Company="Sigmatek" Description="Added new AVALRT and AVALTT values. Now the config 23 and 27 are supported for SR01x. Add support for drive parameter M-KN and A-ACME. Replaced the &quot;Trace&quot; Logging with Logmessages."/>
		<Dokumentation Revision="1.63" Date="21.09.2016" Author="EisMic" Company="Sigmatek" Description="Parameter A-CAPREF will now be set every time."/>
		<Dokumentation Revision="1.62" Date="01.09.2016" Author="ZoePat" Company="Sigmatek" Description="Increased the ErrorQuit time at startup from 50ms to 100ms, to ensure the errorquit also if the drive is busy."/>
		<Dokumentation Revision="1.61" Date="04.07.2016" Author="ZoePat" Company="Sigmatek" Description="The client AxisExtend has now a default initvalue of 1."/>
		<Dokumentation Revision="1.60" Date="23.03.2016" Author="EisMic" Company="Sigmatek" Description="Changed some methods to virtual for derivation of class."/>
		<Dokumentation Revision="1.59" Date="02.03.2016" Author="EisMic" Company="Sigmatek" Description="Corrected that the Read method of the Online Server still returned 1 when the Drive gets disconnected."/>
		<Dokumentation Revision="1.58" Date="15.06.2015" Author="EisMic" Company="Sigmatek" Description="Prevent access exception in method SetAxTorque if stateword is parametrized in A-VALRT2"/>
		<Dokumentation Revision="1.57" Date="26.05.2015" Author="RamAnd" Company="Sigmatek" Description="The methods SetAbsolutePosition and SetAbsolutePositionEncoder now return -4 if any Axis of the drive is enabled.&#13;&#10;Improvement of AxErrorQuit::Write: ResetFault in control word is now only set if an internal drive error is active (could have lead to a contouring or trajectory error)"/>
		<Dokumentation Revision="1.56" Date="16.04.2015" Author="PieSte" Company="Sigmatek" Description="Added support for graphical hardware editor."/>
		<Dokumentation Revision="1.55" Date="02.04.2015" Author="EisMic" Company="Sigmatek" Description="Data of servers ActPos,ActSpeed.. are now valid in the same cycle as the online server is set to 1."/>
		<Dokumentation Revision="1.54" Date="27.01.2015" Author="EisMic" Company="Sigmatek" Description="Optimization of read methods in base class.&#13;&#10;Implemented NewInstcommando for read and write pdo data in base class."/>
		<Dokumentation Revision="1.53" Date="06.10.2014" Author="LanSte" Company="Sigmatek" Description="Added support for drive parameters P208 amd P122"/>
		<Dokumentation Revision="1.52" Date="12.09.2014" Author="EisMic" Company="Sigmatek" Description="Added support to automatically place axes in HW Editor when uploading the hardware (Lhd File Change)."/>
		<Dokumentation Revision="1.51" Date="22.07.2014" Author="LanSte" Company="Sigmatek" Description="Added Support for reading hardware diagnose."/>
		<Dokumentation Revision="1.50" Date="04.12.2013" Author="RauAnd&#13;&#10;&#13;&#10;ObeChr" Company="Sigmatek" Description="Avoid possible recursion in case the read-method of the server Online was overwritten and another read-methode got called.&#13;&#10;In case of ParaSaveType = 2 / 3 also K-Parameters got stored in the SRAM / RamFile. Now this Parameters are not stored retentive."/>
		<Dokumentation Revision="1.40" Date="21.03.2013" Author="RamAnd" Company="Sigmatek" Description="Since the last change of the class there was a problem if a 32 bit control word has been used. The initial torque value has not been written to the drive, therefore the axis couldn&apos;t move without a manual correction of the torque value."/>
		<Dokumentation Revision="1.30" Date="06.03.2013" Author="RamAnd&#13;&#10;RamAnd" Company="Sigmatek" Description="An invalid length value for the crc32 calculation of the parameter data could have lead to a runtime error.&#13;&#10;If a _DriveAxis has been placed in a complex network, the table name could not be generated since the last correction in the _DriveAxisSet class."/>
		<Dokumentation Revision="1.20" Date="05.11.2012" Author="ObeChr&#13;&#10;ObeChr" Company="Sigmatek" Description="The Paramterfile for the axis can now be selected by index.&#13;&#10;With the method SetAbsolutePositionEncoder an offset can be stored in the feedback."/>
		<Dokumentation Revision="1.11" Date="17.09.2012" Author="RamAnd" Company="Sigmatek" Description="Added new Server SerialNo to show the serial number of this axis module"/>
		<Dokumentation Revision="1.10" Date="31.10.2011" Author="RamAnd" Company="Sigmatek" Description="If a state word was mapped but no control word, an access exception occured when the class tried to quit an error automatically."/>
		<Dokumentation Revision="1.9" Date="28.10.2011" Author="RamAnd" Company="Sigmatek" Description="Corrected Name of Bit 1 in Type DS402_Control from &quot;DisableVoltage&quot; to &quot;EnableVoltage&quot; and Bit 4 in Type DS402_State from &quot;VoltageDisabled&quot; to &quot;VoltageEnabled&quot; to be DS402 conform."/>
		<Dokumentation Revision="1.8" Date="15.09.2011" Author="RamAnd" Company="Sigmatek" Description="If the client Extend is not set but there are extended parameters defined (A-VALRT2, A-VALTT2), the class now removes the extended parameters."/>
		<Dokumentation Revision="1.7" Date="12.01.2011" Author="BleErn" Company="Sigmatek" Description="Content of corresponding LASAL Hardware Description file (.lhd) which is necessary for the hardware editor has been updated"/>
		<Dokumentation Revision="1.6" Date="30.11.2010" Author="RamAnd" Company="Sigmatek" Description="When LASAL fetches a parameter value, now this value is also refreshed on the corresponding parameter class."/>
		<Dokumentation Revision="1.5" Date="13.12.2010" Author="RamAnd" Company="Sigmatek" Description="Fixed problems in initialisation, when device is plugged in and out within a short time."/>
		<Dokumentation Revision="1.4" Date="14.10.2010" Author="RamAnd" Company="Sigmatek" Description="If there was no error active on startup (power on at cpu and drive), the first appearing error was quit automatically.&#13;&#10;New Server I_HC to show the hardwarecode of power stage and control board."/>
		<Dokumentation Revision="1.3" Date="16.09.2010" Author="BerErw" Company="Sigmatek" Description="M-Parameters were not saved if OverwriteMotorPara was set to 1 on EnDat"/>
		<Dokumentation Revision="1.2" Date="06.04.2010" Author="HasHan" Company="Sigmatek" Description="The Server &quot;Online&quot; is now set to 0 if an axle is configured by software but not available on hardware."/>
		<Dokumentation Revision="1.1" Date="11.01.2010" Author="HasHan" Company="Sigmatek" Description="fetch the M-TYPE twice to avoid an error in fetching the M-TYPE"/>
		<Dokumentation Revision="1.0" Date="05.08.2009" Author="HasHan" Company="Sigmatek" Description="Creation"/>
	</RevDoku>
	<Network Name="_DriveAxis">
		<!-- List of Components in this network -->
		<Components>
			<Object
				Name       = "_base"
				GUID       = "{8E760ACF-CD88-4C08-92DD-0B2C6D65180F}"
				Class      = "_DriveAxisBase"
				Position   = "(1568,120)"
				Visualized = "false">
				<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="I_HC"/>
					<Server Name="Input1"/>
					<Server Name="Input2"/>
					<Server Name="Input3"/>
					<Server Name="Input4"/>
					<Server Name="Input5"/>
					<Server Name="Input6"/>
					<Server Name="Input7"/>
					<Server Name="Input8"/>
					<Server Name="Online"/>
					<Server Name="Output1"/>
					<Server Name="Output2"/>
					<Server Name="SDDCmdIntfc"/>
					<Server Name="SerialNo"/>
					<Server Name="SetCurrent"/>
					<Server Name="SetPos"/>
					<Server Name="SetSpeed"/>
					<Server Name="StateWord"/>
					<Server Name="ZPulsLatch"/>
					<Client Name="AxisExtend"/>
					<Client Name="AxisNo"/>
					<Client Name="coLinker"/>
					<Client Name="coStdLib"/>
					<Client Name="DriveAxisSet"/>
					<Client Name="DriveMng"/>
					<Client Name="Place"/>
				</Channels>
			</Object>
			<Object
				Name       = "MerkerEx2"
				GUID       = "{35A78AD4-A4D3-4ABE-9D72-8236201BF41E}"
				Class      = "MerkerEx"
				Position   = "(240,420)"
				Visualized = "false">
				<Channels>
					<Server Name="m_udLength"/>
					<Client Name="ThreadSafe" Value="0"/>
				</Channels>
			</Object>
			<Object
				Name       = "RAMex2"
				GUID       = "{4087D4D9-818A-49D3-BEB7-FF34C466AD38}"
				Class      = "RAMex"
				Position   = "(240,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       = "{26F51E37-D3D4-4780-B1D7-2FAFECD04824}"
				Class      = "_DriveAxisSet"
				Position   = "(840,420)"
				Visualized = "false">
				<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="(2250,210),(2078,210),"/>
			<Connection Source="this.AxisState" Destination="_base.AxisState" Vertices="(2250,330),(2078,330),"/>
			<Connection Source="this.ActPos" Destination="_base.ActPos" Vertices="(2250,390),(2078,390),"/>
			<Connection Source="this.SetPos" Destination="_base.SetPos" Vertices="(2250,450),(2078,450),"/>
			<Connection Source="this.ActSpeed" Destination="_base.ActSpeed" Vertices="(2250,510),(2078,510),"/>
			<Connection Source="this.SetSpeed" Destination="_base.SetSpeed" Vertices="(2250,570),(2078,570),"/>
			<Connection Source="this.ActCurrent" Destination="_base.ActCurrent" Vertices="(2250,630),(2078,630),"/>
			<Connection Source="this.SetCurrent" Destination="_base.SetCurrent" Vertices="(2250,690),(2078,690),"/>
			<Connection Source="this.StateWord" Destination="_base.StateWord" Vertices="(2250,810),(2078,810),"/>
			<Connection Source="this.ControlWord" Destination="_base.ControlWord" Vertices="(2250,870),(2078,870),"/>
			<Connection Source="this.AxEnable" Destination="_base.AxEnable" Vertices="(2250,930),(2078,930),"/>
			<Connection Source="this.AxError" Destination="_base.AxError" Vertices="(2250,990),(2078,990),"/>
			<Connection Source="this.AxErrorQuit" Destination="_base.AxErrorQuit" Vertices="(2250,1050),(2078,1050),"/>
			<Connection Source="this.ZPulsLatch" Destination="_base.ZPulsLatch" Vertices="(2250,1110),(2078,1110),"/>
			<Connection Source="this.AxTorqueControl" Destination="_base.AxTorqueControl" Vertices="(2250,1170),(2078,1170),"/>
			<Connection Source="_base.DriveMng" Destination="this.DriveMng" Vertices="(1568,210),(38,210),"/>
			<Connection Source="_base.Place" Destination="this.Place" Vertices="(1568,270),(38,270),"/>
			<Connection Source="_base.AxisNo" Destination="this.AxisNo" Vertices="(1568,330),(38,330),"/>
			<Connection Source="SDDAxSet1.ParaSaveType" Destination="this.ParaSaveType" Vertices="(840,510),(690,510),(690,1410),(38,2010),"/>
			<Connection Source="this.SDDAxSet1" Destination="SDDAxSet1.Server0"/>
			<Connection Source="_base.DriveAxisSet" Destination="SDDAxSet1.Server0" Vertices="(1568,450),(1500,450),(1500,510),(1442,510),"/>
			<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="(840,570),(630,570),(630,510),(540,510),"/>
			<Connection Source="SDDAxSet1.coRamEx" Destination="RAMex2.m_udLength" Vertices="(840,630),(630,630),(630,690),(540,690),"/>
			<Connection Source="SDDAxSet1.OverwriteMotorPara" Destination="this.OverwriteMotorPara" Vertices="(840,750),(720,750),(720,1470),(38,2070),"/>
			<Connection Source="SDDAxSet1.ParaTab" Destination="this.ParaTab" Vertices="(840,810),(750,810),(750,1530),(38,2130),"/>
			<Connection Source="SDDAxSet1.FileHandle" Destination="this.FileHandle" Vertices="(840,870),(780,870),(780,1590),(38,2190),"/>
			<Connection Source="this.ActXw" Destination="_base.ActXw" Vertices="(2250,750),(2078,750),"/>
			<Connection Source="this.SDDCmdIntfc" Destination="_base.SDDCmdIntfc" Vertices="(2250,1230),(2078,1230),"/>
			<Connection Source="_base.AxisExtend" Destination="this.AxisExtend" Vertices="(1568,390),(38,390),"/>
			<Connection Source="this.Online" Destination="_base.Online" Vertices="(2250,270),(2078,270),"/>
			<Connection Source="this.I_HC" Destination="_base.I_HC" Vertices="(2250,1290),(2078,1290),"/>
			<Connection Source="this.SerialNo" Destination="_base.SerialNo" Vertices="(2250,1350),(2078,1350),"/>
			<Connection Source="SDDAxSet1.TableIndex" Destination="this.TableIndex" Vertices="(840,930),(810,930),(810,1650),(38,2250),"/>
			<Connection Source="this.Input1" Destination="_base.Input1" Vertices="(2250,1410),(2078,1410),"/>
			<Connection Source="this.Input2" Destination="_base.Input2" Vertices="(2250,1470),(2078,1470),"/>
			<Connection Source="this.Input3" Destination="_base.Input3" Vertices="(2250,1530),(2078,1530),"/>
			<Connection Source="this.Input4" Destination="_base.Input4" Vertices="(2250,1590),(2078,1590),"/>
			<Connection Source="this.Input5" Destination="_base.Input5" Vertices="(2250,1650),(2078,1650),"/>
			<Connection Source="this.Input6" Destination="_base.Input6" Vertices="(2250,1710),(2078,1710),"/>
			<Connection Source="this.Input7" Destination="_base.Input7" Vertices="(2250,1770),(2078,1770),"/>
			<Connection Source="this.Input8" Destination="_base.Input8" Vertices="(2250,1830),(2078,1830),"/>
			<Connection Source="this.Output1" Destination="_base.Output1" Vertices="(2250,1890),(2078,1890),"/>
			<Connection Source="this.Output2" Destination="_base.Output2" Vertices="(2250,1950),(2078,1950),"/>
		</Connections>
		<!-- Headerfiles -->
		<Options>
		</Options>
	</Network>
</Class>
*)
#pragma using _DriveAxisBase

_DriveAxis : CLASS
: _DriveAxisBase
  //Servers:
  //Clients:
	SDDAxSet1 	: CltChCmd__DriveAxisSet;
	MerkerEx2 	: CltChCmd_MerkerEx;
	RAMex2 	: CltChCmd_RAMex;
	ParaSaveType 	: CltCh_DINT;
	OverwriteMotorPara 	: CltCh_DINT;
	ParaTab 	: CltCh_DINT;
	FileHandle 	: CltChCmd_DINT;
	TableIndex 	: CltCh_UDINT;
  //Variables:
  //Functions:
				//! <Function Comment="With this methode, a positionoffset can be stored in the drive (only available for absolute enocder)&#13;&#10;&#13;&#10;For a detailed description check the Drive documentation =&gt; Paramter K-FBRW" Name="SetAbsolutePosition"/>
	FUNCTION VIRTUAL GLOBAL SetAbsolutePosition
		VAR_INPUT
			AbsPosition 	: DINT;			//! <Variable Comment="I-POS is set to this value. The calculated offset gets stored in the drive." Name="SetAbsolutePosition.AbsPosition"/>
		END_VAR
		VAR_OUTPUT
			retcode 	: DINT;			//! <Variable Comment="Returncode for this methode&#13;&#10;&#13;&#10; 1..Everything was successful&#13;&#10;-1..Drive is not online or initialized&#13;&#10;-2..Operation already in progress&#13;&#10;-3..No AbsoluteEncoder is available&#13;&#10;-4..Not possible if any axis of this drive is enabled" Name="SetAbsolutePosition.retcode"/>
		END_VAR;
				//! <Function Comment="With this methode, a positionoffset can be stored in the feedbacksystem (only available for absolute enocder)&#13;&#10;&#13;&#10;For a detailed description check the Drive documentation =&gt; Paramter K-FBRW" Name="SetAbsolutePositionEncoder"/>
	FUNCTION VIRTUAL GLOBAL SetAbsolutePositionEncoder
		VAR_INPUT
			AbsPosition 	: DINT;			//! <Variable Comment="I-POS is set to this value. The calculated offset gets stored in the feedback." Name="SetAbsolutePositionEncoder.AbsPosition"/>
		END_VAR
		VAR_OUTPUT
			retcode 	: DINT;			//! <Variable Comment="Returncode for this methode&#13;&#10;&#13;&#10; 1..Everything was successful&#13;&#10;-1..Drive is not online or initialized&#13;&#10;-2..Operation already in progress&#13;&#10;-3..No AbsoluteEncoder is available&#13;&#10;-4..Not possible if any axis of this drive is enabled" Name="SetAbsolutePositionEncoder.retcode"/>
		END_VAR;
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

#pragma using _DriveAxisSet
#pragma using MerkerEx
#pragma using RAMex


//}}LSL_DECLARATION


FUNCTION GLOBAL TAB _DriveAxis::@CT_
0$UINT,
2#0100000000000000$UINT, //TY__DRIVEAXIS
1$UINT, 72$UINT, (SIZEOF(::_DriveAxis))$UINT, 
0$UINT, 8$UINT, 0$UINT, 
TO_UDINT(912370472), "_DriveAxis", //Class
TO_UDINT(4124502522), "_DriveAxisBase", 1$UINT, 81$UINT, //Baseclass
//Servers:
//Clients:
(::_DriveAxis.SDDAxSet1.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(1556274862), "SDDAxSet1", TO_UDINT(833307860), "_DriveAxisSet", 1$UINT, 22$UINT, 
(::_DriveAxis.MerkerEx2.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(1150281633), "MerkerEx2", TO_UDINT(2225119864), "MerkerEx", 1$UINT, 22$UINT, 
(::_DriveAxis.RAMex2.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(814559409), "RAMex2", TO_UDINT(933570811), "RAMex", 1$UINT, 17$UINT, 
(::_DriveAxis.ParaSaveType.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(3430860999), "ParaSaveType", 
(::_DriveAxis.OverwriteMotorPara.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(100162029), "OverwriteMotorPara", 
(::_DriveAxis.ParaTab.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(29594727), "ParaTab", 
(::_DriveAxis.FileHandle.pCh)$UINT, _CH_CLT_CMD$UINT, 2#0000000000000100$UINT, TO_UDINT(3131334989), "FileHandle", 
(::_DriveAxis.TableIndex.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000100$UINT, TO_UDINT(2619296494), "TableIndex", 
END_FUNCTION


#define USER_CNT__DriveAxis 19

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

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

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

	_memcpy((#vmt.CmdTable)$^USINT, _DriveAxisBase::CmdState.pMeth, nCmdSize);
	vmt.CmdTable.nCmds		:= nSTDCMD + USER_CNT__DriveAxis;
#pragma warning (disable : 74)
	vmt.UserFcts[11]		:= #SetAbsolutePosition();

#pragma warning (default : 74)
#pragma warning (disable : 74)
	vmt.UserFcts[12]		:= #SetAbsolutePositionEncoder();

#pragma warning (default : 74)
	_DriveAxisBase::CmdState.pMeth		:= StoreCmd (pCmd := #vmt.CmdTable, SHARED);

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

END_FUNCTION

//{{LSL_IMPLEMENTATION
FUNCTION VIRTUAL GLOBAL _DriveAxis::SetAbsolutePosition
	VAR_INPUT
		AbsPosition 	: DINT;
	END_VAR
	VAR_OUTPUT
		retcode 	: DINT;
	END_VAR

  retcode := _DriveAxisBase::SetAbsolutePosition(AbsPosition := AbsPosition);
  
END_FUNCTION


FUNCTION VIRTUAL GLOBAL _DriveAxis::SetAbsolutePositionEncoder
	VAR_INPUT
		AbsPosition 	: DINT;
	END_VAR
	VAR_OUTPUT
		retcode 	: DINT;
	END_VAR
  
  retcode := _DriveAxisBase::SetAbsolutePositionEncoder(AbsPosition := AbsPosition);

END_FUNCTION



