Priority Between Motion and PLC
- Motion command, position feedback from each axis, and other elements in the EtherCATEtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs 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 (for more details, EtherCAT Processing Time)
- PLC programs are executed
- NVRAM"Non-volatile random access memory" NVRAM is the general name used to describe any type of random access memory which does not lose its information when power is turned off. This is in contrast to the most common forms of random access memory today, which both require continual power in order to maintain their data. NVRAM is a subgroup of the more general class of non-volatile memory types, the difference being that NVRAM devices offer random access, like hard disks. The best-known form of NVRAM memory today is flash memory variables are saved (for more details, NVRAM Processing Time)
Figure 6-66: Priority Between Motion and PLC
-
-
The Motion time (see figure above) 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 (PDO) are exchanged, including:
- Inputs are read
- Outputs are set
Based on the I/O mapping to PLC variables, the I/Os are updated before they are effectively used during the PLC period.
As a consequence, when the PLC variables set an Output, it is updated during the EtherCAT frame of the next cycle.
About Variation during the EtherCAT Processing
The EtherCAT period is subject to time variation along the cycles due to the following reasons:
- Some EtherCAT function blocks are using the asynchronous SDO communication, which is not deterministic.
- Some EtherCAT slave devices support mailbox protocols.
The master cyclically reads the mailbox of the EtherCAT slaves (polling of mailbox is performed every 50 cycles and is spread on several cycles depending on the number of EtherCAT slaves)
See also the FAQ about SDO communication.
NVRAM Processing Time
Due to a slow processing when saving the Retain Variables to the NVRAM, this action is not performed each cycle. The save operation is performed in the background every 20 seconds (frequency increases to each 2 seconds when the application is running).
When executed during a cycle, it occurs after the PLC period.
What happens when a PLC Program is overrunning the Cycle Duration
Large application can require more than one cycle to completely execute all the PLC programs.
Figure 6-67: Application Overrunning the Basic Cycle
The figure above shows 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
-
-
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.
-
-
If Outputs are set when a program runs over several basic cycles, unexpected and potentially dangerous effects can happen.
-
-
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.
See Also: Priority Between PLC Programs