“PLC_Task” Main Task
Configured tasks are displayed below the task configuration in the Program Structure. A “PLC_Task” main task is automatically created first for each task configuration. Tasks can be edited or deleted. The number behind the task indicates how many program calls are associated with the task. The task can be double-clicked to change the name. Other tasks can be extended by right-clicking them in the task configuration and choosing Add New Element > Task in the context menu.
For additional information, see CODESYS online help: “Task Configuration Editor > Configuration Dialog”.
Parameter | Description |
---|---|
Priority (1...15) | Indicates the task priority on a scale between 1 to 15 1 = highest priority Task priority can affect the runtime behavior of the controller and enable watchdog for real-time priorities!
|
“Cyclic” Type | Defines the time after which the task will be restarted. The cycle time (e.g., “200”) corresponds to the task cycle time entered in the “Interval” field in milliseconds “ms” or microseconds “µs”. Note: When entering the task cycle time, consider system requirements. For example, in CAN bus systems, this must fit the currently set baud rate and the number of frames used on the bus. |
“Event” Type | Starts the processing of the task as soon as a rising edge occurs on the variable defined in the “Event” text field The […] button opens the Input Assistant with a list of all available global variables. Note: If the event that controls a task comes from an input, there must be at least one task that is not event-triggered. Otherwise the inputs and outputs are never updated and the event-controlled task is never started. |
“External” Type | Starts task processing as soon as the event defined in the “Event” field occurs (events dependent on the target system) |
“Freewheeling” Type | Begins task processing at the start of the program and restarts automatically in a continuous loop at the end of the task (no defined cycle time) |
“Status” Type | Starts task processing if the variable of the “Event” field has the value TRUE |
Watchdog | Defines watchdog parameters for a task. Depending on the device used and definitions in the respective device description, setting options (upper/lower limits, default values, units, etc.) may be different than the settings shown. The watchdog can be switched off for specific cycles. |
Enable | If this option is activated, the watchdog is active. The task ends with an error status if the entered cycle time incl. set tolerance (sensitivity) is exceeded. Several successive timeouts: With Single Timeout: Example: Cycle time 10 ms and sensitivity 5 If this option is deactivated, the watchdog is deactivated. There is no task watchdog. |
[Add call] | Opens a dialog for adding a program or POU call The dialog can likewise be opened in the Program Structure (right-click on a task > Program Call). For additional information, see CODESYS online help: “Program Call” |
[Remove Call] | Removes the selected program call |
[Change Call] | Opens the Input Assistant for selecting another program or POU |
[Move up] | Moves the selected program or POU up by one position in the processing sequence |
[Move down] | Moves the selected program or POU down by one position in the processing sequence |
[Open POU] | Opens the selected program in the programming editor |