How To Transmit CAN Bus Messages: OBD2 PID Example

OBD2 PID Example Practical Transmit Request CAN Bus

Need to transmit custom CAN bus messages to your CAN bus?

In this article we explain how you can transmit custom CAN frames using one of our CAN bus data loggers. To illustrate the logic, we use the CANedge as an OBD2 data logger to make OBD2 PID requests.

Transmit CAN data

By default, most CAN loggers and CAN interfaces simply "listen" to the existing CAN network traffic.

However, in some cases a "silent-mode" CAN analyzer is not enough and some CAN frames are only broadcast 'on request' - e.g. within the OBD2 protocol and some J1939 PGNs.

OBD2 PID data logger

Here, the CANedge lets you disable 'silent mode' to enable the transmission of custom CAN frames:

  • You can custom CAN frames via the config editor
  • Up to 64 transmit messages can be specified per CAN channel
  • Messages can be set up as either single-shot or periodic
  • You can customize cycle time and delay in ms
  • You can toggle whether to log/ignore request CAN IDs
  • We provide plug & play Configuration Files for OBD2 logging

CANedge OBD2 data logger

The CANedge lets you easily log OBD2 data to an 8-32 GB SD card. Simply specify what OBD2 PIDs you wish to request, then connect it to your car via an OBD2 adapter to start logging. Process the data via free software/APIs and our OBD2 DBC.

obd2 data logger

Example: OBD2 PID dashboard

With the CANedge, you can easily set up free, custom browser dashboards for visualizing your OBD2 data and setting alerts.

Check out the online playground - or learn more in our intro!

playground dashboards intro other software

The OBD2 dashboard playground showcases various OBD2 parameters being requested - and recorded - by a CANedge2 from an Audi. The OBD2 data is recorded to the device SD card (as raw CAN frames), auto-pushed via WiFi to the end user's own server - and auto-processed for visualization in the browser dashboard.

Note that the dashboard also includes data from our GPS-2-CAN module (with accelerometer/gyroscope), illustrating how you can combine CAN and OBD2 data with the CANedge.

Get the 'OBD2 Data Pack'

Want to try working with real OBD2 data?

Download your 'data pack' incl. our OBD2 DBC, 25+ car DBCs and 100+ MB of OBD2 data across 10+ cars!

Learn more

J1939 data pack

How do OBD2 PID requests work?

Below we show how the 'transmit list' may look like for a CANedge OBD2 configuration:

A few comments:

  • Each CAN transmit frame is delayed by 30 ms to avoid overlap in the message queries
  • The frequency is set to 500 ms to avoid excessive requests vs. the data resolution (which is low for OBD2)
  • The "id" field is 7DF, which for OBD2 reflects a "request" message (while e.g. 7E8 reflects a "response" message)
  • The "data" field shows the OBD2 request frame structure, including in particular the HEX PID being requested in the 3rd byte

Example: If you wish to query Engine RPM data in an OBD2 context, you'll need to set the "data" field to 02 01 0C 55 55 55 55 55.

  • Here, the first byte is 02 and corresponds to the number of additional bytes (in this case 2)
  • The second byte is 01 and corresponds to the OBD2 "mode", cf. Wikipedia for details
  • The third byte is 0C, which under Mode 01 reflects the parameter ID of RPM
  • Finally, the remaining bytes of the data field are set to 55 ('dummy loads') and ignored

See also our OBD2 data logger intro for log file examples and a full guide on OBD2 logging.

Ready to log CAN/OBD2 data from your car?

Get your CANedge today!

Recommended for you