Search code examples
nodesuniqueidentifieridentifiercan-bus

Is CAN ID the address of the node?


I'm studying CAN and CANOpen protocoll and I'm a bit confused. The BOSCH CAN specification says:

"The IDENTIFIER does not indicate the destination of the message, but describes the meaning of the data"

and its also said that there is no limitation for the number of CAN devices in a network. However its also said that to avoid collsion CAN message IDs have to be unique in a network, which if I am correct limits the number of nodes.

So is CAN ID an address like unique identifier of a CAN node?


Solution

  • Like the Bosch spec says, the CAN identifier tells the nature of the packet and not necessarily anything about who is the sender/receiver. All CAN messages are broadcast to all nodes. On the data link layer, all nodes will do a physical ACK of any received message, regardless if they are interested in the contents or not. Any node can in theory send any message and chose to decode any read message.

    Also we can't have several packets with the same identifier but different data sizes. Nor should the system be designed so that multiple nodes risk sending the same packet at the same time. This is because message arbitration doesn't take the data portion in account, so if the identifier is the same but the data varies, then we get packet collisions.


    As for CANopen, it is an application layer which in many situations uses low level CAN frames as carriers of higher layer protocols. In CANopen, the concept of addressable nodes was added, which isn't a requirement from CAN itself. Typically CAN will send messages as a CAN identifier plus node id. Like for example the PDO protocol: some TPDO1 using the default CAN identifier of 0x180 + node id. So node 1 will as default send 0x181 for TPDO1, node 2 will send 0x182 and so on. These are however just default settings and can often be changed.