LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Play a large CSV file

I need to play back a large CSV file and I wanted to know how to best do it. The file contains about 25 million samples (sampled at around 1kHz) of data that needs to be read from the file and played back in realtime out of a DAQ module.

 

What is the best way to accomplish this. I've seen some posts where people are complaining that the waveform won't fit in memory. I don't think that the waveform needs to be in memory at once, just the current "page".

 

I know that the OS will handle this paging (like the C fopen and fread functions).

 

What are the best functions to look at for this?

 

Thanks,

 

 

--

Brian Rose
0 Kudos
Message 1 of 2
(2,204 Views)

When you say "realtime", I believe you want it to plot back to the graph at the same rate as it was originally acquired?  Is this going to be on a waveform chart, waveform graph, or an XY graph?

 

You will need to do that in a loop with a wait ms function in it.  Perhaps read 100 samples at a time and have a wait 100 msec function in there.

 

You could read the file a hundred lines at a time.  If you use a waveform graph or XY graph, then you need to build an array that as you add samples, but will need to remove old samples as they effectively disappear off the plot.  You would want to use initialized arrays and shift registers and array manipulation functions to add elements to the end and strip off elements from the beginning.  A waveform chart has a fixed history length and would effectively do this for you.

0 Kudos
Message 2 of 2
(2,198 Views)