ST_EcSlaveState
The structure ST_EcSlaveState contains the EtherCAT status and the Link status of an EtherCAT slave device.
TYPE ST_EcSlaveState:
STRUCT
deviceState :BYTE;
linkState :BYTE;
END_STRUCT
END_TYPE
deviceState: EtherCAT status 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 |
Additionally following bits can be set:
Konstante | Value | Description |
---|---|---|
EC_DEVICE_STATE_ERROR | 0x10 | Statemachine error in the EtherCAT slave |
EC_DEVICE_STATE_INVALID_VPRS | 0x20 | Invalid VendorId, Product Code, RevisionsNo or SerialNo |
EC_DEVICE_STATE_INITCMD_ERROR | 0x40 | Error occured while sending initialization commands. |
linkState: Link status of an EtherCAT slave. The Link status can consist of an ORing of the following bits.
Konstante | Value | Description |
---|---|---|
EC_LINK_STATE_OK | 0x00 | Link status ok |
EC_LINK_STATE_NOT_PRESENT | 0x01 | No communication with the EtherCAT-Slave |
EC_LINK_STATE_LINK_WITHOUT_COMM | 0x02 | Error at port X(defined by EC_LINK_STATE_PORT_A/B/C/D). The port has a link, but no communication is possible. |
EC_LINK_STATE_MISSING_LINK | 0x04 | Missing link at port X(defined by EC_LINK_STATE_PORT_A/B/C/D). |
EC_LINK_STATE_ADDITIONAL_LINK | 0x08 | Additional link at port X(defined by 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 |
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10.0 or higher | PC or CX (x86) | TcEtherCAT.lib |
TwinCAT v2.10.0 Build >= 1301 or higher | CX (ARM) |