beckhoff TF4100 — 4.2.1.1.3 FB_CTRL_LOOP_SCHEDULER

PLC API Outputs VAR_OUTPUT eState : E_CTRL_STATE; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; END_VAR Inputs/ outputs VAR_IN_OUT stParams : ST_CTRL_LOOP_SCHEDULER_PARAMS; END_VAR stParams consists of the following elements: TYPE ST_CTRL_LOOP_SCHEDULER_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; tTaskCycleTime : TIME := T#0ms; nNumberOfControlLoops : UINT; pOutputVector_ADR : POINTER TO BOOL := 0; nOutputVector_SIZEOF : UINT := 0; END_STRUCT END_TYPE 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; eMode_CtrlLoop_1 : E_CTRL_MODE; eMode_CtrlLoop_2 : E_CTRL_MODE; TF4100 25 Version: 2.2.4 Name Type Description eState E CTRL STATE _ _ State of the function block eErrorId E CTRL ERROR _ _ CODES Supplies the error number [} 173] when the output bError is set. bError BOOL Becomes TRUE, as soon as an error occurs. Name Type Description stParams ST CTRL _ _ LOOP _ SCHEDULER _ PARAMS Parameter structure for the loop scheduler. Name Type Description tCtrlCycleTime TIME 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.

tTaskCycle Time TIME The cycle time with which the loop scheduler and the function blocks associated with the control loops are called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. nNumberOfContr olLoops UINT The number of control loops being managed. pOutputVector A _ DR POINTER TO BOOL Address of the output vector nOutputVector S _ IZEOF UINT Size of the output vector in bytes