1

What I'm looking to do is request all desired PIDs via a .dbc file made in Vector db Editor++.

I understand enough about CAN communication to be able to do this with 1 or 2 PIDs because the DLC allows up to 8 bytes of data per CAN message. I am also familiar with this resource on querying and responses of PID https://en.wikipedia.org/wiki/OBD-II_PIDs#CAN_.2811-bit.29_bus_format

What I'm having trouble understanding is how diagnostic tools are able to query every PID the manufacturer of a particular vehicle decides to make available, so I feel that this is possible. Yet, if I use a request ID of $7DF, I can only use this message ID alone for my querying, this is the reason why I currently can only fit two PIDs (signals) in that CAN message.

SE Student
  • 35
  • 11

2 Answers2

1

How diagnostic tools are able to query every PID the manufacturer of a particular vehicle decides to make available?

You cannot request whatever you want from ECU (at least in a normal way!). Only the OBD relevant PIDs you can request. All the OBD II PIDs and their definitions, scaling and etc. are available within ISO 15031 part 5. It means that all the PIDs are predefined. So any logger would firstly request mode 01 pid 00 to get all the available PIDs for that vehicle and then starts to scan over it.

if I use a request ID of $7DF, I can only use this message ID alone for my querying.

This is wrong cause 0x7DF has nothing to do with DLC and content of the message. It is only the header of message to tell the ECU from whom you have this request. 0x7DF is the OBD requests and even you can directly request different controllers their available data.

Every can message is 8 byte long. First byte is the mode of the request. Second byte tells the ECU the number of incoming bytes and then you have 6 bytes to send. Because of that they say you can request up to 6 PIDs simultaneously. your problem might be receiving multiple data from OBD which might be a bit tricky using Flow Control and First Frame messages. Here you can find some info about how to receive a message when it is longer that 8 bytes.

regards,

Community
  • 1
  • 1
mohsen_og
  • 774
  • 1
  • 9
  • 31
0

If I'm understanding your question correctly, there's sort of 2 parts that apply:

Step 1: You first have to determine which PIDs are supported.

This company called CanEdge provides a DBC file that has support for all the Service 1 "PIDS supported" queries: https://www.csselectronics.com/pages/can-dbc-file-database-intro

https://en.wikipedia.org/wiki/OBD-II_PIDs#Service_01_-_Show_current_data

Use both the regular and extended versions.

With some mangling, I can get output like this (obviously this is specific to my vehicle)

Supported pids
--------------
PID num (hex) | PID num (int) | PID Name
0x01 | 1d | Monitor status since DTCs cleared. (Includes malfunction indicator lamp (MIL), status and number of DTCs, components tests, DTC readiness checks)
0x03 | 3d | Fuel system status
0x04 | 4d | Calculated engine load
0x05 | 5d | Engine coolant temperature
0x06 | 6d | Short term fuel trim—Bank 1
0x07 | 7d | Long term fuel trim—Bank 1
0x0c | 12d | Engine speed
0x0d | 13d | Vehicle speed
0x0e | 14d | Timing advance
0x0f | 15d | Intake air temperature
0x10 | 16d | Mass air flow sensor (MAF) air flow rate
0x11 | 17d | Throttle position
0x13 | 19d | Oxygen sensors present (in 2 banks)
0x15 | 21d | Oxygen Sensor 2 A: Voltage B: Short term fuel trim
0x1c | 28d | OBD standards this vehicle conforms to
0x1f | 31d | Run time since engine start
0x20 | 32d | PIDs supported [$21 - $40]
0x21 | 33d | Distance traveled with malfunction indicator lamp (MIL) on
0x24 | 36d | Oxygen Sensor 1 AB: Air-Fuel Equivalence Ratio (lambda,λ) CD: Voltage
0x2e | 46d | Commanded evaporative purge
0x2f | 47d | Fuel Tank Level Input
0x30 | 48d | Warm-ups since codes cleared
0x31 | 49d | Distance traveled since codes cleared
0x32 | 50d | Evap. System Vapor Pressure
0x33 | 51d | Absolute Barometric Pressure
0x3c | 60d | Catalyst Temperature: Bank 1, Sensor 1
0x40 | 64d | PIDs supported [$41 - $60]
0x41 | 65d | Monitor status this drive cycle
0x42 | 66d | Control module voltage
0x43 | 67d | Absolute load value
0x44 | 68d | Commanded Air-Fuel Equivalence Ratio (lambda,λ)
0x45 | 69d | Relative throttle position
0x46 | 70d | Ambient air temperature
0x47 | 71d | Absolute throttle position B
0x49 | 73d | Accelerator pedal position D
0x4a | 74d | Accelerator pedal position E
0x4c | 76d | Commanded throttle actuator
0x4d | 77d | Time run with MIL on
0x51 | 81d | Fuel Type

Now that you know which PIDs are supported (this is also only for Service 1, so you'll have to do this for Service 5 and Service 9), you can create a DBC file that decodes these signals. The CanEdge DBC file actually already comes with all of the Service 01 PIDs already enabled.


If your question is about trying to send only 1 message and receiving a response that consists of n PID responses, AFAIK, that isn't possible, you can only get one response at a time.

Raleigh L.
  • 599
  • 2
  • 13
  • 18