CANopen TPDO comands read/write

Viewed 129

Good day, I'm new to CANopen and have several issues related to a PDO input/output. I get following messages from the sensor:

list of messages I get from sensor

As far as I understand these are PDO messages. How can I decode the payload of it? Also, I have a manual for the sensor and it represents the following instructions like

instructions from sensor's manual

So, for example, how can I form the payload for the sensor to get temperature?

2 Answers

Most CANopen messages pick identifier based on node id. It would seem that your node id is 44h (68 dec). If we subtract 44h from your identifiers, we get:

0x180 = TPDO1 (3 bytes)
0x280 = TPDO2 (3 bytes)
0x380 = TPDO3 (6 bytes)
0x480 = TPDO4 (8 bytes) 
0x700 = Heartbeat message

As for what the payload means, you can't tell that from a CAN listener, the device must document this. It is possible that they store multiple data items like the 0x2108 thing in a single package, by utilizing PDO mapping. Check PDO mapping parameters for the above TPDOs, should be found at OD index 1800h + node id. It should list some stuff located in 0x2000 to 0x5FFF, which is the manufacturer-specific area of the Object Dictionary.

You can also check their EDS file, it is a readable text file and should list all default configurations.

To Lundin's answer, the mapping entries for TPDO<n> you find at OD index 1A00h+n so it depends on the TPDO number not the node ID and the base index is 1A00h not 1800h. At 1800h+n, you find the TPDO<n>'s communication parameters that contain the COB-ID (UNSIGNED32 at sub-index 1), triggering mode, SYNC parameters, event timer (tx period) and inhibit time (tx rate limit).

The mapping at OD index 1A00h+n is a list with sub-index 0 containing the number of list items as usual and sub-index 1 and up containing an UNSIGNED32 mapping entry value. This value points to the mapped OD entry as follows:

    <index (16-bit)><sub-index (8-bit)><number of bits (8-bit)>

So if you have a value 20230410h in there it would mean that the TPDO maps the OD entry [2023h,04h] and it is 16 bits wide so it would "occupy" 2 bytes in the TPDO. What is mapped first in the mapping table comes first in the payload of the PDO.

Likewise, the receive PDOs RPDO<n>s are defined similarly with their (fewer) communication parameters at OD entries 1400h+n and their mapping entries at OD entries 1600h+n.

When you talk to a CANopen node, you are receiving the node's TPDOs and send the node's RPDOs so you need to learn the RPDO's mapping so that you know what the node expects. For RPDOs 1-4, the COB-IDs are normally calculated with the node ID as follows:

    RPDO1: 200h+node ID
    RPDO2: 300h+node ID
    RPDO3: 400h+node ID
    RPDO4: 500h+node ID
Related