Object: “Task”
“Priority” |
Possible values: 0..31, where 0 is the highest priority |
“Task group” |
Assigned task groups which can be assigned to specific processor cores in multicore Example: IEC Tasks Note: The task group is shown in brackets after the task in the device tree. |
When using a runtime system in Linux, there exist fixed dependencies between task groups and priorities. For more information, see: ⮫ “Mapping of Task Priorities on a Linux System”
Type “Cyclic” |
Processing of the task is done cyclically. |
Input field Interval |
Required Time span after which the task is restarted (task cycle time)
Note: Deviations of the task from this desired task cycle time are displayed at runtime as periodic jitter on the Watchdog tab. |
Time unit of the interval |
If only a number and not a time definition is specified in the Interval input field, then the unit selected here determines the time dimensions. Example: ms Note: A task cycle time in µs is always displayed as a number. |
Type “Event” |
Processing of the task starts event-controlled on the rising edge of the event variable. |
Input field “Event” |
Global variable (Boolean type) The task starts as soon as the variable value switches from 0 to 1. |
Type “External” |
Processing of the task starts event-controlled on the rising edge of the event variable. |
List box “Event” |
List with target system-dependent events (Boolean type) Note: The target system determines which events are supported and offered in the list box. Hint: Not to be confused with system events |
“Interval” |
Time definition in TIME format or as a number with a time unit Note: Only available when the event requires a time definition |
“Freewheeling” |
Processing of the task starts automatically in a continuous loop at program start and at the end of a complete pass Note: A cycle time is not defined. |
“Status” |
Processing of the task starts state-triggered by the event variables |
Input field “Event” |
Global variable (Boolean type) When the variable has the state TRUE hat, the task starts. |




NOTICE

For fieldbuses, a fixed cycle matrix is necessary to assure a determined behavior. Therefore, you should not use TypeFreewheeling for a bus cycle task.




NOTICE

Note the following difference between the processing types Status and Event. If the given event yields TRUE, then the start condition of a task of type Status is fulfilled. In contrast, the start of a task of type Event requires a switch of the event from FALSE to TRUE. If the sampling rate of the task scheduler is too low, then the rising edge of the event can remain unnoticed.




NOTICE

When setting the task cycle time, you have to identify which bus system is currently being used. For example, the task cycle time in a CAN bus system must match the currently set baud rate and the number of frames used in the bus. In addition, the times set for heartbeat, node guarding, and sync should always be a multiple of the task cycle time. If not, then CAN frames can be lost.
Defines the time monitoring for a task. If the target system supports an advanced watchdog configuration, then the following settings may be predefined in the device description.
The default watchdog settings depend on the device. |
|
“Enable” |
The watchdog is active. If the task exceeds the currently set “Time” of the watchdog, then the task is halted with an error status (exception). The application in whose task the error occurred and its child applications are also halted. In this way, all tasks of the affected applications are also halted. Then the currently defined “Sensitivity” is also taken into account. If you activate the option “Update I/Os” in the “PLC Settings” of the PLC, then CODESYS resets the outputs to the defined default values. Possible cases:
|
“Time (e.g. t#200ms)” |
Watchdog time Defines (together with “Sensitivity”) the watchdog for a task; description as for “Enable”. Depending on the target system, the monitoring time span is given as a percentage of the task interval if possible. In this case, the list box for the unit is disabled and displays “%”. |
“Sensitivity” |
Number Defines (together with the watchdog) the watchdog for a task; description as for “Enable”. |
Using the functions from the library CmpIecTask.library
, you can deactivate a watchdog for specific PLC cycles. This is useful for cycles
that demand more time due to initialization.
Example
Deactivating/reactivating the watchdog:
hIecTask := RTS_IEC_HANDLE //Declaration of the variable hIecTask hIecTask := IecTaskGetCurrent(0); IecTaskDisableWatchdog(hIecTask); // Watchdog disabled ... IecTaskEnableWatchdog(hIecTask); Watchdog enabled
List of “POU”s that the task calls The calling order corresponds to the POU order in the list (from top to bottom). |
|
“Add Call” |
Defines a new program call |
“ Open POU” |
Opens the selected POU |
“Move Up” “Move Down” |
Changes the calling order |
The normal watchdog of an IEC task is triggered when the execution time of the IEC task exceeds the watchdog time. The "Omitted Cycle" watchdog is triggered when the task does not start at all. This is the case when the task does not execute any cycle at all within the maximum of <Time * Sensitivity> or <2 * Interval>. The cause could be crowding by other tasks or a failure in the scheduler, which no longer enables the task.