General information
The term "bus" includes all fieldbuses as well as the ⮫ I/O bus. Consider that there is no bus cycle task for Modbus as Modbus does not provide I/O mapping and is controlled by POUs.
It's recommended to define a dedicated bus cycle task for each fieldbus configured in the project. It's strongly recommended not to use "unspecified" in the "“PLC Settings”" to avoid unexpected behavior. The task defined in “PLC Settings” determines the bus cycle task of I/O bus and, depending on the configuration, of the additional fieldbuses (the setting is by default inherited).
Especially in case of EtherCAT, a dedicated bus cycle task should be used which is not shared with other fieldbuses. If [unspecified] is set in the “PLC Settings”, the EtherCAT task might be automatically used by other fieldbuses, potentially causing the EtherCAT task processing to fail. This should be avoided by specifying a task different to the EtherCAT task in the “PLC Settings”.
As a rule, for each IEC task the used input data is read at the start of each task and the written output data is transferred to the I/O driver at the end of the task. The implementation in the I/O driver is decisive for further transfer of the I/O data. The implementation is therefore responsible for the timeframe and the specific time when the actual transmission occurs on the respective bus system.
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.

(1) Read inputs from input buffer (2) IEC task (3) Write outputs to output buffer (4) Bus cycle (5) Input buffer (6) Output buffer (7) Copy data to/from bus (9) Bus cycle task, priority 1, 1 ms (10) Bus cycle task, priority 5 (11) Bus cycle task, priority 10, interrupted by task 5
Using tasks
The “Task Deployment” provides an overview of used I/O channels, the set bus cycle task, and the usage of channels.




WARNING

Unexpected behavior due to the use of the same inputs and outputs in multiple tasks
If an output is written in various tasks, then the status is undefined, as this can be overwritten in each case.
When the same inputs are used in various tasks, the input could change when a task is processed. This happens if the task is interrupted by a task with a higher priority and causes the process map to be read again.
Solution:
-
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.
PROFINET IO bus cycle behavior
PROFINET IO does not provide any additional settings. Its functionality corresponds to the general description.