0
\$\begingroup\$

I've been trying to learn about CANOpen protocol and create a slave device accordingly. I understand that PDO mapping can be either static, or fully dynamic (according to CIA-301). My coding skills and hardware doesn't have the strength to hold a fully dynamic structure.

My question is: is it possible to make pre defined data sets and map them as message blocks?

For example, like sets of data below:

package 1 : A,B,C,D

package 2 : E,B,F,G

package 2 : A,X,

etc.

if it's possible what is the correct way to put them in to object dictionary?

\$\endgroup\$
3
  • \$\begingroup\$ Did you write your own stack? \$\endgroup\$
    – po.pe
    Commented Jan 8, 2021 at 9:12
  • \$\begingroup\$ I'm trying to build a slave stack for my own appication. What I really want to know is can I make 6 different packs for 4 PDO's and 1 SDO index to set them accordingly? Example: PDO1 is package 4, PDO 2 is package 6 as default, 1 SDO message to change PDO1 to package 1 from package 4. is that possible? That is what I was trying to learn. \$\endgroup\$
    – e-zeki
    Commented Jan 11, 2021 at 6:09
  • \$\begingroup\$ This sounds like dynamic PDO mapping \$\endgroup\$
    – po.pe
    Commented Jan 11, 2021 at 7:37

2 Answers 2

1
\$\begingroup\$

What you describe is static PDO mapping, which is also in my experience the most common. Every PDO is mapped to a data entry in the object dictionary, no matter if it is static or not. You always have PDO mapping settings and those settings point out where in the OD the PDO should read/store data at.

In case you are following one of the standardized Device Profiles, such as for example DS401 for GPIO devices, then the standard for that Device Profile specifies where your data should be stored in the OD. It will be in the Device Profile area from 0x6000 to 0x9FFF.

If you don't follow any particular Device Profile, then you can place the objects in the manufacturer-specific area from 0x2000 to 0x5FFF.

So it is actually possible to read/write data without PDOs, by doing a SDO access to the above mentioned addresses. But that's less efficient and not how you should do it.

\$\endgroup\$
10
  • \$\begingroup\$ Thanks for the reply. I know how SDO works and I agree its not the correct way. Also I have the DS401. What I really want to know is can I prepare 6 sets of data for 4 pdo messages and choose between them when I want to change the content of pdo messages. not a fully static pdo but a partially dynamic system. data sets are defined and user can choose a set to be send. not a particular data to be send. \$\endgroup\$
    – e-zeki
    Commented Jan 11, 2021 at 5:44
  • \$\begingroup\$ @e-zeki If the types, sizes or PDO lengths change dynamically, then I'd say you must use dynamic mapping. Otherwise, if the contents just changes meaning but the types and sizes stay the same, it should be ok to do with static mapping. However, if the user doesn't want certain data to be sent, that should preferably be handled with PDO communication settings if possible, rather than some custom way. \$\endgroup\$
    – Lundin
    Commented Jan 11, 2021 at 7:33
  • \$\begingroup\$ Thanks for clearification. So basically what I ask is a "custom way" to do it and it's not possible. Dynamic mapping is going to be a lot of work and will consume a good amount of memory which my hardware lacks. I should probably go with static mapping and see if it's sufficient for me. if not I'll probably switch to a bigger memory MCU to implement dynamic mapping. \$\endgroup\$
    – e-zeki
    Commented Jan 11, 2021 at 8:20
  • \$\begingroup\$ @e-zeki Well, it is physically possible of course, but if it remains CANopen compliant is another story. So it is all about how compliant your product needs to be. Do you plan to do CANopen certification for example? \$\endgroup\$
    – Lundin
    Commented Jan 11, 2021 at 8:26
  • \$\begingroup\$ yes main goal is to get a CANopen certification. Thanks for the help. \$\endgroup\$
    – e-zeki
    Commented Jan 11, 2021 at 8:57
0
\$\begingroup\$

I think you have to use SDO messages in your case. If you want to try mapping a parameter for example: voltage , to object dictionary entries then you have to send a SDO write message so this link
Will give you more information on it

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.