Priority Between Motion and PLC
- Motion command, position feedback from each axis, and other elements in the EtherCAT PDO object are sent and received on the EtherCAT motion bus.
This includes servo drives and Remote I/O.- Motion engines are executed.
- I/O related to the PLC program are serviced.
See EtherCAT Processing Time for more information.- PLC programs are executed.
- NVRAM variables are saved.
See NVRAM Processing Time for more information.
|
Single Core Controller |
Multicore Controller |
|---|---|
|
|
Figure 2: Multicore Controller Cycle Execution with Data Exchange (arrows) |
-
-
The Motion time in the Cycle Execution On A Single-Core Controller image must be shorter than the basic cycle duration at each cycle.
This condition is checked at each cycle and, if the cycle is overran, Kollmorgen Automation Suite generates a fatal error and the application execution is stopped.
EtherCAT Processing Time
The EtherCAT frame is executed at the beginning of the cycle.
During this period, all the values related to EtherCAT are exchanged, including:
- Inputs are read
- Outputs are set
See PDOs for AKD, AKD2G, AKD-N, S300, or S700 for more information.
- Based on the I/O mapping to PLC variables, the I/Os are updated before they are effectively used during the PLC period.
- See Map Input and Output to Variables for more information.
- As a consequence, when the PLC variables set an Output, it is updated during the EtherCAT frame of the next cycle.
Variation during the EtherCAT Processing
The EtherCAT period is subject to time variation along the cycles because of these reasons:
- Some EtherCAT function blocks use asynchronous SDO communication, which is not deterministic.
- See EtherCAT Function Blocks that Work with SDOs for more information.
- Some EtherCAT slave devices support mailbox protocols.
- The master cyclically reads the mailbox of the EtherCAT slaves.
- Polling of the mailbox is performed every 50 cycles
- It is spread on several cycles depending on the number of EtherCAT slaves.
See the FAQs for information about SDO communication.
NVRAM Processing Time
Due to slow processing when saving Retain Variables to the NVRAM, this action is not performed each cycle.
- The save operation is performed in the background every 20 seconds.
- The frequency increases to each 2 seconds when the application is running.
- When executed during a cycle, it occurs after the PLC period.
Results when a PLC Program is Overrunning the Cycle Duration
Large application can require more than one cycle to completely execute all the PLC programs.
|
Single Core Controller |
Multicore Controller |
|---|---|
|
Figure 3: Application Overrunning the Basic Cycle on a Single-Core Controller |
Figure 4: Application Overrun Multicore Controller |
The Application Overrunning the Basic Cycle on a Single-Core Controller image is an example of an application with two PLC programs (A and B). It takes two cycles to execute all the code in the two programs.
- Cycle 1 executes most of Prog. A
- Cycle 2 finishes Prog. A and executes Prog. B, which is set to run with a cycle period of every other cycle.
- Cycle 3 starts executing Prog. A again
Notes
- Even if there is time left over in the cycle, execution of Prog. A does not start until the next cycle.
- An application overrun has no effect other than a short delay in the application execution. Execution of the real-time application is recovered as soon as the overload disappears.
- When running with the KAS Simulator, there is no overrunning because the cycle is extended to include all the PLC programs, right after the Motion computation.
-
-
If Outputs are set when a program runs over several basic cycles, unexpected and potentially dangerous effects can happen.
See Also





