Task ConfigurationΒΆ

In the task configuration, you define one or more tasks for controlling and executing the application program in the controller. Each application must include a Task Configuration object.

A task is a time-based flow unit of an IEC program. You define a task with a name, a priority, and a type, which determines which condition triggers the start of the task. You can define this condition either by time (cyclic-interval, freewheeling) or by the occurrence of an internal or external event to process the task. Examples of an event are the rising edge of a global project variable or an interrupt event of the controller.

A task calls one or more program blocks (POUs). These programs can be application-specific (objects below the application in the device tree) or project-specific (objects available in the POU window). In the case of a project-specific program, the application instances the project-global program. If CODESYS processes the task in the current cycle, then the programs are executed for the duration of a cycle.

With the combination of priority and condition, you define the order in which the tasks are processed. You can configure a watchdog for each task, and you can link a start, stop, and reset directly to the execution of the project block.

Rules for the processing order of the defined tasks:

Attention

All tasks share one process map. The reason is as follows: When each task has its own individual process map, performance is compromised. However, the process map can be consistent only with one task. When you create a project, you must ensure that the application copies the input and output data to a safe location in case of conflicts. Modules, such as the library SysSem, provide the capability of solving consistency and synchronization problems.

Consistency problems can also occur when accessing other global objects, such as global variables or blocks. Consistency problems always occur if several tasks read and write to one variable. Modules, such as the library SysSem, are available as a solution.

Also see