astrand - 2012-09-12

When I started working with CoDeSys, I was impressed. However, recently I've tried the CANopen libraries, but so far it has been a disappointment. First of all, it's too "magic", with all those "implicit calls" and "implicit variables". CANopen is not a level 2 protocol, so why does it do level 2 read/writes? Even worse is that most functions are not documented, and in many cases the documentation is wrong. I assume that "CANopen for 3S Runtime Systems, version 1.3" is the latest one? For example, the documentation says that "CanRead(0)" will be called, but the function is actually called "Can_Read". Perhaps a minor issue, but the documentation is full of such things. Also, it mentions a lot of features but does not actually tell you how to use them. For example, it says that there is an explicit service for "Application-triggered transmission of remote telegrams for receive-PDOs", but how does it work?

Instead of real and useful documentation, the document lists many internal variables such as:

bReentry: BOOL; (* Historically, not used.*)
bGefunden : BOOL; (* Historically, not used.*)

Why would I be interested in that? Some tasks, such as "write device specific data to index 1000" is very complicated. The FAQ gives this example:

Index := FindBinary(16#iiiiss00, CanOpenDev[0].wODStart, CanOpenDev[0].wODEnd);
ODEntries[Index].dwContent := xxxxx;

IMHO, if you need to do something like this, it shows that the design has failed... Besides, my CoDeSys does not recognize any "FindBinary" function. Of course, you can browse the available functions through the Library Manager, but the documentation here is mostly non-existent as well.

Right now, I'm leaning towards doing all CANopen communication "by hand". Are there any alternative CANopen libraries out there?