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: 

How to read data from a spreadsheet to a waveform chart at an interval to simulate real-time data

Solved!
Go to solution

Hi I have measured data using an OBD device and have downloaded the log files as a .csv which I have attatched below.  I am trying to read the 7th column of data (RPM) and display it on a waveform chart, reading it row by row to simulate real-time driving data. The interval between readings I am trying to achieve is 500 ms as that is the time interval of readings on the spreadsheet. I am trying to terminate both loops when RPM is zero as this will occur when the car is turned off. I have attatched the relevant section of my program below. Any suggestions would be greatly appreciated.

 

Thanks 

Michael

Download All
0 Kudos
Message 1 of 3
(2,680 Views)
Solution
Accepted by topic author mmahon365

There are two errors in your Block Diagram.  First, while you read the entire 2D array in all at once (which is fine), you are doing a clumsy (forgive my language) job of programming doing a Row at a Time.  Once you discard the first row of Headers, you have the perfect substrate for a For Loop, which is made to process elements (rows) of an array, one at a time, using its Indexing tunnel.

 

The second error is forgetting about Data Flow.  The For Loop I mentioned, or the While loop you are using, produces points one at a time, and does it at 2Hz thanks to your 500msec Wait.  You want to give each point to your Chart, but the Chart is outside the loop, which means it doesn't get any points until the loop is done.

 

Here's an Easy Question -- where should you place the Waveform Chart Indicators?  [Hint -- I just said that "outside the loop is wrong"].

 

Bob Schor

0 Kudos
Message 2 of 3
(2,660 Views)

Thanks Bob appreciate the help. I managed to get it sorted. I am new to labVIEW, a bit of a case of speaking before thinking.

0 Kudos
Message 3 of 3
(2,652 Views)