Overview
In TwinCAT RunMode, the DP master is always synchronized with the highest priority task with which the variables are linked. The cycle time for the corresponding task is displayed under Cycle time on the master's "FC310x" tab (for TwinCAT 2.8 and TwinCAT 2.9), as soon as the mapping has once been created. It is possible to set for the task whether the "I/O at task start" should be updated or not.
I/O at Task Start
If the setting "I/O at task start" has been selected using the checkbox, which is the default setting for the NC task, then a check is made before the task is started as to whether the previous DP cycle has been completed. The inputs and outputs (the outputs being those from the previous task cycle) are copied, and the DP cycle is started. In the example, the task cycle time is 2 ms, and real-time resources are 80%:
If, in the previous example, the copying of the inputs and outputs and the task computation time exceeds 0.8 ms, then NT will interrupt execution of the task, because 80% of real time resources has been reached:
This case would still not be a problem, because the DP cycle was completed within the available time. If "I/O at task start" is not selected, then the process is somewhat more critical, as is described below.
I/O not at Task Start
If the setting "I/O at task start" has not been selected using the checkbox, which is the default setting for the PLC task, then a check is made before the task is started as to whether the previous DP cycle has been completed, and the inputs are copied. After this the task is processed, and at the end of the task the outputs are copied and the DP cycle is started. In the example, the task cycle time is 2 ms, and real-time resources are 80%:
Because in the case where "I/O not at task start" is selected the task and the PROFIBUS must share the bandwidth, the effect of exceeding the available real-time resources is significantly greater than is the case when "I/O at task start" is selected:
In the case described, the DP cycle starts later, and is no longer finished within the time available before the following task cycle begins. The effect of this is that it is seen before the task is executed that the previous DP cycle has still not been completed. It follows that inputs are not copied before starting the task, so that the task computes with the old inputs; after the task has been processed no outputs are copied, nor is the DP cycle restarted, so that a DP cycle is omitted. The omission of a DP cycle can be detected with the CycleCounter, as described in the Master Diagnostics section.
Comparison of I/O at task start and I/O not at task start
An advantage when "I/O at task start" is selected is that the task and the DP cycle do not have to share the available bandwidth, and that the DP cycle starts very regularly, any jitter being the TwinCAT jitter. If "I/O not at task start" is selected, then it is more likely that a DP cycle will be omitted; the regularity of the start times of the DP cycles depends additionally on the jitter in the task processing. The disadvantage of the "I/O at task start" is that the dead time, or system reaction time, becomes longer.