0% found this document useful (0 votes)
71 views7 pages

An-278 EtherCAT Error Codes

This document outlines the handling of EtherCAT error codes when using the MC464 with P876 and EtherCAT servodrives or I/O, focusing on low-level command line and BASIC program access. It details various error types, including configuration errors, EtherCAT slave controller errors, and the EtherCAT state machine, along with examples of error codes and their meanings. Additionally, it provides a sample BASIC program for checking and reporting errors over EtherCAT.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views7 pages

An-278 EtherCAT Error Codes

This document outlines the handling of EtherCAT error codes when using the MC464 with P876 and EtherCAT servodrives or I/O, focusing on low-level command line and BASIC program access. It details various error types, including configuration errors, EtherCAT slave controller errors, and the EtherCAT state machine, along with examples of error codes and their meanings. Additionally, it provides a sample BASIC program for checking and reporting errors over EtherCAT.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Doc No.

: AN-278

Version: 1.0

Date: 25 April 2012

Subject: EtherCAT Error codes – handling of

1. Scope
This document considers the different errors and warnings which may occur when the MC464 is used
with the P876 and EtherCAT servodrives or I/O. Only the low-level command line and BASIC program
access to error management is discussed. Therefore some prior knowledge of Trio BASIC, the MC464
command line and CanOpen-over-EtherCAT is assumed of the reader.
In the future, the information here may be used by Trio Motion Technology as the basis for a high
level user interface in Motion Perfect v 3.

2. Error types
Errors and warnings can come from a variety of sources. How they are handled will depend on the
source and the channel over which the error arrives.
• MC464 configuration errors.
• EtherCAT slave controller errors.
• EtherCAT State Machine.
• CoE Control Word and Status Word from Drive.
• Drive Error reported over SDO channel.

3. MC464 configuration errors


There are 2 types of error which may appear in the MC464 display.
1. Uss. “ss” is the module slot number. This means that the P876 has a connection problem to
the MC464. Or it may show this error when the EtherCAT cable is broken while the EtherCAT
is in normal operation.
2. Css. “ss” is the module slot number. This means that the system encountered a configuration
error when trying to initialise the axes. For example, if the EtherCAT wants to set up an axis
that is already allocated to another module.

Name: GD Cat SW BASIC Page 1 of 7


4. EtherCAT Slave Controller errors
The EtherCAT Slave Controller (ESC) of each remote drive can be interrogated through the command
line or from a Trio BASIC program in the MC464. Use the ETHERCAT command to fetch values from
the ESC of a remote node.
ETHERCAT($31, slot, slave address, ESC offset, ESC length, vr_index)

For example, to get the ESC state from the drive at node address 2 and print it to the terminal;
ETHERCAT($31, 0, 2, $130, 2, -1)
8
>>

Value EtherCAT state

1 Initial
2 Pre-Operational
4 Safe-Operational
8 Operational
Table 1 – meaning of ESC state value

To get the ESC error code from the remote drive or IO node and put the value in VR(620);
ETHERCAT($31, 0, 2, $134, 2, 620)
PRINT HEX(VR(620)) ' V2.0186 and later
' or:
PRINT HEX(VR(621)+VR(622)*256) ' V2.0185 and before

Code Description Current state Resulting state


(or state change)

0x0000 No error Any Current state

0x0001 Unspecified error Any Any + E

0x0002 No memory Any Any + E

0x0011 Invalid requested state change I→S, I→O, P→O Current state + E
O→B, S→B, P→B

0x0012 Unknown requested state Any Current state + E

0x0013 Bootstrap not supported I→B I+E

0x0014 No valid firmware I→P I+E

0x0015 Invalid mailbox configuration I→B I+E

0x0016 Invalid mailbox configuration I→P I+E

0x0017 Invalid sync manager configuration P→S, S→O Current state + E

0x0018 No valid inputs available O, S, P→S P+E

0x0019 No valid outputs O, S→O S+E

0x001A Synchronization error O, S→O S+E

0x001B Sync manager watchdog O, S S+E

Name: GD Cat SW BASIC Page 2 of 7


0x001C Invalid Sync Manager Types O, S, P→S S+EP+E

