30 namespace canopen_schunk {
34 :
PDO(node_id, pdo_nr, can_device)
56 if (byte_offset + it->data.size() > 8)
58 throw PDOException (
"Too much data for one PDO transmission. The PDO mapping contains too much data! Aborting download.");
62 std::copy(it->data.begin(),
63 it->data.begin() + it->data.size(),
64 msg.
data + byte_offset);
65 byte_offset += it->data.size();
68 LOGGING_TRACE (CanOpen,
"Now sending RPDO download can message with id " << msg.
id <<
71 msg.
dlc = byte_offset;
80 const bool dummy_mapping,
81 const uint8_t cyclic_timeout_cycles
92 pdo_communication_parameter,
93 pdo_mapping_parameter,
95 cyclic_timeout_cycles);
102 const bool dummy_mapping,
103 const uint8_t cyclic_timeout_cycles
114 pdo_communication_parameter,
115 pdo_mapping_parameter,
117 cyclic_timeout_cycles);
bool download()
Downloads RPDO data from the master to the slave (From PC to node)
static const uint16_t ID_RPDO1_MIN
MappingList m_mapping_list
List of all mappings inside this PDO.
std::vector< MappingConfiguration > MappingConfigurationList
The MappingConfigurationList holds multiple Mapping configurations. The Mapping of a single PDO is de...
std::string hexArrayToString(const unsigned char *msg, const uint8_t length)
Transforms an array of unsigned chars into a string of Hex representations of those chars...
CanDevPtr m_can_device
Can Device handle.
PDO related exceptions go here.
uint8_t m_node_id
CANOPEN ID of the node this PDO belongs to.
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-operationa...
eTransmissionType
Transmission types of a PDO, needed when mapping PDOs.
uint8_t m_pdo_nr
The PDO number inside the logical device. Theoretically this can be in 0 to 511.
static const uint16_t OD_RPDO_COMMUNICATION_MIN
ThreadStream & endl(ThreadStream &stream)
static const uint16_t OD_RPDO_MAPPING_PARAMETER_MIN
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-operationa...
std::vector< PDOStringMatch > PDOStringMatchVec
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 wh...
The PDO class provides access to one (of the possible multiple) Process Data Object of a canOpen node...
The SDO class represents Service Data Objects (SDO) that are used for slow access of the canOpen obje...
RPDO(const uint8_t node_id, const uint8_t pdo_nr, const CanDevPtr &can_device)
Construct a new RPDO.
#define LOGGING_TRACE(streamname, arg)
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 wh...