Good day, I'm new to CANopen and have several issues related to a PDO input/output. I get following messages from the 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
So, for example, how can I form the payload for the sensor to get temperature?
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