Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes
icl_hardware::canopen_schunk::DS301Node Class Reference

The DS301Node class Is the base class representation of canOpen devices. It is the access point to the most relevant functionalities of the DS301 protocol (canOpen) More...

#include <DS301Node.h>

Inheritance diagram for icl_hardware::canopen_schunk::DS301Node:
Inheritance graph
[legend]

List of all members.

Classes

struct  PDOMapEntry
 Unique index to find a mapped Object dictionary item in a PDO. More...

Public Types

typedef boost::shared_ptr
< const DS301Node
ConstPtr
 Shared pointer to a const DS301Node.
enum  ePDO_TYPE { RECEIVE_PDO, TRANSMIT_PDO }
 Type of a PDO. RECEIVE_PDOs carry data from the host to the device, TRANSMIT_PDOs from the device to the host. More...
typedef boost::shared_ptr
< DS301Node
Ptr
 Shared pointer to a DS301Node.

Public Member Functions

virtual void appendPDOMappingSingle (const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0)
 Appends one or more mapping parameters to the existing mapping. Note that the PDO will be disabled while appending another mapping.
void downloadPDOs ()
 Downloads all Receive-PDOs of this node to the device.
 DS301Node (const uint8_t node_id, const CanDevPtr &can_device, HeartBeatMonitor::Ptr heartbeat_monitor)
uint8_t getNodeId () const
template<typename T >
T getRPDOValue (const std::string &identifier)
template<typename T >
T getTPDOValue (const std::string &identifier)
 Get the value of a PDO which is mapped to a given identifier.
virtual void initNode ()
 Initializes the node.
virtual void initPDOMappingSingle (const PDO::MappingConfigurationList &config, const uint16_t pdo_nr, const PDO::eTransmissionType &transmission_type, const ePDO_TYPE &pdo_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0)
 Init PDO mapping with a given mapping configuration for a given pdo nr.
void printPDOMapping ()
 Will query the PDO mapping from the device and print that to the output.
void registerPDONotifyCallback (const std::string &identifier, const boost::function< void()> &f)
 This function maps a callback to a specific mapped PDO entry. This callback will be called by the PDO upload function, whenever a PDO with the specified data will arrive. Please note, that the callback function will only be notified of new data, but the data must be queried from the PDO separately. A PDO entry can call multiple callbacks, currently callbacks can't be unregistered.
virtual void registerWSBroadcaster (boost::shared_ptr< icl_comm::websocket::WsBroadcaster > broadcaster)
 registerWSBroadcaster Adds a debug interface
template<typename T >
bool setRPDOValue (const std::string &identifier, const T value)
 Set the value of a PDO which is mapped to a given identifier.
template<typename T >
bool setTPDOValue (const std::string &identifier, const T value)
 Set the value of a PDO which is mapped to a given identifier.
virtual void startHeartbeat ()
 Initializes the heartbeat for the node. Throws ProtocolException it heartbeat cannot be initialized.
virtual void stopNode ()
 Puts the node into nmt state preo_operational.
void uploadPDOs ()
 Uploads all Transmit-PDOs of this node from the device.

Public Attributes

EMCY::Ptr m_emcy
 EMCY object to handle spontaneous callbacks with emergency messages.
NMT m_nmt
 Object to handle NMT calls and status.
RPDO::PtrList m_rpdos
 RPDOS of this node (up to 4 in standard config)
SDO m_sdo
 SDO object for specific calls.
TPDO::PtrList m_tpdos
 TPDOS of this node (up to 4 in standard config)

Protected Attributes

CanDevPtr m_can_dev
 Device handle for transmission of messages.
uint16_t m_heartbeat_cycle_time_ms
HeartBeatMonitor::Ptr m_heartbeat_monitor
uint8_t m_node_id
 CANOPEN ID of the node.
boost::unordered_map
< std::string, PDOMapEntry
m_rpdo_mapping
 This map holds a mapping between an identifier string and a mapped position in a RPDO.
boost::unordered_map
< std::string, PDOMapEntry
m_tpdo_mapping
 This map holds a mapping between an identifier string and a mapped position in a TPDO.
boost::shared_ptr
< icl_comm::websocket::WsBroadcaster > 
m_ws_broadcaster
 Interface to send out diagnostics data. Only available if compiled with _IC_BUILDER_ICL_COMM_WEBSOCKET_.

Detailed Description

