CANopen emergency message implementation

134 Views Asked by At

I need to use emergency messages to send out error messages to the master. The reason I want to use emergency over PDO messages is that I want it to be quick.

I read a book called "Embedded Networking with CAN and CANopen", and it gave me almost a good understanding of CANopen. I am able to do send emergency messages with the help of CO_error() and CO_EM_process(), but I feel like I am missing something and I couldn't find any implementation examples to get a clear idea about the implementation workflow.

I am new to CANopen and the documentation about the libraries are confusing. What can I do? Or is there some source code that I can use as an example?

1

There are 1 best solutions below

0
Chris Keydel On

I am one of the authors of the book you mention, thanks for reading! EMCY objects/messages are meant to signal error conditions on the bus and by default cause a switch from operational (PDO communication) to pre-operational (no PDO communication) mode. The overriding error behavior is configurable in object 1029h "Error behavior object" if it exists.

It is entirely feasible that you transmit EMCY messages for errors but whether the stack you use implements error handling including object 1029h correctly I can't say. If not then yes, when you send an error this way you have to switch yourself to pre-operational if you're currently operational, or you implement 1029h, too, and do whatever this object is configured to.

You can request a copy of the CiA 301 standard where all of this is specified here. For a general overview of all important communication objects in CANopen including EMCY, as well as some other core concepts, see this poster in PDF format here.