The EtherCAT State Machine (ESM) coordinates the master and slave applications during startup and operation. The state changes of slave devices are usually initiated by requests from the master; however, in some cases, the local applications of the slave can also independently change states. To transition from the Initialization state to the Operational state, EtherCAT devices must sequentially pass through the Pre-Operational state and the Safe-Operational state.
In the Init state, the application layer does not perform any communication; the master can only access the registers of the data link layer to obtain relevant information.
When transitioning from the Init state to the Pre-Operational state, a request to enter the Pre-Operational state is issued by the master. The master configures the SyncManager channel through mailbox communication and initializes the synchronization of the distributed clock.
In the Pre-Operational state, the application layer can perform mailbox communication, but process data is not yet exchanged.
When transitioning from the Pre-Operational state to the Safe-Operational state, a request to enter the Safe-Operational state is issued by the master. The master sets the process data mapping parameters using mailbox communication, configures the SyncManager channel for process data communication, and the FMMU channel.
In the Safe-Operational state, process data communication begins: input data can be read, but output data has not yet been written.
When transitioning from the Safe-Operational state to the Operational state, a request to enter the Operational state is issued by the master, which sends valid output values to the slave.
In the Operational state, the output values remain valid, and input data continues to be read continuously as in the Safe-Operational state.
The Bootstrap state can only be entered from the Init state and can only return to the Init state. This state is recommended for firmware updates. In the Bootstrap state, the application layer can perform mailbox communication, but only supports the File-Access-Over-EtherCAT (FoE) protocol; no process data communication is performed.
As shown in the figure below, the state of the slave can be observed.
