PLC-API VAR_IN_OUT VAR_IN_OUT stParams : ST_CTRL_GET_SYSTEM_TIME; END_VAR stParams : Parameter structure of the function block. This consists of the following elements: TYPE ST_CTRL_GET_SYSTEM_TIME: STRUCT tTaskCycleTime : TIME; (* task cycle time [TIME] *) tCtrlCycleTime : TIME; (* controller cycle time [TIME] *) END_STRUCT END_TYPE tCtrlCycleTime : Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. tTaskCycleTime : Cycle time with which the function block is called.
If the function block is called in every task cycle this corresponds to the task cycle time of the calling task. Requirements 5.2.2 FB_CTRL_GET_TASK_CYCLETIME (only on a PC system) This function block allows the task cycle time of a program to be determined with a resolution of 1 ms. The TaskCycleTime can only be correctly determined if the program does not contain any active breakpoints. The task cycle time is only determined once. No further measurements are taken if either of the bCycleTimeValid or bError outputs is TRUE. This function block should not be used if cycle times of less than 1 ms, or that are not a multiple of 1 ms, are in use. VAR_INPUT VAR_INPUT eMode:
E_CTRL_MODE; END_VAR eMode : Input that specifies the block's operating mode [ } 16] . VAR_OUTPUT VAR_OUTPUT tTaskCycleTime : TIME; (* resolution: 1ms *) bCycleTimeValid : BOOL; eState : E_CTRL_STATE; TS4100 20 Version: 1.1 Development environment Target system type PLC libraries to be linked TwinCAT v2.8 PC (i386) TcControllerToolbox.lib