Task Configuration

In addition to declaring the special PLC_PRG program, you can also control the processing of your project using the task management.

A Task is a time unit in the processing of an IEC program. It is defined by a name, a priority and by a type determining which condition will trigger the start of the task. This condition can be defined by a time (cyclic, freewheeling) or by an internal or external event which will trigger the task; e.g. the rising edge of a global project variable or an interrupt event of the controller.

For each task you can specify a series of programs that will be started by the task. If the task is executed in the present cycle, then these programs will be processed for the length of one cycle.

The combination of priority and condition will determine in which chronological order the tasks will be executed.

Each task can be enabled or disabled explicitly.

For each task you can configure a watch dog (time control); the possible settings depend on the target system.

Additionally there is the possibility to link System events (e.g. Start, Stop, Reset) directly with the execution of a project POU.

../_images/da5281b343759ea30a33139006eab46b

The Task Configuration is found as an object in the Resources tab of  the Object Organizer. The Task editor is opened in a bipartited window.

../_images/81256b6e43759fcb0a33139006eab46b

In the left part of the window the tasks are represented in a configuration tree. At the topmost position you will always find the entry ‘Taskconfiguration’. Below there are the entry ‘System events’ and the entries for the particular tasks, represented by the task name. Below each task entry the assigned program calls are inserted. Each line is preceded by an icon.

In the right part of the window a dialog will be displayed which belongs to the currently marked entry in the configuration tree. Here you can configure the tasks (Task properties), program calls (Program call) resp. define the linking of system events (System events). It depends on the target which options are available in the configuration dialogs. They are defined by a description file which is referenced in the target file. If the standard descriptions are extended by customer specific definitions, then those will be displayed in an additional tab ‘Parameter’ in the right part of the window.

Note

Please do not use the same string function (see standard.lib) in several tasks, because this may cause program faults by overwriting.

Which task is being processed?

For the execution, the following rules apply:

  • That task is executed, whose condition has been met; i.e., if its specified time has expired, or after its condition (event) variable exhibits a rising edge.
  • If several tasks have a valid requirement, then the task with the highest priority will be executed.
  • If several tasks have valid conditions and equivalent priorities, then the task that has had the longest waiting time will be executed first.
  • The processing of the program calls will be done according to their order (top down) in the task editor.
  • Depending on the target system PLC_PRG might get processed in any case as a free-wheeling task, without being inserted in the task configuration tree.