After reading several CiA specifications, I am still having difficulty understanding PDO mapping, Process Image, and Process Data Exchange in CANopen.
I know SDO is used for configuration settings in the pre-operational state and has protocol overhead (since it can transfer more than 8 bytes of data).
In operational state, PDOs are well suited for inputs and outputs of process data. PDOs can transfer a maximum 8 bytes of data only.
There is the COB-ID of 11 bits which has a function code and a node number. Since the node number uses 7 bits, we can have a maximum of 127 nodes (for CANopen 2.0A network).
But there are four TPDOs` and four RPDOs which is confusing me. Why would you need multiple TPDOs and RPDOs? Also somewhere I read the device profiles may use entries from 6000h to 6FFFh to describe the device parameters and the device functionality and within this range up to 8 different devices can be described. But there can be 127 nodes in network then what's this 8 device?
PDOs are type of messages used for more efficient and asynchronous messages. PDOs can be sent on a timer, in response to a SYNC message or in response to an event (like a digital input changing). All 8 bytes of the CAN bus message payload is available for your data. This is in contrast to an SDO where only 4 bytes are available (there are multi-message SDOs like block transfer).
PDOs can only transfer 8 bytes at a time because that is the maximum transfer size of a CAN bus message. Contrast this to an SDO where a command byte and 3 byte address must be sent, leaving a maximum of 4 bytes of information.
By default a device has 4 RPDOs and 4 TPDOs allocated. 4 is just the default number of PDOs. More can be arranged, but you are responsible for creating the "channels" for them. That is picking an arbitration ID and making sure no other device on the bus is going to talk using that ID. You want multiple PDOs because:
0x180+$NODEID
wins the bus arbitration over 0x280+$NODEID
, etc.TPDOs are messages transmitted from a device while RPDOs are messages that are received and write to a devices object dictionary.
The object dictionary defines the interface of a CANopen device. The dictionary is addressed using a 16-bit index and an 8-bit sub-index. The dictionary is split into ranges. 0x6000 through 0x6FFF is the range of indexes allocated to Device Profile variables. Device profiles provide standardized interfaces for more specialized classes of devices.
PDO mapping is how the information that is contained in a PDO is agreed upon. PDO mappings are entries in a devices object dictionary like any other. The 3 byte index, sub-index and the size of the parameter in bits are encoded in an UNSIGNED32.