0x001D Invalid Output Configuration O, S, P→S S+EP+E

0x001E Invalid Input Configuration O, S, P→S P+E

0x001F Invalid Watchdog Configuration O, S, P→S P+E

0x0020 Slave needs cold start Any Current state + E

0x0021 Slave needs INIT B, P, S, O Current state + E

0x0022 Slave needs PREOP S, O S + E, O + E

0x0023 Slave needs SAFEOP O O+E

0x0024 Invalid input mapping P→S P+E

0x0025 Invalid output mapping P→S P+E

0x0026 Inconsistent settings P→S P+E

0x0027 Free-Run not supported P→S P+E

0x0028 Synchronization not supported P→S P+E

0x0029 Free-Run needs 3 buffer mode P→S P+E

0x002A Background watchdog S, O P+E

0x002B No valid inputs and outputs O, S→O S+E

0x002C Fatal Sync error O S+E

0x002D No Sync error S→O S+E

0x0030 Invalid DC SYNCH Configuration O, S S+E

0x0031 Invalid DC Latch Configuration O, S S+E

0x0032 PLL Error O, S S+E

0x0033 Invalid DC IO Error O, S S+E

0x0034 Invalid DC Timeout Error O, S S+E

0x0035 DC invalid Sync Cycle Time P→S P+E

0x0036 DC Sync0 Cycle Time P→S P+E

0x0037 DC Sync1 Cycle Time P→S P+E

0x0041 MBX_AOE B, P, S, O Current state + E

0x0042 MBX_EOE B, P, S, O Current state + E

0x0043 MBX_COE B, P, S, O Current state + E

0x0044 MBX_FOE B, P, S, O Current state + E

0x0045 MBX_SOE B, P, S, O Current state + E

0x004F MBX_VOE B, P, S, O Current state + E

0x0050 EEPROM no access Any Any + E

0x0051 EEPROM error Any Any + E

Name: GD Cat SW BASIC Page 3 of 7


0x0060 Slave restarted locally Any I

Other codes

<0x8000 Reserved

0x8000-0xFFFF Vendor specific

Table 2 – ESC Error codes

5. EtherCAT state machine


The EtherCAT connection has 5 different states.
1. Base State – no activity, everything uninitialised.
2. Initial State – Bus communication is being established and clock arbitration taking place.
3. Pre-Operational - Bus is active and parameterisation can occur via SDO.
4. Safe-Operational – Master all slaves communicate cyclically. PDOs are being exchanged.
Slaves cannot enable.
5. Operational – Fully cyclic operation. Slave devices can be enabled.

The EtherCAT state of the master (MC464) can be read with ETHERCAT command function 6.
ETHERCAT($06, 0, -1) ' print the EtherCAT state to the terminal
3
>>

ETHERCAT($06, 0, 600) ' Put EtherCAT state from slot 0 into VR(600)

Value EtherCAT state

0 Initial
1 Pre-Operational
2 Safe-Operational
3 Operational
Table 3 – Value returned by ETHERCAT Func. 6

6. CoE control word and status word


The protocol used by the MC464 is CanOpen over EtherCAT. (CoE) The CoE control word is sent
cyclically to each slave and the CoE status word is received from each drive cyclically. The values
are available to both the Motion Perfect terminal and the BASIC programs as Axis Parameters.
DRIVE_CONTROLWORD
DRIVE_STATUS

For example:
BASE(2)
IF (DRIVE_STATUS AND $07) <> $07 THEN
PRINT “Drive Axis 2 not enabled”
ENDIF

Name: GD Cat SW BASIC Page 4 of 7


6.1. DRIVE_CONTROLWORD bit functions
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved r oms h fr oms hos eo qs ev so

r = reserved
oms = operation mode specific
h = halt
fr = fault reset
hos = homing operation start
eo = enable operation
qs = quick stop
ev = enable voltage
so = switch on
Note: Exact functions depend upon the slave drive. See also the CiA DS402 specification.

6.2. DRIVE_STATUS bit functions


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ms ha lla tr rm ms w sod qs ve f oe so rtso

