This keyword allows a variable of type STRU_COERRMSG (STRUCT_P) to be defined.
This variable is used by the co_rerr() instruction for handling CanOpen messages.
It consists of the following information:
|
|
|
errCode
|
U16
|
Emergency error code ()
|
errReg
|
U8
|
Error register
|
mse[5]
|
U8
|
Manufacturer specific error field byte 1, 2, 3, 4, 5
|
The following are the CiA Draft Standard specifications:
Emergency object data
The emergency telegram consists of 8 bytes with the data as shown below:
|
|
0
|
Emergency Error Code (see table below)
|
1
|
2
|
Error register (Object 1001H)
|
3
|
Manufacturer specific Error Field
|
4
|
5
|
6
|
7
|
Emergency Error Codes
|
|
00xx
|
Error Reset or No Error
|
10xx
|
Generic Error
|
20xx
|
Current
|
21xx
|
Current, device input side
|
22xx
|
Current, inside the device
|
23xx
|
Current, device output side
|
30xx
|
Voltage
|
31xx
|
Mains Voltage
|
32xx
|
Voltage inside the device
|
33xx
|
Output Voltage
|
40xx
|
Temperature
|
41xx
|
Ambient Temperature
|
42xx
|
Device Temperature
|
50xx
|
Device Hardware
|
60xx
|
Device Software
|
61xx
|
Internal Sw
|
62xx
|
User Sw
|
63xx
|
Data Set
|
70xx
|
Additional Modules
|
80xx
|
Monitoring
|
81xx
|
Communication
|
8110
|
CAN Overrun (Objects lost)
|
8120
|
CAN in Error Passive Mode
|
8130
|
Life Guard Error or Heartbeat Error
|
8140
|
Recovered from bus off
|
8150
|
Transmit COB-ID collision
|
82xx
|
Protocol Error
|
8210
|
PDO not processed due to length error
|
8220
|
PDO length exceeded
|
90xx
|
External Error
|
F0xx
|
Additional Functions
|
FFxx
|
Device specific
|
Structure of the Error Register
|
|
|
0
|
M
|
Generic Error
|
1
|
O
|
Current
|
2
|
O
|
Voltage
|
3
|
O
|
Temperature
|
4
|
O
|
Communication Error (overrun, error state)
|
5
|
O
|
Device profile specific
|
6
|
O
|
Reserved (always 0)
|
7
|
O
|
Manufacturer specific
|
|
Example definition:
STRU_COERRMSG analysisCan
|
Example of use:
STRUCT_P MY_STRUCT
U16 code_emg
U8 reg_error
U8 error_spec[5]
END_STRUCT
I32 returns
can_wks = 1
if (can_err.code_emg = 0x1000)
sr(1) = "GENERIC ERROR"
endif
|
|