ST_EcSlaveState

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;
END_STRUCT
END_TYPE

Name

Type

Description

deviceState

BYTE

EtherCAT state of a slave
(See deviceState)

linkState

BYTE

Link state of an EtherCAT slave
(see linkState)

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

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT