How to Periodically Updating Labview chart when collecting multi channel data at a high rate

Azim J picture Azim J · Dec 6, 2008 · Viewed 11.4k times · Source

Looking for some help with a Labview data collection program. If I could collect 2ms of data at 8kHz (gives 16 data points) per channel (I am collecting data on 4 analog channels with an National Instruments data acquisition board). The DAQ-MX collection task gives a 1D array of 4 waveforms.

If I don't display the data I can do all my computation time is about 2ms and it is OK if the processing loop lags a little behind the collection loop. Updating the chart in Labview's front panel introduces an unacceptable delay. We don't need to update the display very quickly probably at 5-10Hz would be sufficient. But I don't know how to set this up.

My current Labview VI has three parallel loops

  1. A timed-loop for data collection
  2. A loop for analysis and processing
  3. A low priority loop for caching data to disk as a TDMS file

Data is passed from the collection loop to the other loops using a queue. Labview examples gave me some ideas but I am stuck.

Any suggestions, references, ideas would be appreciated.

Thanks

Azim

Follow Up Question

eaolson suggests that I re-sample the data for display purposes. The data coming from the DAQ-MX read is a one dimensional array of waveforms. So I would need to somehow build or concatenate the waveform data for each channel. And then re-sample the data before updating the front panel chart. I suppose the best approach would be to queue the data and in a display loop dequeue the stack build and re-sample the data based on screen resolution and then update the chart. Would there be any other approach. I will look on (NI Labview Forum)[http://forums.ni.com/ni/board?board.id=170] for more information as suggetsted by eaolson.

Updates

  1. changed acceptable update rate for graphs to 5-10Hz (thanks Underflow and eaolson)
  2. disk cache loop is a low priority one (thanks eaolson)
  3. Thanks for all the responses.

Answer

Joe Z picture Joe Z · Dec 6, 2008

Your overall architecture description sounds solid, but... getting to 30Hz for any non-trivial graph is going to be challenging. Make sure you really need that rate before trying to make it happen. Optimizing to that level might take some time.

References that should be helpful:

You can defer panel updates. This keeps the front panel from refreshing until you're ready for it to do so, allowing you to buffer data in the background, and only draw it occasionally.

You should know about (a)synchronous display. This option allows some control over display rates.

There is some general advice available about speeding execution.

There is a (somewhat dated) report on execution speed on the LAVA forums. Googling around the LAVA forums is a great idea if you need to optimize your speed.