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

The PDO class provides access to one (of the possible multiple) Process Data Object of a canOpen node. The class provides structures for transmit and received data and the functions to trigger down- and uploads. More...

#include <PDO.h>

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

List of all members.

Classes

class  Mapping
 Holds the mapping parameter plus the actual data. More...
struct  MappingConfiguration
 Mapping of a PDO. This is basically a description that says where to look in the object dictionary and how many bits to read. More...
struct  PDOStringMatch
 Unique index to find a mapped Object dictionary item in a PDO. More...

Public Types

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
< MappingConfiguration
MappingConfigurationList
 The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is defined by one such configuration list.
typedef std::vector< MappingMappingList
typedef std::vector
< PDOStringMatch
PDOStringMatchVec
typedef boost::shared_ptr< PDOPtr
 Convenience typedef to use PDOs with shared pointers.
typedef std::vector
< boost::shared_ptr< PDO > > 
PtrList
 Convenience typedef to use PDO lists with shared pointers.

Public Member Functions

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.
 PDO (const uint8_t node_id, const uint8_t pdo_nr, const CanDevPtr &can_device)
 Construct a new PDO.
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.

Public Attributes

MappingList m_mapping_list
 List of all mappings inside this PDO.

Protected Attributes

CanDevPtr m_can_device
 Can Device handle.
uint8_t m_node_id
 CANOPEN ID of the node this PDO belongs to.
uint8_t m_pdo_nr
 The PDO number inside the logical device. Theoretically this can be in 0 to 511.

Detailed Description

The PDO class provides access to one (of the possible multiple) Process Data Object of a canOpen node. The class provides structures for transmit and received data and the functions to trigger down- and uploads.

The class implements PDO access by providing data structures for the userdata and interfaces to trigger a down and upload. These functions will be called periodically in order to transmit userdata to the actual devices and vice versa. The Class also offers the functionality to trigger a PDO remap which is done during the setup phase of the devices. A node may hold 1-4 PDOs in the standard case but up to 512 in the extended case.

Definition at line 44 of file PDO.h.


Member Typedef Documentation

The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is defined by one such configuration list.

Definition at line 70 of file PDO.h.

Definition at line 106 of file PDO.h.

Definition at line 119 of file PDO.h.

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

Convenience typedef to use PDOs with shared pointers.

Reimplemented in icl_hardware::canopen_schunk::RPDO, and icl_hardware::canopen_schunk::TPDO.

Definition at line 133 of file PDO.h.

Convenience typedef to use PDO lists with shared pointers.

Reimplemented in icl_hardware::canopen_schunk::RPDO, and icl_hardware::canopen_schunk::TPDO.

Definition at line 135 of file PDO.h.


Member Enumeration Documentation

Transmission types of a PDO, needed when mapping PDOs.

Enumerator:
SYNCHRONOUS_ACYCLIC 
RTR_ONLY_SYNCHRONOUS 
RTR_ONLY_EVENT_DRIVEN 
EVENT_DRIVEN_MANUFACTURER_SPECIFIC 
EVENT_DRIVEN_PROFILE_SPECIFIC 
SYNCHRONOUS_CYCLIC 

Definition at line 122 of file PDO.h.


Constructor & Destructor Documentation

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

Construct a new PDO.

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

Definition at line 36 of file PDO.cpp.


Member Function Documentation

PDO::PDOStringMatchVec icl_hardware::canopen_schunk::PDO::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.

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
pdo_cob_idCANOPEN-ID of this pdo
pdo_communication_parameterobject dictionary entry of this pdo's communication parameter
pdo_mapping_parameterobject dictionary entry of this pdo's mapping parameter
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 an error occurs or an exception is thrown in an underlying structure like SDO communication.
Returns:
PDOStringMatchVec Vector of string to vec_index matchings. If an error occurs, the returned vector will be empty.

Definition at line 229 of file PDO.cpp.

PDO::PDOStringMatchVec icl_hardware::canopen_schunk::PDO::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.

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
pdo_cob_idCANOPEN-ID of this pdo
pdo_communication_parameterobject dictionary entry of this pdo's communication parameter
pdo_mapping_parameterobject dictionary entry of this pdo's mapping parameter
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 an error occurs or an exception is thrown in an underlying structure like SDO communication.
Returns:
PDOStringMatchVec Vector of string to vec_index matchings. If an error occurs, the returned vector will be empty.

Definition at line 45 of file PDO.cpp.


Member Data Documentation

Can Device handle.

Definition at line 226 of file PDO.h.

List of all mappings inside this PDO.

Definition at line 216 of file PDO.h.

CANOPEN ID of the node this PDO belongs to.

Definition at line 220 of file PDO.h.

The PDO number inside the logical device. Theoretically this can be in 0 to 511.

Definition at line 223 of file PDO.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