ST_EcExtendedSlaveState
The structure ST_EcSlaveState contains the EtherCAT state and the link state of an EtherCAT slave device.
TYPE ST_EcSlaveState:
STRUCT
deviceState :BYTE;
linkState :BYTE;
extendedState :BYTE;
END_STRUCT
END_TYPEName | Type | Description |
|---|---|---|
deviceState | BYTE | EtherCAT state of a slave |
linkState | BYTE | Link status of an EtherCAT slave |
extendedState | BYTE | Extended EtherCAT state of a slave |
deviceState
EtherCAT state of a slave. The status can adopt one of the following values:
Constant | Value | Description |
|---|---|---|
EC_DEVICE_STATE_INIT | 0x01 | Init state |
EC_DEVICE_STATE_PREOP | 0x02 | Pre-Operational state |
EC_DEVICE_STATE_BOOTSTRAP | 0x03 | Bootstrap state |
EC_DEVICE_STATE_SAFEOP | 0x04 | Safe Operational state |
EC_DEVICE_STATE_OP | 0x08 | Operational state |
In addition, the following bits can be set:
Constant | Value | Description |
|---|---|---|
EC_DEVICE_STATE_ERROR | 0x10 | State machine error in the EtherCAT slave |
EC_DEVICE_STATE_INVALID_VPRS | 0x20 | Invalid vendor ID, product code, revision number, or serial number |
EC_DEVICE_STATE_INITCMD_ERROR | 0x40 | Error during sending of initialization commands. |
EC_DEVICE_STATE_DISABLED | 0x80 | Slave is disabled |
linkState
Link status of an EtherCAT slave. The Link state can consist of an ORing of the following bits:
Constant | Value | Description |
|---|---|---|
EC_LINK_STATE_OK | 0x00 |
|
EC_LINK_STATE_NOT_PRESENT | 0x01 | No EtherCAT communication with the EtherCAT slave |
EC_LINK_STATE_LINK_WITHOUT_COMM | 0x02 | Error at port X (specified through EC_LINK_STATE_PORT_A/B/C/D). The port has a link, but no communication is possible via this port. |
EC_LINK_STATE_MISSING_LINK | 0x04 | Missing link at port X (specified through EC_LINK_STATE_PORT_A/B/C/D). |
EC_LINK_STATE_ADDITIONAL_LINK | 0x08 | Additional link at port X (specified through EC_LINK_STATE_PORT_A/B/C/D). |
EC_LINK_STATE_PORT_A | 0x10 | Port 0 |
EC_LINK_STATE_PORT_B | 0x20 | Port 1 |
EC_LINK_STATE_PORT_C | 0x40 | Port 2 |
EC_LINK_STATE_PORT_D | 0x80 | Port 3 |
extendedState
Extended state of an EtherCAT slave. The extended status contains the following bits:
Bin number | Value | Description |
|---|---|---|
.0 | 1 | The EtherCAT slave is an empty MX slot. There is no MX module inserted in the corresponding slot on the MX rail. |
Requirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT v3.1.4026.26 | PC or CX (x86, x64, Arm®) | Tc2_EtherCAT >= 3.8.1.0 |