Bus Cycle Task – EtherCAT
Behavior at Start
In principle, the input data used for each IEC task is read at the start of the task () and the output data is written to the I/O driver at the end of the task (
). The implementation in the I/O driver is decisive for additional transfer of the I/O data. It determines the time frame and the time when the actual transfer to the corresponding bus system occurs.
The bus cycle task of the PLC can be defined globally for all fieldbuses in the PLC settings. For some fieldbuses, however, you can change this independent of the global setting. The task with the shortest cycle time is used as the bus cycle task (setting: unspecified in the PLC Settings). The messages are normally sent on the bus in this task.
Other tasks copy only the I/O data from an internal buffer that is exchanged only with the physical hardware in the bus cycle task.
Frame at task start
If the FrameAtTaskStart
property is set to FALSE
, then the timing is as follows:

If the FrameAtTaskStart
property is set to TRUE
, then the timing is as follows:

Read inputs from input buffer
IEC task
Writing the outputs in the output buffer
Bus cycle
Input buffer
Output buffer
Copy data to/from bus
Bus cycle task, priority 1, 1 ms
Bus cycle task, priority 5
Bus cycle task, priority 10, interrupted by task 5
For more information, see the following: Property: "IoDrvEtherCAT.FrameAtTaskStart"
Task usage
The Task Deployment tab provides an overview of used I/O channels, the set bus cycle task, and the usage of channels.
Warning
If an output is written in various tasks, then the status is undefined, as this can be overwritten in each case.
If the same inputs are used in various tasks, then it is possible for the input to change during the processing of a task. This happens when the task is interrupted by a task with a higher priority and causes the process image to be read again.
Remedy: At the beginning of the IEC task, copy the input variables to variables and then work only with the local variables in the rest of the code.
Conclusion: Using the same inputs and outputs in several tasks does not make any sense and can lead to unexpected reactions in some cases.
For more information, see the following: "Task Configuration" chapter
Behavior of the bus cycle for EtherCAT
Before the IEC inputs are copied, the pending network messages of the last cycle are read.

When the Messages per task option is enabled in the settings of the EtherCAT Master, additional telegrams are transmitted to the devices employed per task and input or output employed. Channels that are used in a slow task are also transmitted less frequently. As a result, the bus load can be reduced.
