PLC-API VAR_INPUT VAR_INPUT nManValue : DWORD; eMode : E_CTRL_MODE; END_VAR nManValue : This input allows the first 32 bits in the output vector to be set in eCTRL_MODE_MANUAL. A 1 sets the first bit, a 2 the second bit, a 3 the first and second bits, ... eMode : Input that specifies the operation mode [ } 16] of the function block. VAR_OUTPUT VAR_OUTPUT eState : E_CTRL_STATE; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; END_VAR eState : State of the function block. nErrorID : Returns the ADS error number [ } 16] when the bError output is set. bError: Becomes TRUE, as soon as an error occurs. VAR_IN_OUT VAR_IN_OUT stParams : ST_CTRL_LOOP_SCHEDULER_PARAMS; END_VAR stParams :
Parameter structure for the loop scheduler. This consists of the following elements: TYPE ST_CTRL_LOOP_SCHEDULER_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; (* controller cycle time [TIME] *) tTaskCycleTime : TIME := T#0ms; (* task cycle time [TIME] *) nNumberOfControlLoops : UINT; pOutputVector_ADR : POINTER TO BOOL := 0; nOutputVector_SIZEOF : UINT := 0; END_STRUCT END_TYPE tCtrlCycleTime : The cycle time with which the control loops managed by the loop scheduler are processed. This must be greater than or equal to the TaskCycleTime. tTaskCycleTime : The cycle time with which the loop scheduler and the function blocks associated with the control loops are called.
If the block is called in every cycle this corresponds to the task cycle time of the calling task. nNumberOfControlLoops : The number of control loops being managed. pOutputVector_ADR :.Address of the output vector. nOutputVector_SIZEOF :Size of the output vector in bytes. Sample: PROGRAM PRG_LoopScheduler VAR arrOutputVector : ARRAY[1..5] OF BOOL; eMode : E_CTRL_MODE; stParams : ST_CTRL_LOOP_SCHEDULER_PARAMS; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; fbCTRL_LoopScheduler : FB_CTRL_LOOP_SCHEDULER; bInit : BOOL := TRUE; (* modes of the control loops *) eMode_CtrlLoop_1 : E_CTRL_MODE; eMode_CtrlLoop_2 : E_CTRL_MODE; eMode_CtrlLoop_3 : E_CTRL_MODE; TS4100 23 Version: 1.1