84 • Fieldbus Controller
Fieldbus Controller 750-872/020-000
WAGO-I/O-SYSTEM
750
ETHERNET TCP/IP
3.1.8.3 Some Basic Facts about IEC Tasks
Attention
Consider please with the programming of your IEC tasks the following facts.
•
All IEC tasks must have a different priority level. If two tasks have the
same level, an error message is displayed when the program is compiled.
•
A running task can be interrupted by a task of higher priority. The
interrupted task will resume execution after all higher priority tasks are
completed.
•
If several IEC tasks use the same input/output variables from the process
image, the values of the input /output variables can change during the
execution of each IEC task, causing contention in the application program.
•
After every task cycle, freewheeling tasks are stopped for half of the time
needed by the task itself (min. 1 ms). After that, a new task is started.
Example:
First task 4 ms
--> Waiting time 2 ms
Second task 2 ms
--> Waiting time 1 ms
•
If no task is applied in the task configuration, a freewheeling default task is
applied when the program is compiled. The watchdog of this task is
deactivated. This task, named "DefaultTask", is internaly identified with
this name, so don’t use this name for your own tasks.
•
Only for cyclic tasks the sensitivity value is used. Sensitivity values of 0
and 1 are synonymic. A value of 0 or 1 means that the watchdog triggers on
a single cycle time overrun. With a sensitivity value of 2 for example, the
watchdog triggers on two consecutive cycle time overruns.
•
To cyclic tasks with activated watchdog applies:
- Is the adjusted maximum runtime less than the sampling rate, the
watchdog will also trigger if the runtime exceeds the sampling rate,
irrespective of the value that has been entered for the sensitivity.
- Is the adjusted maximum runtime greater then the sampling rate, the
watchdog will trigger if the maximum runtime is exceeded, irrespective of
the value that has been entered for the sensitivity.
3.1.8.3.1 Flowchart of an IEC Task
•
Get system time (tStart).
•
If the last I/O bus cycle is not complete.
-> Wait for the end of the next I/O bus cycle.
•
Read the inputs and the outputs from the process image.
•
If the user application program is running.
-> Execute the program code of this task.
•
Write the outputs into the process image.
•
Get system time (tEnd).
-> tEnd - tStart = run-time of the IEC task.