0
\$\begingroup\$

I am currently trying to understand the working of the CAN bus. I understand that when we connect a CAN bus logger to the OBD2 port in a car we will be able to view the CAN traffic (raw CAN frames) and in order to get specific information from ECUs, we can send a request with ID 0x7DF and would get a response with IDs between 0x7E8 to 0x7EF.
Is 0x7E8 actually the ID of the responding ECU or is it a general-purpose address just to relay the response back to the sender?
Further, why 0x7DF has been chosen to send a request?
Is there a specific reason?

\$\endgroup\$
3
  • \$\begingroup\$ write 7E8 and 7EF in binary using 11 bits ... it may become clearer \$\endgroup\$
    – jsotola
    Commented Apr 20, 2021 at 23:37
  • 1
    \$\begingroup\$ It sounds like the CAN identifier, so it is the ID of the message. CAN only defines the data link layer, so what that identifier corresponds to is defined by the higher layer protocol. You speak of OBD2 but you have tagged the question CANopen. As far as I know, OBD does not use CANopen but a proprietary protocol that I don't remember the name of right now. So what application layer protocol are you using? If you don't know, you can't make sense of the traffic, period. \$\endgroup\$
    – Lundin
    Commented Apr 21, 2021 at 10:56
  • \$\begingroup\$ I am basically trying to analyze the captured packets from a logger through the OBD port but I do not see the address 7E8 or 7E9 until an explicit request is sent. Are these IDs generally seen during the normal operation of the bus? or are they simply used to return the requested value for diagnostic purposes? \$\endgroup\$ Commented Apr 21, 2021 at 16:21

1 Answer 1

3
\$\begingroup\$

we can send a request with ID 0x7DF and would get a response with IDs between 0x7E8 to 0x7EF.

7DF is actually a broadcast request. You can address specific nodes using 7E0-7E7 messages, where address is 7E0 offset + 0..7 node ID. Then you'll get response only from that one node (if it is present on a bus, of course).

Is 0x7E8 actually the ID of the responding ECU or is it a general-purpose address just to relay the response back to the sender?

7E8 is both, a general purpose message offset and a message address made of this offset + node ID = 0. Consequently, the response messages can be 7E8-7EF.

Note that the above is true only for standard CAN frames. The IDs for extended CAN frames (supported by some OBD2 implementations) are a bit more complex and allow addressing up to 256 nodes.

why 0x7DF has been chosen to send a request?

I have no idea. If I have to guess I'd say it was an arbitrary choice. It seems 0x780 and up is a popular address space for some very specific functions, like LSS messages in CANOpen.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.