Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
icl_hardware::canopen_schunk::EMCY Class Reference

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. More...

#include <EMCY.h>

List of all members.

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< EMCYPtr

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_tm_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

Detailed Description

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.


Member Typedef Documentation

typedef boost::shared_ptr<const EMCY> icl_hardware::canopen_schunk::EMCY::ConstPtr

Definition at line 46 of file EMCY.h.

typedef boost::shared_ptr<EMCY> icl_hardware::canopen_schunk::EMCY::Ptr

Definition at line 45 of file EMCY.h.


Member Enumeration Documentation

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.

Enumerator:
EMCY_STATE_ERROR_FREE 
EMCY_STATE_ERROR_OCCURED 

Definition at line 52 of file EMCY.h.


Constructor & Destructor Documentation

EMCY Constructs a new EMCY object. The error map will be filled separately.

Definition at line 38 of file EMCY.cpp.


Member Function Documentation

void icl_hardware::canopen_schunk::EMCY::addEmergencyErrorMap ( const std::string &  filename,
const std::string &  block_identifier 
) [static]

Adds new information from an ini file to the emergency error map.

Parameters:
filenameFilename of the ini file
block_identifierBlock identifier (the one in [] brackets)

Definition at line 213 of file EMCY.cpp.

void icl_hardware::canopen_schunk::EMCY::addErrorRegisterMap ( const std::string &  filename,
const std::string &  block_identifier 
) [static]

Adds new information from an ini file to the error_register map.

Parameters:
filenameFilename of the ini file
block_identifierBlock identifier (the one in [] brackets)

Definition at line 225 of file EMCY.cpp.

Clear the error register 0x1003.

Note:
This will set the EMCY state machine to error_free
Parameters:
sdoHandle to the node's sdo object for communication
Exceptions:
Everyexception that can occur in an SDO download

Definition at line 274 of file EMCY.cpp.

Returns the state of the EMCY state machine.

Definition at line 93 of file EMCY.cpp.

Returns the full error information.

Parameters:
[out]eecEmergency error code
[out]error_registerError register
[out]msefManifacturer specific error code
Returns:
True if this device is in an erroneous state, false otherwise

Definition at line 99 of file EMCY.cpp.

std::string icl_hardware::canopen_schunk::EMCY::lookupEECString ( const uint16_t  error_code) [static, private]

Definition at line 115 of file EMCY.cpp.

std::string icl_hardware::canopen_schunk::EMCY::lookupErrorRegisterString ( const uint8_t  error_code) [static, private]

Definition at line 178 of file EMCY.cpp.

std::string icl_hardware::canopen_schunk::EMCY::lookupMSEFString ( ) const [protected, virtual]

Definition at line 208 of file EMCY.cpp.

void icl_hardware::canopen_schunk::EMCY::printError ( SDO sdo,
const uint8_t  error_nr = 1 
)

Prints a specific error from the error register 0x1003.

Note:
If the error under the given error_nr does not exist this will throw a TransferAbortException.
Parameters:
sdoHandle to the node's sdo object for communication
error_nrSubindex that should be printed
Exceptions:
TransferAbortExceptionif error_nr does not exist
EveryException that can occur during SDO downloads

Definition at line 237 of file EMCY.cpp.

Print all errors present in error register 0x1003.

Parameters:
sdoHandle to the node's sdo object for communication
Exceptions:
Everyexception that can occur in an SDO communication

Definition at line 258 of file EMCY.cpp.

void icl_hardware::canopen_schunk::EMCY::update ( const CanMsg msg) [virtual]

update Updates the EMCY object with a received EMCY Message

Parameters:
msgReceived Can Message that was already determined to be an EMCY message

Definition at line 43 of file EMCY.cpp.


Member Data Documentation

Definition at line 58 of file EMCY.h.

Definition at line 155 of file EMCY.h.

emergency_error_code;

Definition at line 151 of file EMCY.h.

Definition at line 157 of file EMCY.h.

register in which the error occured

Definition at line 148 of file EMCY.h.

Definition at line 158 of file EMCY.h.

Definition at line 153 of file EMCY.h.

manufacturer-specific error code

Definition at line 145 of file EMCY.h.

Definition at line 142 of file EMCY.h.


The documentation for this class was generated from the following files:


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Sun May 22 2016 03:30:57