This class describes Transmit PDOs, meaning PDOs that send data from the device to the host. More...
#include <TPDO.h>
Public Types | |
typedef boost::shared_ptr< TPDO > | Ptr |
Convenience typedef to use PDOs with shared pointers. | |
typedef std::vector < boost::shared_ptr< TPDO > > | 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 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 | registerNotifyCallback (const boost::function< void()> &f) |
Register a notification callback function for incoming PDO messages. | |
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. | |
TPDO (const uint8_t node_id, const uint8_t pdo_nr, const CanDevPtr &can_device) | |
Construct a new TPDO. | |
void | update (const CanMsg &msg) |
update updates the TPDO data with newly received messages | |
void | upload () |
Upload data from the slave to the master (Node to PC) | |
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_t > | m_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 |
This class describes Transmit PDOs, meaning PDOs that send data from the device to the host.
typedef boost::shared_ptr<TPDO> icl_hardware::canopen_schunk::TPDO::Ptr |
Convenience typedef to use PDOs with shared pointers.
Reimplemented from icl_hardware::canopen_schunk::PDO.
typedef std::vector<boost::shared_ptr<TPDO> > icl_hardware::canopen_schunk::TPDO::PtrList |
Convenience typedef to use PDO lists with shared pointers.
Reimplemented from icl_hardware::canopen_schunk::PDO.
icl_hardware::canopen_schunk::TPDO::TPDO | ( | const uint8_t | node_id, |
const uint8_t | pdo_nr, | ||
const CanDevPtr & | can_device | ||
) |
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.
sdo | Handle to the SDO object |
mappings | List of MappingConfigurations that should be mapped into this PDO |
transmission_type | Transmission type of this PDO |
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. |
void icl_hardware::canopen_schunk::TPDO::registerNotifyCallback | ( | const boost::function< void()> & | f | ) |
Register a notification callback function for incoming PDO messages.
f | Notification function that should be called |
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.
sdo | Handle to the SDO object |
mappings | List of MappingConfigurations that should be mapped into this PDO |
transmission_type | Transmission type of this PDO |
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. |
void icl_hardware::canopen_schunk::TPDO::update | ( | const CanMsg & | msg | ) |
boost::mutex icl_hardware::canopen_schunk::TPDO::m_data_buffer_mutex [private] |
boost::condition_variable icl_hardware::canopen_schunk::TPDO::m_data_buffer_updated_cond [private] |
bool icl_hardware::canopen_schunk::TPDO::m_data_update_received [private] |
std::vector<boost::function <void()> > icl_hardware::canopen_schunk::TPDO::m_notify_callbacks [private] |
const uint16_t icl_hardware::canopen_schunk::TPDO::OD_TPDO_COMMUNICATION_MIN = 0x1800 [static] |
const uint16_t icl_hardware::canopen_schunk::TPDO::OD_TPDO_MAPPING_PARAMETER_MIN = 0x1A00 [static] |