1

I have a slave device with multiple TPDOs (4) for sending certain sensor data. Each TPDO has about 4 bytes of data and I want to insert a 'count' in the frame to indicate data is not stale. My plan is to create an object entry for this and map it to each PDO as 5th byte. Is this allowed by the CANOpen standard and of so, is this is a good idea at all?

PS: I am not sending all 8 bytes in 1 TPDO because of the 4 bytes of in 1 TPDO have a co-relation to each other.

embedcrazy
  • 11
  • 1

1 Answers1

1

Yes, it is allowed to map a (sub)object to multiple PDOs, or even multiple times to the same PDO. When using dummy mappings in RPDOs, this is actually quite common.

Whether inserting a count is a good idea depends on what you are trying to achieve. What is the problem you are trying to detect and how do you want to handle it?

If you want to check that the slave is alive and healthy, use heartbeats. If you want to check that you didn't miss a PDO, there are other ways. For SYNC-driven PDOs, you can set a flag for each PDO when you receive it and at the SYNC, check if you received them all before clearing the flags. For event-driven PDOs, you can use the event timer in the RPDO to generate an error if a PDO didn't arrive within a certain time.

Inserting a counter will work and help you detect how many PDOs you missed. But the question is, what can you do with that information? The last PDO, even if "stale", is usually still the best guess for the value at the receiving side.

Jos Seldenthuis
  • 381
  • 1
  • 5
  • Thanks for the answer, and appreciate your advice regarding the flag technique. The application is for a safety critical system, where data I send is used to actuate a certain device (cannot go in details due to confidentiality etc.) and the CANOpen master must be able to detect a ‘stale’ data in case my device has. Issues like latched registers. We are just starting to brainstorm, so any idea is welcome. – embedcrazy Aug 19 '20 at 19:07