//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               = "_LMCSafety"
	Revision           = "1.21"
	GUID               = "{A8662F5D-CD14-4567-9257-4179A7472827}"
	RealtimeTask       = "false"
	CyclicTask         = "false"
	BackgroundTask     = "false"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\_LMCSafety\LMCAxis.ico"
	SharedCommandTable = "true"
	Objectsize         = "(384,120)"
	Comment            = "The class _LMCSafety sets up an available interface to check:&#13;&#10;the limit switches: HWMin and HWMax as digital inputs&#13;&#10;the boot-state: HWReady as digital input &#13;&#10;general merror: HWError as digital input&#13;&#10;of a connected hardware.">
	<Channels>
		<Server Name="ClassSvr" GUID="{AA7499A3-F876-4E04-B37E-F8D4BDADC8F4}" Visualized="false" Initialize="false" WriteProtected="true" Retentive="false"/>
		<Client Name="Emergency" Required="false" Internal="false" Comment="With this client a general error condition can be checked and it is possible to configure what in the case of an error should happen."/>
		<Client Name="HWError" Required="false" Internal="false" Comment="Error-State of the hardware:&#13;&#10;0 .. no hardware-error is active&#13;&#10;1 .. hardware-error is active"/>
		<Client Name="HWMax" Required="false" Internal="false" Comment="Digital-Input for the hardware switch maximum-position&#13;&#10;0 .. hardwareswitch is inactive&#13;&#10;1 .. hardwareswitch is active"/>
		<Client Name="HWMin" Required="false" Internal="false" Comment="Digital-Input for the hardware switch of minimum-position.&#13;&#10;0 .. hardwareswitch is inactive&#13;&#10;1 .. hardwareswitch is active"/>
		<Client Name="HWReady" Required="false" Internal="false" Comment="With this Digital-Input, it can read in whether the hardware is initialized completely&#13;&#10;"/>
		<Client Name="LMCController" Required="false" Internal="false"/>
	</Channels>
	<RevDoku>
		<Owner Company="Sigmatek"/>
		<Dokumentation Revision="1.21" Date="2016-03-14" Author="HasHan" Company="Sigmatek" Description="Improvement: the CheckHwReady() methode will be called also from the connected controller"/>
		<Dokumentation Revision="1.20" Date="2013-02-08" Author="PALHAR&#13;&#10;HasHan" Company="Sigmatek" Description="1. Improvement: The if-condidion: &quot;if Emergency = 1 then&quot; readjusted to: if Emergency &lt;&gt; 0 then&quot; in order to allow reading in error codes by the client: Emergency.&#13;&#10;2. comment to the client: Energency added&#13;&#10;3. Improvement: add the functionality of the emergency Client"/>
		<Dokumentation Revision="1.0" Date="2012-09-27" Company="Sigmatek" Description="creation"/>
	</RevDoku>
</Class>
*)
_LMCSafety : CLASS
  //Servers:
	ClassSvr 	: SvrChCmd_DINT;
  //Clients:
	HWReady 	: CltCh_DINT;
	HWError 	: CltCh_DINT;
	HWMin 	: CltCh_DINT;
	HWMax 	: CltCh_DINT;
	Emergency 	: CltCh_DINT;
	LMCController 	: CltChCmd_Controller;
  //Variables:
		SafetyAxis : BDINT
		[
		  1 HwErrorConnect,
		  2 HWReadyConnect,
		  3 HWMinConnect,
		  4 HWMaxConnect,
		  5 EmergencyConnect,
		  6 HwReadyFromController,
		];

  //Functions:
	
	FUNCTION VIRTUAL GLOBAL Init;
				//! <Function Comment="checks if the client &quot;HWReady&quot; is connected" Name="ChkHWReadyConnect"/>
	FUNCTION GLOBAL ChkHWReadyConnect
		VAR_OUTPUT
			RetCode 	: BOOL;			//! <Variable Comment="Returnvalue = TRUE if the client &quot;HWReady&quot; is connected&#13;&#10;            = FALSE if the client &quot;HWReady&quot; is not connected" Name="ChkHWReadyConnect.RetCode"/>
		END_VAR;
				//! <Function Comment="Reads the client &quot;HWReady&quot;" Name="ReadHWReady"/>
	FUNCTION GLOBAL ReadHWReady
		VAR_OUTPUT
			RetCode 	: DINT;			//! <Variable Comment="Value of the client &quot;HWREady&quot;" Name="ReadHWReady.RetCode"/>
		END_VAR;
	
	FUNCTION GLOBAL CheckHWSignals
		VAR_OUTPUT
			ErrorInfo 	: _LMCAXIS_ERROR;
		END_VAR;
				//! <Function Comment="Enables or disables reading the hw ready information from the controller" Name="SetReadHwReadyFromController"/>
	FUNCTION GLOBAL SetReadHwReadyFromController
		VAR_INPUT
			ReadOnOff 	: BOOL;			//! <Variable Comment="TRUE ... enables reading from the controller&#13;&#10;FALSE ... disables reading from the controller" Name="SetReadHwReadyFromController.ReadOnOff"/>
		END_VAR;
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

#pragma usingLtd Controller


//}}LSL_DECLARATION


FUNCTION GLOBAL TAB _LMCSafety::@CT_
0$UINT,
2#0100000000000000$UINT, //TY__LMCSAFETY
1$UINT, 21$UINT, (SIZEOF(::_LMCSafety))$UINT, 
1$UINT, 6$UINT, 0$UINT, 
TO_UDINT(3213872914), "_LMCSafety", //Class
TO_UDINT(0), 0, 0$UINT, 0$UINT, //Baseclass
//Servers:
(::_LMCSafety.ClassSvr.pMeth)$UINT, _CH_CMD$UINT, 2#0000000000000000$UINT, TO_UDINT(619352855), "ClassSvr", 
//Clients:
(::_LMCSafety.HWReady.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000000$UINT, TO_UDINT(3806358573), "HWReady", 
(::_LMCSafety.HWError.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000000$UINT, TO_UDINT(2544391667), "HWError", 
(::_LMCSafety.HWMin.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000000$UINT, TO_UDINT(820401606), "HWMin", 
(::_LMCSafety.HWMax.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000000$UINT, TO_UDINT(216754847), "HWMax", 
(::_LMCSafety.Emergency.pCh)$UINT, _CH_CLT_DATA$UINT, 2#0000000000000000$UINT, TO_UDINT(1646202866), "Emergency", 
(::_LMCSafety.LMCController.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000000$UINT, TO_UDINT(1841476849), "LMCController", TO_UDINT(1198357413), "Controller", 1$UINT, 46$UINT, 
END_FUNCTION


#define USER_CNT__LMCSafety 0

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

FUNCTION _LMCSafety::@STD
	VAR_OUTPUT
		ret_code	: CONFSTATES;
	END_VAR
	VAR
		vmt	: _LSL_STD_VMETH;
	END_VAR

	//Command Methods
	InitCmdTable (nCmd := nSTDCMD + USER_CNT__LMCSafety, pCmd := #vmt.CmdTable);
	vmt.CmdTable.Init		:= #Init();
	ClassSvr.pMeth		:= StoreCmd (pCmd := #vmt.CmdTable, SHARED);

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

END_FUNCTION

//{{LSL_IMPLEMENTATION
//{{LSL_ENCRYPTION 16#800
[encoded data, 4928 characters]