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

//{{LSL_DEFINES
// Monitoring time (ms). If a button is not being pressed or released for a this amount of time the connection has been broken
#ifndef LMCAXIS_VOVMonitor_NoReactionTimeLimit
  #define  LMCAXIS_VOVMonitor_NoReactionTimeLimit 1000 ms
#endif
//}}LSL_DEFINES

//{{LSL_DECLARATION

(*!
<Class
	Name               = "_LMCAxisVOVMonitoring"
	Revision           = "1.2"
	GUID               = "{789D1D55-BB15-4207-8B5E-B5BE49DCD113}"
	RealtimeTask       = "false"
	CyclicTask         = "false"
	BackgroundTask     = "true"
	DefBackground      = "100 ms"
	Sigmatek           = "true"
	OSInterface        = "false"
	HighPriority       = "false"
	Automatic          = "false"
	UpdateMode         = "Prescan"
	IconPath           = ".\Class\_LMCAxisVis\LMCAxis.ico"
	SharedCommandTable = "true"
	Objectsize         = "(284,120)"
	Comment            = "Class used to observe if a move hand button is still actively pressed in the VOV. If not a stop command is triggered after time LMCAXIS_VOVMonitor_NoReactionTimeLimit.">
	<Channels>
		<Server Name="ClassSvr" GUID="{808BD7BA-E667-47D4-A33D-ADA95A04CBDC}" Visualized="false" Initialize="false" WriteProtected="true" Retentive="false"/>
		<Client Name="ToVisInt" Required="true" Internal="false"/>
	</Channels>
	<RevDoku>
		<Owner Company="SIgmatek"/>
		<Dokumentation Revision="1.2" Date="2025-03-12" Author="StePhi" Company="SIgmatek" Description="Improvement: Raised default background time from 10 ms to 100ms to reduce CPU load, because of VOV monitoring check."/>
		<Dokumentation Revision="1.1" Date="2023-09-14" Author="StePhi" Company="Sigmatek" Description="Bugfix: Class constantly triggers StopMove() even when no button is pressed for ever, when axis was stopped because of an axis error (e.g: HWError)."/>
		<Dokumentation Revision="1.0" Date="2022-11-09" Author="SakEmi" Company="Sigmatek" Description="Initial version"/>
	</RevDoku>
</Class>
*)
_LMCAxisVOVMonitoring : CLASS
  //Servers:
	ClassSvr 	: SvrChCmd_DINT;
  //Clients:
	ToVisInt 	: CltChCmd__LMCAxisVisInt;
  //Variables:
		udStartLastMove 	: UDINT;
		OpMode 	: _LMCAXIS_OPMODE;
		MoveNegFast 	: DINT;
		MoveNegSlow 	: DINT;
		MovePosFast 	: DINT;
		MovePosSlow 	: DINT;
  //Functions:
				//! <Function Comment="Background task is used to obersve if a move hand button is still pressed. If not the active move command is stopped after timeout of LMCAXIS_VOVMonitor_NoReactionTimeLimit." Name="Background"/>
	FUNCTION VIRTUAL GLOBAL Background
		VAR_INPUT
			EAX 	: UDINT;
		END_VAR
		VAR_OUTPUT
			state (EAX) 	: UDINT;
		END_VAR;
  //Tables:
	FUNCTION @STD
		VAR_OUTPUT
			ret_code	: CONFSTATES;
		END_VAR;
	FUNCTION GLOBAL TAB @CT_;
END_CLASS;

#pragma usingLtd _LMCAxisVisInt


//}}LSL_DECLARATION


FUNCTION GLOBAL TAB _LMCAxisVOVMonitoring::@CT_
0$UINT,
2#0100000000000000$UINT, //TY__LMCAXISVOVMONITORING
1$UINT, 2$UINT, (SIZEOF(::_LMCAxisVOVMonitoring))$UINT, 
1$UINT, 1$UINT, 0$UINT, 
TO_UDINT(3513915334), "_LMCAxisVOVMonitoring", //Class
TO_UDINT(0), 0, 0$UINT, 0$UINT, //Baseclass
//Servers:
(::_LMCAxisVOVMonitoring.ClassSvr.pMeth)$UINT, _CH_CMD$UINT, 2#0000000000000000$UINT, TO_UDINT(619352855), "ClassSvr", 
//Clients:
(::_LMCAxisVOVMonitoring.ToVisInt.pCh)$UINT, _CH_CLT_OBJ$UINT, 2#0000000000000010$UINT, TO_UDINT(758519666), "ToVisInt", TO_UDINT(3511906983), "_LMCAxisVisInt", 1$UINT, 63$UINT, 
END_FUNCTION


