From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stream Live Data to IoT Platform

Solved!
Go to solution

Hi,how can I obtain real time vehicle information such as Vehicle Speed, RPM... and stream the real time data to IoT Platform. I am using NI USB 8052.

0 Kudos
Message 1 of 8
(2,265 Views)

Hi w,

 

read the CAN messages using your NI8502 and get the signals you are interested in.

Then send them to your favorite IoT platform using any kind of network connection…

 

What have you tried so far?

Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,253 Views)

Hi Gerd, thanks for replying.

 

I am new to Labiew and not sure how to set up the LabView for NI 8052. I downloaded the Add-On, Automative Diagnostic Command Toolkit, and tried out as shown in the photo. Besides, can you tell me how to type the PID (such as for vehicle speed = D) in constant so that it can trasmit to the ECU.

 

w13579_0-1605266505157.png

 

Thanks.

0 Kudos
Message 3 of 8
(2,232 Views)
Solution
Accepted by topic author w13579

Hi w,

 

I'm sorry, but I don't use this toolkit.

I use simple NI9853 in a cRIO to read CAN data from an "engine" CAN bus (sometimes also the Powertrain CAN)…

 

Does that toolkit come with example VIs?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(2,224 Views)

Im using Bus Monitor to read data from OBD using 8052, and save the data into TDMS format. 
I know that we can use Labview to read TDMS file, but can I stream the data from TDMS to IOT platform?

 

 

0 Kudos
Message 5 of 8
(2,193 Views)

So there's a lot of information about CAN.  Let me start by saying that NI ships with all kinds of good development tools and example code.  The 8205 is an XNet device, and comes with the Bus Monitor.  This tool allows you to quickly just listen to the bus and see what the traffic is.  This can be found in MAX, or the start menu entry.

 

To communicate over CAN, even just to listen you need to have some configuration setting matching.  Things like the baud rate need to be right.  This is typically 500k for normal high speed.  Check out part 1 of my CAN blog on this.  If you get data on the Bus Monitor it will just look like a stream of data, as explained in Part 3.  What does this data mean?  Well for that you need some kind of database that can interpret the data and give you signals in engineering units which is talked about in Part 4.  All of this is still just data that is sent out periodically by the ECU.  You only get data that it wants to share, and you can usually only interpret it if you have a .DBC file.

 

What about other data the ECU isn't sending?  Well there is several protocols written on top of normal CAN that can issue requests for more data, and get a reply of that data.  This is what the ECU Measurement and Calibration toolkit, and the Automotive Diagnostics Command Set toolkit can do for you.  But since this is built off of normal CAN stuff, get that working first.  I mention the ISO 15765 spec in Part 8.

 

Examples for XNet, ECU M&C, and ADCS all are included in LabVIEW once that toolkit is installed.  Launch LabVIEW and go to Help >> Find Examples and you should find all kinds of stuff from using XNet, to using these toolkits.  I'd start there and try to understand it first.

 

As for logging, there is already a log function built into the Bus Monitor for logging raw frames to TDMS or CSV, and there is an example in the Example Finder for logging to TDMS in LabVIEW.  Again this is just the raw frames and interpreting what they mean typically requires a .DBC.  The term IOT platform is quite generic, can you be more specific on what you want to do and with what?  LabVIEW can log raw data to a TDMS.  You could then send that file to some other device if that is what you are trying to do.

 

How do you know if you need the other toolkits for getting data that isn't being sent out?  Well you won't know without more intimate knowledge of the ECU.  Knowing how to read raw frames is easy, reading signals means you need more information, reading diagnostics means you need even more information.  If you didn't develop the ECU, or if you don't have access to information by the company that did, it will likely be difficult or impossible to get this information.  There are ways of just guessing settings and seeing if they work, but some ECUs have lockout functionality that will stop you from brute forcing your way in.

0 Kudos
Message 6 of 8
(2,175 Views)

Hi Hooovahh, thanks for replying.

 

The project that I am trying to do is the vehicle speed monitoring system. I have to obtain the vehicle speed and send the data into the IoT platform. Then, the IoT platform will do the analysis, if the speed is exceeding the pre-set value, then a notification will be sent to the user.

 

I am new to LabView and never use it before, so I am not sure how can I start with it. I have installed the Automotive Diagnostic Command Set Toolkit in my LabView, and searched for examples, but unfortunately I did not found any. Would you share some idea on how to obtain the vehicle speed by using 8052 and Labview? Thanks for your help!


 

 

0 Kudos
Message 7 of 8
(2,168 Views)

I don't think the ADCS toolkit is needed.  Speed is a pretty important piece of data and I'm guessing your ECU is continually sending it out as normal frames periodically.  You'd just need a DBC to interpret the data.  Or if you are lucky you can look at the data as you change your vehicle speed, and then see what data changes and figure out how to interpret the data.  Now speed is probably not in whole values but probably to one decimal point, and has a custom scaling.  Trying to figure out what frames, and what bytes in that frame is speed might be difficult without the DBC but not impossible.

 

As for LabVIEW training, there's tons online.  The Getting Started section of the LabVIEW wiki is pretty useful, or the Training section.  I mean LabVIEW is a pretty large topic, CAN is a pretty large topic, data collection is a large topic, sending data to an "IOT" system (again ambiguous) can be large topic.  I'd expect this kind of thing to be a senior design project taking all year.  

0 Kudos
Message 8 of 8
(2,165 Views)