ms = manufacturer-specific
ha = homing attained
oms = operation mode specific
ila = internal limit active
tr = target reached
rm = remote
w = warning
sod =switch on disabled
qs = quick stop
ve = voltage enabled
f = fault
oe = operation enabled
so = switched on
rtso = ready to switch on
Note: Exact functions depend upon the slave drive. See also the CiA DS402 specification.

7. Drive Error reported over SDO channel


The commands CO_READ and CO_READ_AXIS can be used to obtain the values from CoE objects in the
drive. There may be various objects, including manufacturer specific objects, which are there to
give information about the error status of the drive.
The standard DS402 object for error status is 0x603F sub index 00. This is a 16 bit unsigned value
which may be read in a BASIC program or from the Motion Perfect command line terminal.
Examples:
1. Get the value of 0x603F in a program and print it in Hexadecimal.
CO_READ_AXIS(2, $603F, $00, 6, 428)
PRINT #5,HEX(VR(428))

2. Print the value of 0x603F to the Motion Perfect command line.


CO_READ_AXIS(4, $603F, $00, 6, -1)

Name: GD Cat SW BASIC Page 5 of 7


12592
>>

The actual error codes supported by a drive will depend on the drive manufacturer. The table below
shows some of the typical error codes which may be returned by a drive. See the drive’s handbook
for a full list.
Error Code Meaning
(Hex)
0000 No Error
1000 Generic Error
2000 Current
2200 Internal current
2330 Earth leakage
3110 Mains overvoltage
3210 DC Bus overvoltage
3220 DC Bus undervoltage
4210 High motor temperature
4310 High drive temperature
9000 External error

8. Example program
This example reads some of the errors and reports them to the Motion Perfect terminal at channel
#5.
' Check and report the errors over EtherCAT
ec_axis=0
ec_node=0
ec_slot=0

PRINT #5,"" ' print a blank line

' 1. Check slot configuration errors


IF (SYSTEM_ERROR AND $010000) <> 0 THEN
PRINT #5,"Unit Lost"
ELSEIF (SYSTEM_ERROR AND $020000) <> 0 THEN
PRINT #5,"Unit Terminator Lost"
ELSEIF (SYSTEM_ERROR AND $040000) <> 0 THEN
PRINT #5,"Unit Station Lost"
ELSEIF (SYSTEM_ERROR AND $080000) <> 0 THEN
PRINT #5,"Invalid Unit error"
ELSEIF (SYSTEM_ERROR AND $100000) <> 0 THEN
PRINT #5,"Unit Station Error"
ELSE
PRINT #5,"no unit errors"
ENDIF

' 2. Check Slave Controller Error


IF ETHERCAT($31, ec_slot, ec_node, $130, 2, 25)=TRUE THEN
IF VR(25)=1 THEN
PRINT #5,"ESC Initial State"

Name: GD Cat SW BASIC Page 6 of 7


ELSEIF VR(25)=2 THEN
PRINT #5,"ESC Pre-Operational State"
ELSEIF VR(25)=4 THEN
PRINT #5,"ESC Safe-Operational State"
ELSEIF VR(25)=8 THEN
PRINT #5,"ESC Operational State"
ENDIF
ELSE
PRINT #5,"ESC read failed"
ENDIF

' Check ESC Error value


IF ETHERCAT($31, ec_slot, ec_node, $134, 2, 25)=TRUE THEN
PRINT #5,"ESC Error code: ";HEX(VR(25))
ELSE
PRINT #5,"ESC read failed"
ENDIF

' 3. Check master state


IF ETHERCAT($06, ec_slot, 25)=TRUE THEN
PRINT #5,"MC464 EtherCAT state = ";VR(25)[0]
ELSE
PRINT "Failed to read Master State"
ENDIF

' 4. Check control and status words


PRINT #5,"Control Word = ";HEX(DRIVE_CONTROLWORD AXIS(ec_axis))
PRINT #5,"Status Word = ";HEX(DRIVE_STATUS AXIS(ec_axis))

' 5. Check slave drive error word


CO_READ_AXIS(ec_axis, $603F, $00, 6, 25)
PRINT #5,"Drive Error Word = ";HEX(VR(25))

Note: Some details of the operation of this program requires the use of firmware V2.0186 or later.

Name: GD Cat SW BASIC Page 7 of 7

You might also like