-

'Tasks and Events' Editor (PLCnext)

The following information refers to a specific, typical device type. Your screen may differ.

This help topic describes the 'Tasks and Events' editor of the 'PLCnext' PLANT node. The editor is used for creating and configuring the tasks to be executed by the various controller cores including all task properties (task type, cycle time etc.). Furthermore, the editor allows the instantiation of program POUs. For that purpose, open the drop-down list in the column 'Program type' and select the desired program in the list.

By selecting the program from the list box, you can instantiate IEC 61131-3 programs as well as non-IEC 61131-3 programs.

Further Info
The steps to be done in the 'Tasks and Events' editor are described in the help chapter "Task Configuration"

This topic contains the following sections:

Toolbar of the editor

Toolbar buttonDescription
Moves the selected entry upwards:
  • If a task is selected, the current row is moved by one task.
  • A program instance (child element of a task) can only selected if the task contains at least two program instances. The selected instance is moved up within the same task.
Moves the selected entry downwards:
  • If a task is selected, the current row is moved down by one task.
  • A program instance (child element of a task) can only selected if the task contains at least two program instances. The selected instance is moved down within the same task.
Opens the toolbar for local find and replace operations.

Description of the task editor table

The 'Tasks and Events' editor contains a hierarchically structured table where tasks and events can be specified and program instances can be assigned.

Entries in the table can be expanded and collapsed by clicking the appropriate icons and

ColumnDescription
NameName of the table entry. Depending on the hierarchical position, this can be:
  • ESMx identifier:
    Each core of the controller is represented as ESM node in the table. By expanding an ESM entry, the contained tasks with their task properties become visible. Here, new tasks are added and configured.
  • Task name: user-defined identifier of the task.

    Exception: The name of the SafetyProxyTask cannot be edited.

  • Program instance name: After assigning a program type to a task, a default instance name is derived from the program type name. You can modify this name.
You can modify the order of the tasks and program instances in the corresponding table by dragging them to the desired position, or by cutting and pasting a table row or by using the 'Up'/'Down' toolbar icons.
Component nameDisplays the name of the PLCnext component.
Task typeThe task type specifies the condition which starts the execution of the task.

The available types can be selected from a drop-down list.
Refer to the topic "Task/Event Properties and Types" for details on the available task types.
Event NameEvent that triggers the execution of the task. Only available for Event Tasks. The task is started as soon as the selected event occurs.

The selection list provides all predefined user events and system events.

User events are defined by the user in a C++ program.

For a description of the available system events refer to the topic "System Event Tasks".
Program TypeProgram that is assigned to the task (type of the instance).

Left-clicking into the field opens the Role Picker. The tree on the left shows the structure of the program POUs as organized in the 'Programs' folder (COMPONENTS area). On the right, the available program POUs are provided for selection.
Interval (ms)Time interval in ms in which the cyclic task is executed (integer or floating point value). Only available for cyclic tasks.

The time value should be a multiple of the timer resolution of the target device.

Note
Enter floating point values 0.xxx for specifying interval durations in the range of µs.

PriorityPriority for calling the task (number between 0 and 15). 0 is the highest and 15 the lowest priority. The task with the highest priority is called first.
Threshold (ms)Execution time threshold value in milliseconds. This value supports you in monitoring the application:
If a value > 0 is specified and the task execution lasts longer than this threshold, the value of the EXEC_TIME_THRESHOLD_CNT variable (contained in the TASK_INFOS system variable) is incremented.
Both the set threshold value and the threshold exceeded counter can be read out from the TASK_INFOS system variable which is contained in the ESM_DATA system variable (data structure) for monitoring purposes:
  • Set threshold value: ESM_DATA.ESM_INFOS[*].TASK_INFOS[*].EXEC_TIME_THRESHOLD (data type LINT)
  • Current counter value: ESM_DATA.ESM_INFOS[*].TASK_INFOS[*].EXEC_TIME_THRESHOLD_CNT (data type UDINT)
The EXEC_TIME_THRESHOLD_CNT value is reset at each controller cold and warm start.
Watchdog (ms)Maximum time a task is allowed to run for one cycle (call). If the watchdog time exceeds, a watchdog error is generated and the CPU goes into STOP state. This way, the watchdog monitors the execution and completion of a task within the defined time. The watchdog is executed during each system cycle.

For cyclic tasks, the watchdog time normally should be shorter than the system cycle time.

The valid value range depends on the target. Please refer to the PLCnext Info Center and the device manual for minimum and maximum watchdog settings.

Note
The value 0 deactivates the watchdog.

For information on the watchdog time refer to the topic "Tasks and Watchdog".
CommentComment for the core, task or program instance.