CANopenNode
CANopen protocol stack
Loading...
Searching...
No Matches
Emergency producer/consumer

Specified in standard CiA 301 More...

+ Collaboration diagram for Emergency producer/consumer:

Macros

#define CO_CONFIG_EM
 Configuration of Emergency.
 
#define CO_CONFIG_EM_ERR_STATUS_BITS_COUNT   (10 * 8)
 Maximum number of Error status bits.
 
#define CO_CONFIG_ERR_CONDITION_GENERIC   (em->errorStatusBits[5] != 0)
 Condition for calculating CANopen Error register, "generic" error bit.
 
#define CO_CONFIG_ERR_CONDITION_CURRENT
 Condition for calculating CANopen Error register, "current" error bit.
 
#define CO_CONFIG_ERR_CONDITION_VOLTAGE
 Condition for calculating CANopen Error register, "voltage" error bit.
 
#define CO_CONFIG_ERR_CONDITION_TEMPERATURE
 Condition for calculating CANopen Error register, "temperature" error bit.
 
#define CO_CONFIG_ERR_CONDITION_COMMUNICATION   (em->errorStatusBits[2] || em->errorStatusBits[3])
 Condition for calculating CANopen Error register, "communication" error bit.
 
#define CO_CONFIG_ERR_CONDITION_DEV_PROFILE
 Condition for calculating CANopen Error register, "device profile" error bit.
 
#define CO_CONFIG_ERR_CONDITION_MANUFACTURER   (em->errorStatusBits[8] || em->errorStatusBits[9])
 Condition for calculating CANopen Error register, "manufacturer" error bit.
 

Detailed Description

Specified in standard CiA 301

Macro Definition Documentation

◆ CO_CONFIG_EM

#define CO_CONFIG_EM
Value:
(CO_CONFIG_EM_PRODUCER | CO_CONFIG_EM_HISTORY | CO_CONFIG_GLOBAL_FLAG_CALLBACK_PRE \
#define CO_CONFIG_GLOBAL_FLAG_CALLBACK_PRE
This flag may be set globally for mainline objects to CO_CONFIG_FLAG_CALLBACK_PRE.
Definition CO_config.h:99
#define CO_CONFIG_GLOBAL_FLAG_TIMERNEXT
This flag may be set globally to CO_CONFIG_FLAG_TIMERNEXT.
Definition CO_config.h:110

Configuration of Emergency.

Possible flags, can be ORed:

  • CO_CONFIG_EM_PRODUCER - Enable emergency producer.
  • CO_CONFIG_EM_PROD_CONFIGURABLE - Emergency producer COB-ID is configurable, OD object 0x1014. If not configurable, then 0x1014 is read-only, COB_ID is set to CO_CAN_ID_EMERGENCY + nodeId and write is not verified.
  • CO_CONFIG_EM_PROD_INHIBIT - Enable inhibit timer on emergency producer, OD object 0x1015.
  • CO_CONFIG_EM_HISTORY - Enable error history, OD object 0x1003, "Pre-defined error field"
  • CO_CONFIG_EM_CONSUMER - Enable simple emergency consumer with callback.
  • CO_CONFIG_EM_STATUS_BITS - Access Error status bits from OD.
  • CO_CONFIG_FLAG_CALLBACK_PRE - Enable custom callback after preprocessing emergency condition by CO_errorReport() or CO_errorReset() call. Callback is configured by CO_EM_initCallbackPre().
  • CO_CONFIG_FLAG_TIMERNEXT - Enable calculation of timerNext_us variable inside CO_EM_process().

◆ CO_CONFIG_EM_ERR_STATUS_BITS_COUNT

#define CO_CONFIG_EM_ERR_STATUS_BITS_COUNT   (10 * 8)

Maximum number of Error status bits.

Stack uses 6*8 = 48 Error status bits, others are free to use by manufacturer. Allowable value range is from 48 to 256 bits in steps of 8. Default is 80.

◆ CO_CONFIG_ERR_CONDITION_GENERIC

#define CO_CONFIG_ERR_CONDITION_GENERIC   (em->errorStatusBits[5] != 0)

Condition for calculating CANopen Error register, "generic" error bit.

Condition must observe suitable Error status bits and use corresponding member of errorStatusBits array from CO_EM_t to calculate the condition. See also CANopen Error register.

Warning
Size of CO_CONFIG_EM_ERR_STATUS_BITS_COUNT must be large enough. (CO_CONFIG_EM_ERR_STATUS_BITS_COUNT/8) must be larger than index of array member in em->errorStatusBits[index].

em->errorStatusBits[5] should be included in the condition, because they are used by the stack.

◆ CO_CONFIG_ERR_CONDITION_CURRENT

#define CO_CONFIG_ERR_CONDITION_CURRENT

Condition for calculating CANopen Error register, "current" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description. Macro is not defined by default, so no error is verified.

◆ CO_CONFIG_ERR_CONDITION_VOLTAGE

#define CO_CONFIG_ERR_CONDITION_VOLTAGE

Condition for calculating CANopen Error register, "voltage" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description. Macro is not defined by default, so no error is verified.

◆ CO_CONFIG_ERR_CONDITION_TEMPERATURE

#define CO_CONFIG_ERR_CONDITION_TEMPERATURE

Condition for calculating CANopen Error register, "temperature" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description. Macro is not defined by default, so no error is verified.

◆ CO_CONFIG_ERR_CONDITION_COMMUNICATION

#define CO_CONFIG_ERR_CONDITION_COMMUNICATION   (em->errorStatusBits[2] || em->errorStatusBits[3])

Condition for calculating CANopen Error register, "communication" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description.

em->errorStatusBits[2] and em->errorStatusBits[3] must be included in the condition, because they are used by the stack.

◆ CO_CONFIG_ERR_CONDITION_DEV_PROFILE

#define CO_CONFIG_ERR_CONDITION_DEV_PROFILE

Condition for calculating CANopen Error register, "device profile" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description. Macro is not defined by default, so no error is verified.

◆ CO_CONFIG_ERR_CONDITION_MANUFACTURER

#define CO_CONFIG_ERR_CONDITION_MANUFACTURER   (em->errorStatusBits[8] || em->errorStatusBits[9])

Condition for calculating CANopen Error register, "manufacturer" error bit.

See CO_CONFIG_ERR_CONDITION_GENERIC for description.

em->errorStatusBits[8] and em->errorStatusBits[8] are pre-defined, but can be changed.