CANopenNode / CanOpenSTM32

CANopenNode on STM32 microcontrollers.
Other
281 stars 112 forks source link

Is there an example of a CANopenNode master? #11

Open libangy opened 2 years ago

libangy commented 2 years ago

I want to configure CANopenNode as a master, but I don't know how to start. It would be perfect if there was an CANopenNode master based STM32. Thanks.

HamedJafarzadeh commented 2 years ago

Hi @libangy, can you explain a bit more what you are trying to do ? In CANOpen at any point in time, one node is master, so it depends on what you want to do. Do you wish to read a value from a remote node ? or do you want to write a value to a remote node ?

Lztcdszh commented 1 year ago

I want to know,too

HamedJafarzadeh commented 1 year ago

Have you watched this ? https://www.youtube.com/watch?v=R-r5qIOTjOo

songxiaopeng1 commented 1 year ago

I want to reset or start other slave nodes by frame ID: 0x0000 need to be configured as master?

dirkmb commented 11 months ago

If you just want nodes start in operational mode (so PDOs are working) you can add CO_NMT_ERR_FREE_TO_OPERATIONAL to your NMT_CONTROL flag.

If you want one node to receive the HEARTBEAT message of another node and react on its status it is more complicated. I was not able to archive this without changing the code of CANOpenNode (not CANOpenSTM32). If there is a better way to do it, I would also be interested in an example.