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>
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< Mapping > | MappingList |
typedef std::vector < PDOStringMatch > | PDOStringMatchVec |
typedef boost::shared_ptr< PDO > | Ptr |
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. |
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.
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.
typedef std::vector<boost::shared_ptr<PDO> > icl_hardware::canopen_schunk::PDO::PtrList |
Convenience typedef to use PDO lists with shared pointers.
Reimplemented in icl_hardware::canopen_schunk::RPDO, and icl_hardware::canopen_schunk::TPDO.
icl_hardware::canopen_schunk::PDO::PDO | ( | const uint8_t | node_id, |
const uint8_t | pdo_nr, | ||
const CanDevPtr & | can_device | ||
) |
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.
sdo | Handle to the SDO object |
mappings | List of MappingConfigurations that should be mapped into this PDO |
transmission_type | Transmission type of this PDO |
pdo_cob_id | CANOPEN-ID of this pdo |
pdo_communication_parameter | object dictionary entry of this pdo's communication parameter |
pdo_mapping_parameter | object dictionary entry of this pdo's mapping parameter |
dummy_mapping | if 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_cycles | If 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. |
PDOException | when an error occurs or an exception is thrown in an underlying structure like SDO communication. |
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.
sdo | Handle to the SDO object |
mappings | List of MappingConfigurations that should be mapped into this PDO |
transmission_type | Transmission type of this PDO |
pdo_cob_id | CANOPEN-ID of this pdo |
pdo_communication_parameter | object dictionary entry of this pdo's communication parameter |
pdo_mapping_parameter | object dictionary entry of this pdo's mapping parameter |
dummy_mapping | if 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_cycles | If 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. |
PDOException | when an error occurs or an exception is thrown in an underlying structure like SDO communication. |
uint8_t icl_hardware::canopen_schunk::PDO::m_node_id [protected] |
uint8_t icl_hardware::canopen_schunk::PDO::m_pdo_nr [protected] |