Public Types |
typedef boost::shared_ptr
< const EMCY > | ConstPtr |
enum | eEMCY_STATUS { EMCY_STATE_ERROR_FREE,
EMCY_STATE_ERROR_OCCURED
} |
| DS301 requests state error_free and error_occurred. This could be mapped into a bool, but maybe some other implementation needs more states, so we use an enum. More...
|
typedef boost::shared_ptr< EMCY > | Ptr |
Public Member Functions |
void | clearErrorHistory (SDO &sdo) |
| Clear the error register 0x1003.
|
| EMCY (const uint8_t node_id) |
| EMCY Constructs a new EMCY object. The error map will be filled separately.
|
eEMCY_STATUS | getEmcyStatus () const |
| Returns the state of the EMCY state machine.
|
bool | getErrorInformation (uint16_t &eec, uint8_t &error_register, std::vector< uint8_t > &msef) |
| Returns the full error information.
|
void | printError (SDO &sdo, const uint8_t error_nr=1) |
| Prints a specific error from the error register 0x1003.
|
void | printLastErrors (SDO &sdo) |
| Print all errors present in error register 0x1003.
|
virtual void | update (const CanMsg &msg) |
| update Updates the EMCY object with a received EMCY Message
|
Static Public Member Functions |
static void | addEmergencyErrorMap (const std::string &filename, const std::string &block_identifier) |
| Adds new information from an ini file to the emergency error map.
|
static void | addErrorRegisterMap (const std::string &filename, const std::string &block_identifier) |
| Adds new information from an ini file to the error_register map.
|
Static Public Attributes |
static const uint16_t | EMCY_ERROR_RESET_NO_ERROR = 0x0000 |
Protected Member Functions |
virtual std::string | lookupMSEFString () const |
Static Private Member Functions |
static std::string | lookupEECString (const uint16_t error_code) |
static std::string | lookupErrorRegisterString (const uint8_t error_code) |
Private Attributes |
boost::mutex | m_data_buffer_mutex |
uint16_t | m_eec |
| emergency_error_code;
|
uint8_t | m_error_register |
| register in which the error occured
|
eEMCY_STATUS | m_error_state |
std::vector< uint8_t > | m_msef |
| manufacturer-specific error code
|
uint8_t | m_node_id |
Static Private Attributes |
static std::map< uint16_t,
std::string > | m_eec_map |
static std::map< uint8_t,
std::string > | m_error_register_map |
The EMCY class handles the spontaneously occurring Emergency (EMCY) messages, keeps track of a nodes EMCY state and offers translation of the error codes to human readable form.
The EMCY class is used by the CanOpenNodes to store and retrieve the Emergency messages associated with a specific node. It handles incoming emcy messages and provides the required calls to reset them. It also stores extensive lookup tables for the error messages. This EMCY class is meant as a base class for generic DS301 errors and can be derived to produce more specific error messages regarding the used profile or specific device.
Definition at line 42 of file EMCY.h.