SlaveDiagnostics

Displays the diagnostics information of EtherCAT slaves' state. For further details, see KINGSTAR Analysis Console > Diagnostic Tool.

NOTE:  Below APIs are only available in certain states, please refer to the Available State(s) column to see its availability.

Name Type Meaning

Available State(s)

FixedAddress USHORT The fixed address of a slave. Set by the master during startup. Values start at 1001 and follow the link order.

>= Init

Type[64] char The device type of a slave.

>= Init

Name[64] char The name of a slave.

>= Init

DeviceType UINT The device type of a slave.

>= Init

VendorId UINT The vendor ID of a slave.

>= Init

ProductCode UINT The product code of a slave.

>= Init

RevisionNo UINT The revision number of a slave.

>= Init

SerialNo UINT The serial number of a slave.

>= Init

MailboxIn USHORT The size of a slave's input mailbox buffer. 128 - 512 bytes are moderate. The size under 32 bytes is small.

>= Init

MailboxOut USHORT The size of a slave's output mailbox buffer. 128 - 512 bytes are moderate. The size under 32 bytes is small.

>= Init

LinkStatus BYTE

The EtherCAT link of a slave.

The meaning of Link Status bits:

Bit Name Description
0 NoLink No link to the slave.
1 LinkNoComm The slave reports a physical link that has no communication for one or more ports.
2 LinkMiss The slave reports a missing link on one or more ports where a link is expected.
3 LinkAdd The slave reports a link on one or more ports where no link is expected.
4 Port0 Port 0 has one of the previous bits.
5 Port1 Port 1 has one of the previous bits.
6 Port2 Port 2 has one of the previous bits.
7 Port3 Port 3 has one of the previous bits.

>= Init

LinkPreset BYTE

Reports the expected physical link on ports 1, 2, and 3 of a slave. The processing order is port 0→3→1→2. m

Bit Description
0 Port 1 expects a link to an EtherCAT slave (if = 0 and bit.4 = 1, port 1 expects connection to secondary master adapter for redundancy purposes).
1 Port 2 expects a link to an EtherCAT slave (if = 0 and bit.5 = 1, port 2 expects connection to secondary master adapter for redundancy purposes).
2 Port 3 expects a link to an EtherCAT slave (if = 0 and bit.6 = 1, port 3 expects connection to secondary master adapter for redundancy purposes).
3 Reserved.
4 Port 1 expects physical link.
5 Port 2 expects physical link.
6 Port 3 expects physical link.
7 Reserved.

>= Init

Flags BYTE

Provides additional topology information about a slave.

Bit Description
0 The slave is connected to the secondary master adapter for redundancy purposes(0 = no redundancy adapter is connected to the slave; 1 = redundancy adapter is connected to port 1; 2 = redundancy adapter is connected to port 2; 3 = redundancy adapter is connected to port 3).
1
2 The first slave of a hot connect group, which is used for identification (bit. 3 should also be set).
3 The slave belongs to a hot connect group.
4 Reserved.
5 Reserved.
6 Reserved.
7 Reserved.

>= Init

StationAddress USHORT Commonly called Alias address. It can be written by the master and is stored in the slave EEPROM. This value is kept when powering off and can be used to differentiate identical slaves.

>= Init

DlStatus USHORT The EtherCAT loop state of each port.

OP

AlStatus USHORT

The EtherCAT state plus an alarm bit.

Bits 0-3: an EtherCAT state.

Bit 4: alarm.

>= Init

AlControl USHORT Controls the EtherCAT state machine. The master requests the state changes by writing to the AL Control register, and then the slave indicates its state in the AL Status register. From AL Control you can see the EtherCAT state of the slave. For example, 8 means the master requests the Operational state (Op), and the slave reflects its state as Op.

>= Init

AlStatusCode USHORT AL Status Code. It displays the error code that indicates last time the problem the slave ran into. The error code list can be checked at the EtherCAT AL Status codes page.

>= Init

LinkConnStatus BYTE

Reports the actual link status on each port of a slave.

Bit Description
0 Port 0 is open and connected to an EtherCAT slave (if = 0, port 0 is closed due to redundancy ring interruption or because it is connected to the primary master adapter).

1

Port 1 is open and connected to an EtherCAT slave (if = 0, port 1 is closed or connected to the secondary master adapter for redundancy purposes).

2 Port 2 is open and connected to an EtherCAT slave (if = 0, port 2 is closed or connected to the secondary master adapter for redundancy purposes).
3 Port 3 is open and connected to an EtherCAT slave (if = 0, port 3 is closed or connected to the secondary master adapter for redundancy purposes).
4 Port 0 detects a physical link.
5 Port 1 detects a physical link.
6 Port 2 detects a physical link.
7

Port 3 detects a physical link.

NOTE: The processing order is port 0→3→1→2.

>= Init

LinkConnControl BYTE

The value of the register 0x0101 of a slave.

Bit 0 and 1: Loop Control port 0.

Bit 2 and 3: Loop Control port 1.

Bit 4 and 5: Loop Control port 2.

Bit 6 and 7: Loop Control port 3.

 

The values of a loop control of a port:

00: Auto: the port state is determined by the link state. The port is open when there is a link. It is closed when there is no link.

01: Auto Close: the port state is determined by the link state. If there is no link, the port is closed. If a link is created, the port won't be open automatically unless the master makes an explicit request.

10: Open: the port is always open. If there is no link, the outgoing EtherCAT frames are lost.

11: Close: the port is always closed. If there is a link, the incoming EtherCAT frames won't be received.

OP

PortAddress USHORT

The fixed address of the device expected to be connected to each port.

 

PortAddress[0]: The fixed address of the device connected to port 0

PortAddress[1]: The fixed address of the device connected to port 1

PortAddress[2]: The fixed address of the device connected to port 2

PortAddress[3]: The fixed address of the device connected to port 3

>= Init

FrameCrc BYTE

The Ethernet frame error count for each port.

 

FrameCrc[0]: The Ethernet frame error count of port 0

FrameCrc[1]: The Ethernet frame error count of port 1

FrameCrc[2]: The Ethernet frame error count of port 2

FrameCrc[3]: The Ethernet frame error count of port 3

OP

PhyCrc BYTE

The physical layer communication error count for each port.

 

PhyCrc[0]: The physical layer communication error count of port 0

PhyCrc[1]: The physical layer communication error count of port 1

PhyCrc[2]: The physical layer communication error count of port 2

PhyCrc[3]: The physical layer communication error count of port 3

OP

LostLink BYTE

Lost link count for each port. EtherCAT devices increment a Lost Link Counter in case of loss of physical link with neighboring devices.

 

LostLink[0]: The lost link count of port 0

LostLink[1]: The lost link count of port 1

LostLink[2]: The lost link count of port 2

LostLink[3]: The lost link count of port 3

OP

CyclicWc UINT

The number of cycles the datagram which is responsible for processing data exchange of the slave was received back with an invalid working counter.

OP

NotPresent UINT

The number of times the master lost the physical link with the slave.

>= Offline

AbnormalState UINT The number of times the slave leave its state autonomously to a lower state without the master requests.

>= Offline

NOTE:  All the EtherCAT states and their transition order are listed below:

  1. Offline → Init → Pre-Operational (PreOP) → Safe-Operational(SafeOP) → Operational (OP)

  2. Offline → Init → Boot

For more information about all the states, please refer to EthercatState.