LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read engine rpm (as a waveform) from OBD II port of a passenger car using NI 9820 CAN module and LabVIEW?

I would like to synch CAN signals (in waveform) from the OBD II port of a passenger car with other analog signals, such as microphone signals, acquired using NI cDAQ modules. Hopefully, I can do this without using the Automotive Diagnostic Command Set.

 

My system consists of a NI 9189 cDAQ Chassis, a NI 9862 CAN module and a NI 9231 DSA module.

 

I ran "Synchronize DAQmx Analog Input with C Series CAN.vi" from XNET examples, I got incorrect "0"s for rpm even when the engine is running.

 

When I can the "OBD Engine Monitor.vi" example from the Automotive Diagnostic Command Set, I can get correct engine rpm readings with the same NI system.

 

Thanks.

 

Ian

0 Kudos
Message 1 of 7
(1,876 Views)

The ODB port does not contain raw data like a pulse train from the tachometer that you could look at a waveform of and see the pulses coming faster as RPM increases

 

It is all just data from the control system sent over the CAN bus https://en.wikipedia.org/wiki/On-board_diagnostics

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 2 of 7
(1,869 Views)

Understood, but we should be able to get processed engine speed from ECU at a relatively high rate, say 1000Hz.

 

I can tap into the vehicle CAN network directly to get the engine operating parameters. I just want to get the same info from the OBD2 port, which is a lot easier to access.

 

Thanks for your help.

 

Ian

0 Kudos
Message 3 of 7
(1,851 Views)

I read a bit more, and it appears OBD II is based on Diagnostic-Style Messages, which is different from the CAN messages used by all other in-vehicle system. If this is the case, the time resolution from OBD II cannot be that high and the accuracy of synchronization with acquired analog signals cannot be very accurate either.

 

I hope I am incorrect on this :(.

 

 

http://openxcplatform.com/vehicle-interface/concepts.html

0 Kudos
Message 4 of 7
(1,838 Views)

Hi Tula,

 

we should be able to get processed engine speed from ECU at a relatively high rate, say 1000Hz.

I never had a car, passenger or truck, sending CAN messages at 1000Hz. Best I got is 100Hz…

 

it appears OBD II is based on Diagnostic-Style Messages, which is different from the CAN messages used by all other in-vehicle system.

OBD2 is using such Diagnostic messages, but you still can receive CAN messages on the CAN pins of the OBD2 port. In my experience each passenger car manufacturer uses its own message/signal definition, so you need to ask for that definition first. (With trucks it's a lot more easier to receive CAN messages from ECU…)

 

I can tap into the vehicle CAN network directly to get the engine operating parameters. I just want to get the same info from the OBD2 port, which is a lot easier to access.

(In my experience) the OBD2 port is placed behind a "message filter" (aka gateway). When you can access the ECU CAN directly then you should take that opportunity!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 7
(1,821 Views)

GerdW

 

1. I meant I could "read" the CAN signals at 1000Hz and synch them nicely with other analog signals in the same cDAQ chassis. I agree that the true CAN signal update rates are lower.  

2. I read zeros from the OBD II CAN pins for the signals I am interested (such as engine RPM), but I can read these signals using the Automotive Diagnose Command Set example on exactly the same NI hardware setup. Maybe this is exactly because the OBD II port is placed behind a "message filter", I need to send messages to ask the signals to be put on the CAN network/pins. If this is true, what CAN messages I should send?

3. Yes, when I can access the ECU CAN directly then I will take that opportunity. Then there are other times, OBD II port is the only option.

 

Thanks.

 

Ian

 

 

0 Kudos
Message 6 of 7
(1,796 Views)

Hi Ian

I m stuck in a similar situation, were you able to find a solution to this issue?

 

pls help

 

Thanks

Prashant


@TulaRen wrote:

GerdW

 

1. I meant I could "read" the CAN signals at 1000Hz and synch them nicely with other analog signals in the same cDAQ chassis. I agree that the true CAN signal update rates are lower.  

2. I read zeros from the OBD II CAN pins for the signals I am interested (such as engine RPM), but I can read these signals using the Automotive Diagnose Command Set example on exactly the same NI hardware setup. Maybe this is exactly because the OBD II port is placed behind a "message filter", I need to send messages to ask the signals to be put on the CAN network/pins. If this is true, what CAN messages I should send?

3. Yes, when I can access the ECU CAN directly then I will take that opportunity. Then there are other times, OBD II port is the only option.

 

Thanks.

 

Ian

 

 


 

0 Kudos
Message 7 of 7
(1,733 Views)