#define USER_CNT__LMCAxisVOVMonitoring 1

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

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

	//Command Methods
	InitCmdTable (nCmd := nSTDCMD + USER_CNT__LMCAxisVOVMonitoring, pCmd := #vmt.CmdTable);
#pragma warning (disable : 74)
	vmt.UserFcts[0]		:= #Background();

#pragma warning (default : 74)
	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
1C584E59F342212FF2412A957A14F9956CC92EC4937F00D653803228CC91A878086A2789EEC5374C3E5A2594B30CA3C5EA3DF64801C2136B8B6100377AF09659555A3E8FDF69388C8E03477A7B18A4CAE1D29012AE95B8675789326E2E8B388435A74335
5BB1B5A5F001A443CD49D474869970464225A697D730E2B33C1F64AD2306F7B19B51F8C6713D746966F52F5A7CAE8ED44642C91562604EA8C0525A108839277AB9C0D22F3C23082E50E4C7CDC2F1CE5AF6562CC2AE8BEE52B9FA0EF6A42882553337DE68
50119300FB774DC570E6929136C1E0234BFCA0587F01AE20587D993D80ED26936EC8DBF783A6E70D001772CC1BF6E172B745075A8D21D83EE93DDC02F45F171BCB2F1FEE838BEEE6F2D1DC8124D837FC003736DF7089CE1AE142C998F81D882503E95C7A
DD35FDF811730DAFF3D1F2F2FEEAFE2C5D070A1B68245AA22A282B5EE5849440E7AF09B93B932EE25727D99272D2B4BEB5A07912B9CE799E190F5CA7E75B2B024512B803D87CCE9CF7EDD0861E8ED3991C447A4B3E0D1E861439AF71D9D0EA2206A4F4BA
1AACE3273C50E32E094DF2F0081CC67DDB9157833D594597F3DDBB98D5B4FE64EC0C5E62C521A92B630AB6A4E847A25ECA2519DAF5D5485A5FC8E44C507E16363D6ADE0A672141EBE77A97CEB510DD407495032C8771FE10ACB209C3BB3B3F1EB2C06253
1A7DDBB5FD2BC58D1BF4D9C5B35691201B8747B8889B605F13F5080B624AAD9109E670AF996CB11AE5244794A2F87F0781F1ED738AEA2E104EDF2C793EBF31C19735540AA0995729BE02F442A666215E097EA9122E79326FC1ADFB075F93C702D156CAE1
D38F4D09DB29ED2D0975CCE269C84FD68B0A22D0621CDB8F04559BAD2F0A331DE0BC918EC0D28CDF03F2D62C4EED66EEDC943F5AD5E5A31BB82BD309AE7B4C64B75EF11C5A9EFFB823CD3DEC243D1D01709A816B51A473E710C4BA9C6358C8EACDFA0F35
F459A5BDAA644E505740271DB15D068A5C095CBC38FB54DB99F0AD3B212E64310D15097AA0E634A26E7CBE213AE9380F280200D358AE3FB11FAE1927D7EA9041F28915513400D3DD43AFC997914A41C808B891C9C55983D35BBC5A93F51C5406B125FED7
775BA298F52487DB87EFE6729475EA599B292A0728C4BCDE7CCB1A11402018F9CC38A9524FDE5B764FD918DC73F53108AC3A91EF0DD941B875018522E921000BC0E91341D25287F09CBC5C87ED197BB09D24893D8DA85A672E9E6A146DBFD7BAF7FDCAA6
E6FE9D08915D7A8FF0AF9544683CAC90D4F8AB49922CDA4C9BFC9CAB14FF9D9DD160D7FB1F97BE57CE20C5CAF187DC71A9F543E01B67F75121EA4E2314235E9E7AA671755400D3CB18B5959C3F52C6C351C48BC6DBBDB1DE00C27C1DFFDFE74343A439FA
973A31056E5E396DBD760C2EC62D729A146B5E6141BF81AADF9EDA0F628545049E33ED28519D870D958A9D2885FE57070E930892EB42690B60AA2E39059F260858A38604EB2590598216ADFA57883E9F29E145B3E7223F51F478CD5C65DD075C877CD8FC
2532C8FDE5D604B58A8E7D9342411F3A4D2BCCAC91EE2108F607000791B5B80E3BE8BA06746FFF80173C42CE27B9D73573B9E4DE08E1F4483167E0340C96967ED66073553EBB23786AD6E5C97B29E147E363530B13683FD43B40DD7C6EBB0BD689F05D56
B4D00113F3165A4A215ED776B9F53FB690D05938E33C6A9145015161E7DCA6B42C3FFE47EF45BB417497537C8052BFF1BEBC90E3FA12DCB775D8F3BF59AC4143E52C80A1BD0EE636A802C74C778E36AEB74368686A2D2022A5468B0ABB72A1F2EBF1517E
5F8BFEEA92DBCB0DB6DD0ACE3B3600189E10569E67ABB57C859810631BA09A275F11BEFD9F78CD872530B25FCE63D4CFF6390A4FE5FA0872377FF93218F8791AAEBB7133A21E77F5EB1695DAC8018D52F4B3A63E1E6DD241294D2B941DB854EE6A211658
9A0B43890E001E91