An-278 EtherCAT Error Codes
An-278 EtherCAT Error Codes
1. Scope
This document considers the different errors and warnings which ma occur when the !C"#" is used
with the P$7# and %therCAT ser&odri&es or I'() (n* the *ow+*e&e* command *ine and BASIC ,rogram
access to error management is discussed) Therefore some ,rior -now*edge of Trio BASIC. the !C"#"
command *ine and Can(,en+o&er+%therCAT is assumed of the reader)
In the future. the information here ma /e used / Trio !otion Techno*og as the /asis for a high
*e&e* user interface in !otion Perfect & 0)
2. Error types
%rrors and warnings can come from a &ariet of sources) 1ow the are hand*ed wi** de,end on the
source and the channe* o&er which the error arri&es)
!C"#" configuration errors)
%therCAT s*a&e contro**er errors)
%therCAT State !achine)
Co% Contro* Word and Status Word from Dri&e)
Dri&e %rror re,orted o&er SD( channe*)
3. MC464 configuration errors
There are 2 t,es of error which ma a,,ear in the !C"#" dis,*a)
1) 3ss) 4ss5 is the modu*e s*ot num/er) This means that the P$7# has a connection ,ro/*em to
the !C"#") (r it ma show this error when the %therCAT ca/*e is /ro-en whi*e the %therCAT
is in norma* o,eration)
2) Css) 4ss5 is the modu*e s*ot num/er) This means that the sstem encountered a configuration
error when tring to initia*ise the a6es) 7or e6am,*e. if the %therCAT wants to set u, an a6is
that is a*read a**ocated to another modu*e)
Doc No.: AN-278
Version: 1.0
Date: 25 April 2012
Subject: EtherA! Error co"es # han"lin$ o%
Name: GD Cat SW BASIC Page 2 of 7
4. EtherCAT Slave Controller errors
The %therCAT S*a&e Contro**er 8%SC9 of each remote dri&e can /e interrogated through the command
*ine or from a Trio BASIC ,rogram in the !C"#") 3se the %T1%:CAT command to fetch &a*ues from
the %SC of a remote node)
ETHERCAT($31, slot, slave address, ESC offset, ESC length, vr_index)
7or e6am,*e. to get the %SC state from the dri&e at node address 2 and ,rint it to the termina*;
ETHERCAT($31, 0, 2, $130, 2, -1)
8
>>
<a*ue %therCAT state
1 Initia*
2 Pre+(,erationa*
" Safe+(,erationa*
$ (,erationa*
Table 1 !eaning of ESC state value
To get the %SC error code from the remote dri&e or I( node and ,ut the &a*ue in <:8#2=9;
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
Co"e #escription Current state
$or state change%
&esulting state
'('''' )o error Any Current state
'('''1 *nspecifie" error Any Any + E
'('''2 )o !e!ory Any Any + E
'(''11 ,nvali" re-ueste" state change ,S. ,/. 0/
/1. S1. 01
Current state + E
'(''12 *n2no3n re-ueste" state Any Current state + E
'(''13 1ootstrap not supporte" ,1 , + E
'(''14 )o vali" fir!3are ,0 , + E
'(''14 ,nvali" !ailbo( configuration ,1 , + E
'(''16 ,nvali" !ailbo( configuration ,0 , + E
'(''15 ,nvali" sync !anager configuration 0S. S/ Current state + E
'(''16 )o vali" inputs available /. S. 0S 0 + E
'(''17 )o vali" outputs /. S/ S + E
'(''1A Synchroni8ation error /. S/ S + E
'(''11 Sync !anager 3atch"og /. S S + E
Name: GD Cat SW BASIC Page 0 of 7
'(''1C ,nvali" Sync Manager Types /. S. 0S S + E 0 + E
'(''1# ,nvali" /utput Configuration /. S. 0S S + E 0 + E
'(''1E ,nvali" ,nput Configuration /. S. 0S 0 + E
'(''19 ,nvali" :atch"og Configuration /. S. 0S 0 + E
'(''2' Slave nee"s col" start Any Current state + E
'(''21 Slave nee"s ,),T 1. 0. S. / Current state + E
'(''22 Slave nee"s 0&E/0 S. / S + E. / + E
'(''23 Slave nee"s SA9E/0 / / + E
'(''24 ,nvali" input !apping 0S 0 + E
'(''24 ,nvali" output !apping 0S 0 + E
'(''26 ,nconsistent settings 0S 0 + E
'(''25 9ree;&un not supporte" 0S 0 + E
'(''26 Synchroni8ation not supporte" 0S 0 + E
'(''27 9ree;&un nee"s 3 buffer !o"e 0S 0 + E
'(''2A 1ac2groun" 3atch"og S. / 0 + E
'(''21 )o vali" inputs an" outputs /. S/ S + E
'(''2C 9atal Sync error / S + E
'(''2# )o Sync error S/ S + E
'(''3' ,nvali" #C S<)C= Configuration /. S S + E
'(''31 ,nvali" #C >atch Configuration /. S S + E
'(''32 0>> Error /. S S + E
'(''33 ,nvali" #C ,/ Error /. S S + E
'(''34 ,nvali" #C Ti!eout Error /. S S + E
'(''34 #C invali" Sync Cycle Ti!e 0S 0 + E
'(''36 #C Sync' Cycle Ti!e 0S 0 + E
'(''35 #C Sync1 Cycle Ti!e 0S 0 + E
'(''41 M1?@A/E 1. 0. S. / Current state + E
'(''42 M1?@E/E 1. 0. S. / Current state + E
'(''43 M1?@C/E 1. 0. S. / Current state + E
'(''44 M1?@9/E 1. 0. S. / Current state + E
'(''44 M1?@S/E 1. 0. S. / Current state + E
'(''49 M1?@A/E 1. 0. S. / Current state + E
'(''4' EE0&/M no access Any Any + E
'(''41 EE0&/M error Any Any + E
Name: GD Cat SW BASIC Page " of 7
'(''6' Slave restarte" locally Any ,
/ther co"es
B'(6''' &eserve"
'(6''';'(9999 Aen"or specific
Table 2 ESC Error co"es
4. EtherCAT state !achine
The %therCAT connection has > different states)
1) Base State ? no acti&it. e&erthing uninitia*ised)
2) Initia* State ? Bus communication is /eing esta/*ished and c*oc- ar/itration ta-ing ,*ace)
0) Pre+(,erationa* + Bus is acti&e and ,arameterisation can occur &ia SD()
") Safe+(,erationa* ? !aster a** s*a&es communicate cc*ica**) PD(s are /eing e6changed)
S*a&es cannot ena/*e)
>) (,erationa* ? 7u** cc*ic o,eration) S*a&e de&ices can /e ena/*ed)
The %therCAT state of the master 8!C"#"9 can /e read with %T1%:CAT command function #)
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)
<a*ue %therCAT state
= Initia*
1 Pre+(,erationa*
2 Safe+(,erationa*
0 (,erationa*
Table 3 Aalue returne" by ET=E&CAT 9unc. 6
6. CoE control 3or" an" status 3or"
The ,rotoco* used / the !C"#" is Can(,en o&er %therCAT) 8Co%9 The Co% contro* word is sent
cc*ica** to each s*a&e and the Co% status word is recei&ed from each dri&e cc*ica**) The &a*ues
are a&ai*a/*e to /oth the !otion Perfect termina* and the BASIC ,rograms as A6is Parameters)
DRIVE_CONTROLWORD
DRIVE_STATUS
7or e6am,*e:
BASE(2)
IF (DRIVE_STATUS AND $07) <> $07 THEN
PRINT Drive Axis 2 not enabled
ENDIF
Name: GD Cat SW BASIC Page > 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 @ reser&ed
oms @ o,eration mode s,ecific
h @ ha*t
fr @ fau*t reset
hos @ homing o,eration start
eo @ ena/*e o,eration
As @ Auic- sto,
e& @ ena/*e &o*tage
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+s,ecific
ha @ homing attained
oms @ o,eration mode s,ecific
i*a @ interna* *imit acti&e
tr @ target reached
rm @ remote
w @ warning
sod @switch on disa/*ed
As @ Auic- sto,
&e @ &o*tage ena/*ed
f @ fau*t
oe @ o,eration ena/*ed
so @ switched on
rtso @ read to switch on
Note: Exact functions depend upon the slave drive. See also the CiA DS402 specification.
5. #rive Error reporte" over S#/ channel
The commands C(B:%AD and C(B:%ADBACIS can /e used to o/tain the &a*ues from Co% o/Dects in the
dri&e) There ma /e &arious o/Dects. inc*uding manufacturer s,ecific o/Dects. which are there to
gi&e information a/out the error status of the dri&e)
The standard DS"=2 o/Dect for error status is =6#=07 su/ inde6 ==) This is a 1# /it unsigned &a*ue
which ma /e read in a BASIC ,rogram or from the !otion Perfect command *ine termina*)
%6am,*es:
1) Get the &a*ue of =6#=07 in a ,rogram and ,rint it in 1e6adecima*)
CO_READ_AXIS(2, $603F, $00, 6, 428)
PRINT #5,HEX(VR(428))
2) Print the &a*ue of =6#=07 to the !otion Perfect command *ine)
CO_READ_AXIS(4, $603F, $00, 6, -1)
Name: GD Cat SW BASIC Page # of 7
12592
>>
The actua* error codes su,,orted / a dri&e wi** de,end on the dri&e manufacturer) The ta/*e /e*ow
shows some of the t,ica* error codes which ma /e returned / a dri&e) See the dri&eEs hand/oo-
for a fu** *ist)
%rror Code
81e69
!eaning
==== No %rror
1=== Generic %rror
2=== Current
22== Interna* current
200= %arth *ea-age
011= !ains o&er&o*tage
021= DC Bus o&er&o*tage
022= DC Bus under&o*tage
"21= 1igh motor tem,erature
"01= 1igh dri&e tem,erature
F=== %6terna* error
6. E(a!ple progra!
This e6am,*e reads some of the errors and re,orts them to the !otion Perfect termina* at channe*
G>)
' 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 7 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 detai*s of the o,eration of this ,rogram reAuires the use of firmware <2)=1$# or *ater)