The DS301Node class Is the base class representation of canOpen devices. It is the access point to the most relevant functionalities of the DS301 protocol (canOpen)

Each Node is a representation of a physical (or in the terms of canOpen also a logical) device. It holds information about the actual devices such as its NMT state, the last EMCY message received from it or management information such as the ID of the device. The DS301 Node implements the basic structure of canOpen nodes but is meant as a base class for derived classes implementing a specific protocol such as the DS402 motor protocol.

Definition at line 67 of file DS301Node.h.


Member Typedef Documentation

Shared pointer to a const DS301Node.

Reimplemented in icl_hardware::canopen_schunk::SchunkPowerBallNode, and icl_hardware::canopen_schunk::DS402Node.

Definition at line 97 of file DS301Node.h.

Shared pointer to a DS301Node.

Reimplemented in icl_hardware::canopen_schunk::SchunkPowerBallNode, and icl_hardware::canopen_schunk::DS402Node.

Definition at line 95 of file DS301Node.h.


Member Enumeration Documentation

Type of a PDO. RECEIVE_PDOs carry data from the host to the device, TRANSMIT_PDOs from the device to the host.

Enumerator:
RECEIVE_PDO 
TRANSMIT_PDO 

Definition at line 88 of file DS301Node.h.


Constructor & Destructor Documentation

icl_hardware::canopen_schunk::DS301Node::DS301Node ( const uint8_t  node_id,
const CanDevPtr can_device,
HeartBeatMonitor::Ptr  heartbeat_monitor 
)

Definition at line 31 of file DS301Node.cpp.


Member Function Documentation

void icl_hardware::canopen_schunk::DS301Node::appendPDOMappingSingle ( const PDO::MappingConfigurationList config,
const uint16_t  pdo_nr,
const PDO::eTransmissionType transmission_type,
const ePDO_TYPE pdo_type,
const bool  dummy_mapping = false,
const uint8_t  cyclic_timeout_cycles = 0 
) [virtual]

Appends one or more mapping parameters to the existing mapping. Note that the PDO will be disabled while appending another mapping.

Parameters:
configList of MappingConfigurations that should be appended.
pdo_nrIndex of the PDO this mapping should be done.
transmission_typeTransmission type of this PDO
pdo_typeIs it a receive PDO or a transmit PDO?
dummy_mappingif set to True, no download to the device will be performed, but the mapping will be done on host side. This is especially useful if a device has preconfigured PDOs which you like to use.
cyclic_timeout_cyclesIn case of transmission type SYNCHRONOUS_CYCLIC this parameter defines the PDO's frequency by defining the number of cycles between two send attempts. For example, a parameter value of 4 means, that the PDO is sent every 5th cycle.

Definition at line 116 of file DS301Node.cpp.

Downloads all Receive-PDOs of this node to the device.

Definition at line 162 of file DS301Node.cpp.

Definition at line 101 of file DS301Node.h.

template<typename T >
T icl_hardware::canopen_schunk::DS301Node::getRPDOValue ( const std::string &  identifier) [inline]

Definition at line 165 of file DS301Node.h.

template<typename T >
T icl_hardware::canopen_schunk::DS301Node::getTPDOValue ( const std::string &  identifier) [inline]

Get the value of a PDO which is mapped to a given identifier.

Parameters:
identifierString identifier for the PDO
Exceptions:
PDOExceptionwhen no PDO is found under the given identifier.
Returns:
value of the PDO entry

Definition at line 190 of file DS301Node.h.

Initializes the node.

Reimplemented in icl_hardware::canopen_schunk::DS402Node, and icl_hardware::canopen_schunk::SchunkPowerBallNode.

Definition at line 47 of file DS301Node.cpp.

void icl_hardware::canopen_schunk::DS301Node::initPDOMappingSingle ( const PDO::MappingConfigurationList config,
const uint16_t  pdo_nr,
const PDO::eTransmissionType transmission_type,
const ePDO_TYPE pdo_type,
const bool  dummy_mapping = false,
const uint8_t  cyclic_timeout_cycles = 0 
) [virtual]

Init PDO mapping with a given mapping configuration for a given pdo nr.

Parameters:
configList of MappingConfigurations that should be mapped
pdo_nrIndex of the PDO this mapping should be done.
transmission_typeTransmission type of this PDO
pdo_typeIs it a receive PDO or a transmit PDO?
dummy_mappingif set to True, no download to the device will be performed, but the mapping will be done on host side. This is especially useful if a device has preconfigured PDOs which you like to use.
cyclic_timeout_cyclesIf the transmission type SYNCHRONOUS_CYCLIC is used, this parameter defines the PDO's frequency by defining the number of cycles between two send attempts. For example, a parameter value of 4 means, that the PDO is sent every 5th cycle.
Exceptions:
PDOExceptionwhen something goes wrong.

Definition at line 66 of file DS301Node.cpp.

Will query the PDO mapping from the device and print that to the output.

Definition at line 170 of file DS301Node.cpp.

void icl_hardware::canopen_schunk::DS301Node::registerPDONotifyCallback ( const std::string &  identifier,
const boost::function< void()> &  f 
)

This function maps a callback to a specific mapped PDO entry. This callback will be called by the PDO upload function, whenever a PDO with the specified data will arrive. Please note, that the callback function will only be notified of new data, but the data must be queried from the PDO separately. A PDO entry can call multiple callbacks, currently callbacks can't be unregistered.

Throws a PDOException, when no PDO entry with the given identifier can be found.

Parameters:
identifierstring identifier of the mapped PDO entry
fnotification callback function

Definition at line 239 of file DS301Node.cpp.

void icl_hardware::canopen_schunk::DS301Node::registerWSBroadcaster ( boost::shared_ptr< icl_comm::websocket::WsBroadcaster >  broadcaster) [virtual]

registerWSBroadcaster Adds a debug interface

Definition at line 53 of file DS301Node.cpp.

template<typename T >
bool icl_hardware::canopen_schunk::DS301Node::setRPDOValue ( const std::string &  identifier,
const T  value 
) [inline]

Set the value of a PDO which is mapped to a given identifier.

Parameters:
identifierString identifier for the PDO
Exceptions:
PDOExceptionwhen no PDO is found under the given identifier.
Returns:
True on success.

Definition at line 215 of file DS301Node.h.

template<typename T >
bool icl_hardware::canopen_schunk::DS301Node::setTPDOValue ( const std::string &  identifier,
const T  value 
) [inline]

Set the value of a PDO which is mapped to a given identifier.

Note:
The value set here will be overwritten by the next PDO
Parameters:
identifierString identifier for the PDO
Exceptions:
PDOExceptionwhen no PDO is found under the given identifier.
Returns:
True on success.

Definition at line 246 of file DS301Node.h.

Initializes the heartbeat for the node. Throws ProtocolException it heartbeat cannot be initialized.

Definition at line 58 of file DS301Node.cpp.

Puts the node into nmt state preo_operational.

Reimplemented in icl_hardware::canopen_schunk::DS402Node.

Definition at line 260 of file DS301Node.cpp.

Uploads all Transmit-PDOs of this node from the device.

Definition at line 154 of file DS301Node.cpp.


Member Data Documentation

Device handle for transmission of messages.

Definition at line 318 of file DS301Node.h.

EMCY object to handle spontaneous callbacks with emergency messages.

Definition at line 311 of file DS301Node.h.

Definition at line 328 of file DS301Node.h.

Definition at line 326 of file DS301Node.h.

Object to handle NMT calls and status.

Definition at line 303 of file DS301Node.h.

CANOPEN ID of the node.

Definition at line 315 of file DS301Node.h.

boost::unordered_map<std::string, PDOMapEntry> icl_hardware::canopen_schunk::DS301Node::m_rpdo_mapping [protected]

This map holds a mapping between an identifier string and a mapped position in a RPDO.

Definition at line 321 of file DS301Node.h.

RPDOS of this node (up to 4 in standard config)

Definition at line 307 of file DS301Node.h.

SDO object for specific calls.

Definition at line 305 of file DS301Node.h.

boost::unordered_map<std::string, PDOMapEntry> icl_hardware::canopen_schunk::DS301Node::m_tpdo_mapping [protected]

This map holds a mapping between an identifier string and a mapped position in a TPDO.

Definition at line 324 of file DS301Node.h.

TPDOS of this node (up to 4 in standard config)

Definition at line 309 of file DS301Node.h.

boost::shared_ptr<icl_comm::websocket::WsBroadcaster> icl_hardware::canopen_schunk::DS301Node::m_ws_broadcaster [protected]

Interface to send out diagnostics data. Only available if compiled with _IC_BUILDER_ICL_COMM_WEBSOCKET_.

Definition at line 331 of file DS301Node.h.


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


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Thu Jun 6 2019 20:17:24