0

I'm building a library called Easy CANopen and it will focus on embedded systems due to the portability. Language C.

But storing the Node ID in the Object Dictionary can be done, but I don't know if it's according to the standard, or I have free choice to modify according to the standard.

For the moment, I have put the Node ID in Identity Object at index = 0x1018 and sub index 0x5. Is that OK according to the standard?

enter image description here

euraad
  • 1,125
  • 14
  • 37
  • Does Node ID belong to any of objects? Isn't the Node ID to be already decided before any objects become available on the bus? Where did the table come from? – jay Oct 14 '21 at 19:47
  • @jay I made it. https://docs.google.com/document/d/1p4lZc9SoLiIG7LR7jfU8_HhbSBq89xtiP6eytecR5HI/edit?usp=sharing – euraad Oct 14 '21 at 20:19
  • @jay I can sett the address via NMT commands, but what if I want to save the Node ID? – euraad Oct 14 '21 at 20:20
  • @jay I'm building a CANopen library in C. Do you have intressts in CANopen? – euraad Oct 14 '21 at 20:20
  • How do you set the address using NMT? In order to take NMT, a receiving node must be addressed, addressed using a known Node ID. What does your question, "Do you have intressts in CANopen? ", imply? Are you trying to build an open-source library? "Saving a node ID" does not need to be any of CAN object, I guess. – jay Oct 15 '21 at 01:17
  • @jay I have documention on that. I wonder if you have knowledge about CANopen, or want to learn CANopen as well as I do. Yes, I'm trying to build an open source library in pure C because I think CANopenNode is written to badly. It's to heavy. I want a lightweight library that fits small embedded systems as well as large applications on PC. Pure C code. – euraad Oct 15 '21 at 10:22
  • @jay If you want to join https://github.com/DanielMartensson/Easy-CANopen – euraad Oct 15 '21 at 10:25
  • It sounds fun, and I will let you take all that. BTW, why CANopen, while there are many other alternatives, that are considered to be superior than any of CAN. CAN has "some" attributes, though I do not see It technically challenging or rewarding. – jay Oct 15 '21 at 23:48
  • @jay The reason why I choosed CANopen is because most microcontrollers these days have CAN and not RS485. I know that there exist EtherCAT, Ethernet/IP, Profibus, Profinet, IO-link etc. But they are very special and requries special hardware. I was first looking at Modbus, but Modbus seems old and Modbus RTU is only used for legacy applications. Modbus TCP/IP will be replaced soon by EtherCAT or Ethernet/IP. CAN have become better and better and latest CAN is CAN FD = High speed CAN where you can send 64 bytes per message instead of 8 bytes per message. – euraad Oct 16 '21 at 10:49
  • @jay I would only consider to use Modbus if you need somthing easy server/client protocol and CANopen if you need something universial protocol that fits all types of systems. – euraad Oct 16 '21 at 11:17
  • You said what I had to explain, and you are still not understanding why, I did coding upon CAN multiple times decades ago, bottom up. CAN has been in that path. There are propelling reasons trying to appeal as new or renew, like your motivation. However it goes, what is holding CAN does limit CAN as well. From what you explain, probably you need to look into OSI protocols stack vs. historical development of CAN base protocols. – jay Oct 17 '21 at 13:14
  • @jay Do you recommend a pyhsical layer and a protocol that are better than CAN and CANopen? – euraad Oct 17 '21 at 15:20
  • Unless you have reason for standard compliant, many options are open, and any binding physical layer gives some convenience along with limitations. Often I design PHY and write optimized/purpose-built protocols upon specific products. Once you go that distance, you will not want to limit the boundary. – jay Oct 17 '21 at 16:44
  • @jay Ok. I wrote an answer to myself. – euraad Oct 17 '21 at 17:50

2 Answers2

1

Why invent the wheel if one is invented for you already?

It is called Layer Setting Services (LSS), and is designed specifically for setting Node ID and even changing bus bitrate dynamically.

Maple
  • 12,567
  • 2
  • 22
  • 60
  • Because most of the CANopen libraries are not for embedded, or very heavy. – euraad Nov 21 '21 at 22:00
  • I wasn't talking about libraries. I was talking about protocol. You cannot claim you are writing your own "CANOpen library" if you do not follow CANOpen standards. – Maple Nov 22 '21 at 01:31
  • The reason most CANOpen stacks are heavy is that the CANOpen protocol is over bloated. Yet, most of the stacks we evaluated were written specifically for embedded applications and worked there just fine. We ended up writing our own stack couple years ago and it supports about 30% of the protocol. For this reason nowhere in our documentation you can find word "CANOpen", despite the fact that we can work with about 90% devices out there. – Maple Nov 22 '21 at 01:40
  • Also, entry level MCUs usually do not have CAN controller hardware. By the time you find one that does, you usually have enough RAM/Flash/Clock to run even heaviest stack. – Maple Nov 22 '21 at 01:53
0

I place the Node ID in Identity Object (0x1018) at Object Dictionary at sub index 0x5 because can CANopen standard for Identity Object is

  • Sub index 0x0 = Highest sub index
  • Sub index 0x1 = Vendor ID
  • Sub index 0x2 = Product code
  • Sub index 0x3 = Revision number
  • Sub index 0x4 = Serial number

So I think Node ID will fit at sub index 0x5.

euraad
  • 1,125
  • 14
  • 37