Execution of Tasks
Original instructions
General
BMX P34 •••• processors can execute single-task and multi-task applications. Unlike a single-task application, which only executes master tasks, a multi-task application .defines the task execution priorities.
Master Task
The master task represents the application program’s main task. You can choose from the following MAST task execution modes:
The following illustration shows the cyclical execution of the MAST task:
The following illustration shows the periodical execution of the MAST task:
Both MAST task cycle modes are controlled by a watchdog.
The watchdog is triggered if the MAST task execution time is longer than the maximum period defined in the configuration, and causes a software error. The application then goes into HALT status, and the bit %S11 is set to 1 (the user must reset it to 0).
The watchdog value (%SW11) may be configured between 10 ms and 1,500 ms (default value: 250 ms).
NOTE: Configuring the watchdog to a value that is less than the period is not allowed.
In periodical operating mode, an additional check detects when a period has been exceeded. The PLC will not switch off if the period overrun remains less than the watchdog value.
Bit %S19 signals a period overrun. It is set to 1 by the system when the cycle time becomes longer than the task period. Cyclical execution then replaces periodical execution.
The MAST task can be checked with the following system bits and system words:
System Object
Description
%SW0
MAST task period
%S30
Activation of the master task
%S11
Watchdog default
%S19
Period exceeded
%SW27
Last cycle overhead time (in ms)
%SW28
Longest overhead time (in ms)
%SW29
Shortest overhead time (in ms)
%SW30
Last cycle execution time (in ms)
%SW31
Longest cycle execution time (in ms)
%SW32
Shortest cycle execution time (in ms)
Fast Task
The FAST task is for periodical processing and processing over short durations.
FAST task execution is periodical and must be quick so that no lower priority tasks overrun. The FAST task period can be configured (1 - 255 ms). The FAST task execution principle is the same as for periodical execution of the master task.
The FAST task can be checked with the following system bits and system words:
System Object
Description
%SW1
FAST task period
%S31
Activation of the fast task
%S11
Watchdog default
%S19
Period exceeded
%SW33
Last cycle execution time (in ms)
%SW34
Longest cycle execution time (in ms)
%SW35
Shortest cycle execution time (in ms)
Event Tasks
With event processing, the application program’s reaction time can be reduced for events originating from:
Event processing execution is asynchronous. The occurrence of an event reroutes the application program towards the process associated with the input/output channel, or to the event timer that caused the event.
Event tasks can be checked with the following system bits and system words:
System Object
Description
%S38
Activation of events processing
%S39
Saturation of the event signal management stack.
%SW48
Number of IO events and telegram processes executed
NOTE: TELEGRAM is available only for PREMIUM (not on Quantum neither M340)
Single Task Execution
A single-task application program is associated with one task; the MAST task.
The following diagram shows a single-task application’s execution cycle:
Multi-Task Execution
The following diagram shows the level of priority of the tasks in a multi-task structure:
The following diagram shows the execution of tasks in a multi-task structure: