Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
icl_hardware::canopen_schunk::TPDO Class Reference

This class describes Transmit PDOs, meaning PDOs that send data from the device to the host. More...

#include <TPDO.h>

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

Public Types

typedef boost::shared_ptr< TPDOPtr
 Convenience typedef to use PDOs with shared pointers. More...
 
typedef std::vector< boost::shared_ptr< TPDO > > PtrList
 Convenience typedef to use PDO lists with shared pointers. More...
 
- Public Types inherited from icl_hardware::canopen_schunk::PDO
enum  eTransmissionType {
  SYNCHRONOUS_ACYCLIC = 0, RTR_ONLY_SYNCHRONOUS = 252, RTR_ONLY_EVENT_DRIVEN = 253, EVENT_DRIVEN_MANUFACTURER_SPECIFIC = 254,
  EVENT_DRIVEN_PROFILE_SPECIFIC = 255, SYNCHRONOUS_CYCLIC = 1
}
 Transmission types of a PDO, needed when mapping PDOs. More...
 
typedef std::vector< MappingConfigurationMappingConfigurationList
 The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is defined by one such configuration list. More...
 
typedef std::vector< MappingMappingList
 
typedef std::vector< PDOStringMatchPDOStringMatchVec
 
typedef boost::shared_ptr< PDOPtr
 Convenience typedef to use PDOs with shared pointers. More...
 
typedef std::vector< boost::shared_ptr< PDO > > PtrList
 Convenience typedef to use PDO lists with shared pointers. More...
 

Public Member Functions

PDOStringMatchVec appendMapping (SDO &sdo, const MappingConfigurationList &mappings, const eTransmissionType &transmission_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. More...
 
void registerNotifyCallback (const boost::function< void()> &f)
 Register a notification callback function for incoming PDO messages. More...
 
PDOStringMatchVec remap (SDO &sdo, const MappingConfigurationList &mappings, const eTransmissionType &transmission_type, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0)
 Configure a PDO by sending some SDO packages. This can be either done during NMT state pre-operational or during the NMT state Operational. If an empty mapping is given, we leave the mapping as is. More...
 
 TPDO (const uint8_t node_id, const uint8_t pdo_nr, const CanDevPtr &can_device)
 Construct a new TPDO. More...
 
void update (const CanMsg &msg)
 update updates the TPDO data with newly received messages More...
 
void upload ()
 Upload data from the slave to the master (Node to PC) More...
 
- Public Member Functions inherited from icl_hardware::canopen_schunk::PDO
PDOStringMatchVec appendMapping (SDO &sdo, const MappingConfigurationList &mappings, const eTransmissionType &transmission_type, const uint16_t pdo_cob_id, const uint16_t pdo_communication_parameter, const uint16_t pdo_mapping_parameter, 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. More...
 
 PDO (const uint8_t node_id, const uint8_t pdo_nr, const CanDevPtr &can_device)
 Construct a new PDO. More...
 
PDOStringMatchVec remap (SDO &sdo, const MappingConfigurationList &mappings, const eTransmissionType &transmission_type, const uint16_t pdo_cob_id, const uint16_t pdo_communication_parameter, const uint16_t pdo_mapping_parameter, const bool dummy_mapping=false, const uint8_t cyclic_timeout_cycles=0)
 Configure a PDO by sending some SDO packages. This can be either done during NMT state pre-operational or during the NMT state Operational. If an empty mapping is given, we leave the mapping as is. More...
 

Static Public Attributes

static const uint16_t OD_TPDO_COMMUNICATION_MIN = 0x1800
 
static const uint16_t OD_TPDO_MAPPING_PARAMETER_MIN = 0x1A00
 

Private Attributes

std::vector< uint8_tm_data_buffer
 
boost::mutex m_data_buffer_mutex
 
boost::condition_variable m_data_buffer_updated_cond
 
bool m_data_update_received
 
std::vector< boost::function< void()> > m_notify_callbacks
 

Additional Inherited Members

- Public Attributes inherited from icl_hardware::canopen_schunk::PDO
MappingList m_mapping_list
 List of all mappings inside this PDO. More...
 
- Protected Attributes inherited from icl_hardware::canopen_schunk::PDO
CanDevPtr m_can_device
 Can Device handle. More...
 
uint8_t m_node_id
 CANOPEN ID of the node this PDO belongs to. More...
 
uint8_t m_pdo_nr
 The PDO number inside the logical device. Theoretically this can be in 0 to 511. More...
 

Detailed Description

This class describes Transmit PDOs, meaning PDOs that send data from the device to the host.

Definition at line 33 of file TPDO.h.

Member Typedef Documentation

Convenience typedef to use PDOs with shared pointers.

Definition at line 37 of file TPDO.h.

Convenience typedef to use PDO lists with shared pointers.

Definition at line 39 of file TPDO.h.

Constructor & Destructor Documentation

icl_hardware::canopen_schunk::TPDO::TPDO ( const uint8_t  node_id,
const uint8_t  pdo_nr,
const CanDevPtr can_device 
)

Construct a new TPDO.

Parameters
node_idID of the node this TPDO belongs to
pdo_nrnumbering of this TPDO inside the node
can_devicehandle to the CAN device

Definition at line 31 of file TPDO.cpp.

Member Function Documentation

PDO::PDOStringMatchVec icl_hardware::canopen_schunk::TPDO::appendMapping ( SDO sdo,
const MappingConfigurationList mappings,
const eTransmissionType transmission_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.

Note
Do not call this method by hand, but use the wrapper functions in the DS301Node class. Otherwise the node will not know of the new mapping and won't be able to find a PDO by it's identifier string.
Parameters
sdoHandle to the SDO object
mappingsList of MappingConfigurations that should be mapped into this PDO
transmission_typeTransmission type of this 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.
Returns
PDOStringMatchVec Vector of string to vec_index matchings. If an error occurs, the returned vector will be empty.

Definition at line 104 of file TPDO.cpp.

void icl_hardware::canopen_schunk::TPDO::registerNotifyCallback ( const boost::function< void()> &  f)

Register a notification callback function for incoming PDO messages.

Parameters
fNotification function that should be called

Definition at line 125 of file TPDO.cpp.

PDO::PDOStringMatchVec icl_hardware::canopen_schunk::TPDO::remap ( SDO sdo,
const MappingConfigurationList mappings,
const eTransmissionType transmission_type,
const bool  dummy_mapping = false,
const uint8_t  cyclic_timeout_cycles = 0 
)

Configure a PDO by sending some SDO packages. This can be either done during NMT state pre-operational or during the NMT state Operational. If an empty mapping is given, we leave the mapping as is.

Note
Do not call this method by hand, but use the wrapper functions in the DS301Node class. Otherwise the node will not know of the new mapping and won't be able to find a PDO by it's identifier string.
Parameters
sdoHandle to the SDO object
mappingsList of MappingConfigurations that should be mapped into this PDO
transmission_typeTransmission type of this 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.
Returns
PDOStringMatchVec Vector of string to vec_index matchings. If an error occurs, the returned vector will be empty.

Definition at line 84 of file TPDO.cpp.

void icl_hardware::canopen_schunk::TPDO::update ( const CanMsg msg)

update updates the TPDO data with newly received messages

Parameters
msgcan message that was preciously identified as TPDO message for this specific TPDO

Definition at line 37 of file TPDO.cpp.

void icl_hardware::canopen_schunk::TPDO::upload ( )

Upload data from the slave to the master (Node to PC)

Currently this calls the notification callbacks registered to this PDO.

Definition at line 76 of file TPDO.cpp.

Member Data Documentation

std::vector<uint8_t> icl_hardware::canopen_schunk::TPDO::m_data_buffer
private

Definition at line 132 of file TPDO.h.

boost::mutex icl_hardware::canopen_schunk::TPDO::m_data_buffer_mutex
private

Definition at line 129 of file TPDO.h.

boost::condition_variable icl_hardware::canopen_schunk::TPDO::m_data_buffer_updated_cond
private

Definition at line 130 of file TPDO.h.

bool icl_hardware::canopen_schunk::TPDO::m_data_update_received
private

Definition at line 131 of file TPDO.h.

std::vector<boost::function <void()> > icl_hardware::canopen_schunk::TPDO::m_notify_callbacks
private

Definition at line 127 of file TPDO.h.

const uint16_t icl_hardware::canopen_schunk::TPDO::OD_TPDO_COMMUNICATION_MIN = 0x1800
static

Definition at line 41 of file TPDO.h.

const uint16_t icl_hardware::canopen_schunk::TPDO::OD_TPDO_MAPPING_PARAMETER_MIN = 0x1A00
static

Definition at line 42 of file TPDO.h.


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


schunk_canopen_driver
Author(s): Felix Mauch , Georg Heppner
autogenerated on Mon Jun 10 2019 15:07:49