COEmcyGet
Description
This function returns the current EMCY error status.
Prototype
CPU_INT16S COEmcyGet(CO_EMCY *emcy, CPU_INT08U err);
Parameter | Description |
---|---|
emcy | pointer to the EMCY object |
err | EMCY error identifier in User EMCY table |
Returned Value
=0 the error is not detected
=1 the error was detected before
<0 an error is detected inside of this function
Additional Information
This function can be removed from the CANopen device by disabling the emergency support with the configuration CO_EMCY.N
.
Example
The following example reads the current status of a possible detected emergency event APP_EMCY.2
within the application of the CANopen node AppNode.
CPU_INT16S warning; : warning = COEmcyGet (&(AppNode.Emcy), APP_EMCY_2); if (warning < 0) { /* error handling */ } else { /* warning holds current emergency status */ } :
Note: The emergency identifier APP_EMCY.2
must be defined within the application specific configuration. See CANopen Config Manual for details.