Vai al contenuto

Diagnostic features

The EtherCAT Master reads two configuration files generated by EtherCAT configurator:
  • An ENI file, EtherCAT Network Information, which is a standardized description of the network, that is the output of the EtherCAT configurator
  • An XML configuration file, describing the mapping of PLC I/O variables with PDO Entries; this file includes some other master parameters
At start-up, the master first interprets the ENI, which is sufficient to make a network operable, perhaps for debugging purposes, then reads the configuration XML, opens the communication port, and waits to see the link on that port.As soon as the link is detected, the master:
  • it starts sending packets on the network with the timing required
  • synchronizes the system clock: in case of configuration with distributedclock, the whole system must be synchronized at network time.
Under normal operating conditions, there are some start-up phases before the network becomes operative: all slave configurations are sent by init commands, these commands carry some specific configurations for each slave. Each slave will step through the following states:
  • INIT: initialization phase
  • PREOP: pre operational, no data-exchange occur between master and slaves
  • SAFEOP: safe operational, only input data from slaves to the master are exchanged
  • OP: operational, full data-exchange can happen
If Distributed clock is used, all slaves operating in distributed clock must synchronize their clocks with that of the sync master.The EtherCAT master must also be synchronized to the network clock, and with it the I/O task cycle and a number of connected activities.Managing the distributed clock on the master takes place in some phases:
  • IDLE: The master clock is completely independent from the slaves
  • SYNCHRONIZING: The master is making preliminary measurements to synchronize with the slaves
  • WAITING_START_TIME: After the master has synced with the slaves, you have to wait for the START_TIME, which is the first time the slaves implement I/O
  • COMPENSATING: If the master clock is synchronous with that of the slaves and after START_TIME has passed, the management goes into this state, which means that the Master is constantly tracking the clocks of the network, in this state typically all slaves are in OP state
  • NOT_SYNCHRONIZED: If for any reason the master fails to follow the network clock, then management goes into this state and all the slaves involved go to the SAFE_OP state.
Some master and slave diagnostic structures provide information about the states discussed above inside the PLC.In these structures and their functions one can refer to a slave in two different ways:
  • Using the index, positional on the EtherCAT network, the index starts from 0
  • Using a physical address, which can also be selected by the user during configuration
In addition to diagnostic structures, the Master stack can trigger events that can be detected by the PLC application and other plugins in terms of callbacks or callback tasks invocation. Events can typically be:
  • the status change of slaves,
  • communication errors,
  • emergency CoE messages,
  • distributed clock status variation,
  • resync events, which occur when the slaves or the entire network are ready to go into operating mode,
  • and finally the network recovery event, which indicates a reboot of EtherCAT communi- cation to deal with a serious error case.
When an event occurs, that event triggers:updating diagnostic structures related to that eventinvoking callback functions for registered pluginsthe execution of the special plc task ECAT_Notify, which can be used to read the updated diagnostic structuresas an alternative to the ECAT_Notify task, there is also the ECAT_Resync task, that is invoked at the first time that a node or the whole network goes into operating mode: this allows the PLC programmer to perform additional slave configurations by sending and receiving SDOs.