EtherCAT State Machine
The EtherCAT state machine is used to manage the communications states between the master and slave applications when EtherCAT communications are started and during operation, as shown in the following figure.
A state machine is implemented in each EtherCAT communication device. For each state it is defined which communication services are possible, i.e., active via EtherCAT. The state machine of the slave stations is controlled via the state machine of the EtherCAT master. This means that the state changes of a slave are usually requested by the master.
Note 1): The Bootstrap state can be entered and exited by clicking the state change buttons provided in the 'General' tab of the 'Online Functions' editor .
In the following state descriptions, also EtherCAT communication protocols are mentioned which are not yet supported by PLCnext Technology.
Note
In the EtherCAT Online Functions, buttons are provided for requesting state changes of the master and the slaves connected. |
| State/Transition | Description |
| Init - 01h | After switching on, the EtherCAT devices are in the Init state. In this state neither mailbox nor process data communication is possible. |
| Init > Pre-Op | The EtherCAT master ...
- initializes the SyncManager channels 0 and 1 for mailbox communication. (See background information below.)
- sets the DL address and the AL control register.
- initializes DC clock synchronization.
- requests the Pre-Operational state.
The slaves check whether the mailbox was initialized correctly.
Background information: SyncManager
The SyncManager ensures the consistent data exchange between EtherCAT master and slaves. It reads receive (RX) data from the EtherCAT frame or embeds transmit (TX) data into the frame. By preventing simultaneous access to the same data area by the master and a slave, a memory area cannot be overwritten at the same time during reading. 4 SyncManager channels are defined:
- Channel 0 - RX SDO: Service data objects are transmitted from the EtherCAT frame to the mailbox.
- Channel 1 - TX SDO: Service data objects are transmitted from the mailbox to the EtherCAT frame.
- Channel 2 - RX PDO: Reading process data objects from the EtherCAT frame.
- Channel 3 - TX PDO: Writing process data objects to the EtherCAT frame.
|
Pre-Operational (Pre-Op) - 02h |
- No process data communication is possible
- Mailbox communication is possible
- Settings for the process data transfer as well as module-specific parameters which differ from the default settings are transferred.
|
| Pre-Op > Safe-Op | The EtherCAT master...
- sets the SyncManager channels and FMMU channels for process data.FMMU means Fieldbus Memory Management Units. They map logical addresses to physical addresses of the EtherCAT Slave Controller.
- uses SDOs to set the PDO mappings and the Sync Manager PDO assignment parameters.
- requests the Safe-Operational state.
Each EtherCAT slave...
- checks if the SyncManager channels for process data communication are correct. Before it acknowledges the state change, the EtherCAT slave copies current input data to the corresponding DP RAM areas of the EtherCAT slave controller.
- checks if the distributed clock settings are correct (if required).
|
Safe-Operational (Safe-Op) - 04h |
- Mailbox communication is possible.
- Process data communication is possible. However, input data are cyclically updated but the outputs are deactivated (output data is invalid).
|
| Safe-Op > Op |
- The master sends valid output data.
- The master requests the Operational state.
|
Operational (Op) - 08h |
- Mailbox communication is possible.
- Process data communication is possible.
- Input data is cyclically updated and the EtherCAT master sends output data to the EtherCAT slaves.
- An EtherCAT slave copies the output data of the master to its outputs and returns the input data to the EtherCAT master.
|
Bootstrap - option (Boot) - 03h | This state can only be reached from the Init state and exited to the Init state by clicking the state change buttons in the 'General' tab of the 'Online Functions' editor . In the Bootstrap state, the firmware of an EtherCAT slave may be updated via the EtherCAT master.
- Only mailbox communication via the protocol File-Access over EtherCAT (FoE) is possible.
For transferring a file, the 'Online Functions' editor provides the .
- Other mailbox and process data communications are de-activated.
|