This section describes the definition of the Emergency error code table. This table must be in line with the Emergency identifier enumeration (see co_obj_cfg.h
).
Example:
This example defines 4 emergency codes within different error register classes (first entry of each line). The emergency codes itself are based on the standard emergency codes (second entry of each line).
The following descriptions explains the details of the table members:
Error Register Bit | Description |
---|---|
CO_EMCY_REG_GENERAL |
general error (includes all other classes) |
CO_EMCY_REG_CURRENT |
error class: current |
CO_EMCY_REG_VOLTAGE |
error class: voltage |
CO_EMCY_REG_TEMP |
error class: temperature |
CO_EMCY_REG_COM |
error class: communication |
CO_EMCY_REG_PROFILE |
error class: profile specific error |
CO_EMCY_REG_MANUFACTURER |
error class: manufacturer specific |
The EMCY handling and object directory manipulations with these definitions is performed by the CANopen stack without further definitions.
The application is able to register, clear, reset, check and count emergency errors with the provided function API. For details on this API, see Reference Manual [2].
Example:
status = COEmcyGet(&Node.Emcy, APP_EMCY_1);
This example gets the current status of the Emergency error with the given emergency identifier APP_EMCY.1
.