CANopenNode / CanOpenSTM32

CANopenNode on STM32 microcontrollers.
Other
275 stars 110 forks source link

How to avoid adding node ID to TPDO #27

Open mesink opened 1 year ago

mesink commented 1 year ago

I am trying to prototype a system where there is one controller and 4 devices for a total of 5 nodes. I have more than 4 TPDOs and am trying to sort out how to assign all the PDOs to ensure the COB-IDs are unique. I've assigned device ID 1~4 to the 4 devices so adding the node ID to the PDO base address works well here. However, for the controller, I want it to use specific TPDOs to send to each device, and it would be easier it the tool didn't add the node ID to these. Is this possible to achieve using this library?

dirkmb commented 11 months ago

The constant CO_TPDO_DEFAULT_CANID_COUNT (defined in CO_PDO.h) sets the number of TPDOs for which the Node-ID magic happens. (Magic because it not just simple adds the NodeID the CanID is replaced).

So I see 2 solutions for your issue: