How to periodically refresh a Labview chart when collecting multi-channel data at high speed

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

If I don't display the data that I can do, all my calculations will be around 2ms, which is okay if the processing cycle is slightly behind the acquisition cycle. Refreshing the chart on the front of Labview introduces unacceptable latency. We don't need to refresh the display very quickly, maybe 5-10 Hz will be enough. But I don't know how to do it.

There are three parallel loops in my current Labview VI

  • Time loop for data collection
  • Cycle for analysis and processing
  • Low priority loop for caching data to disk as a TDMS file

Data is transferred from a collection cycle to other cycles using a queue. The Labview examples gave me some ideas, but I am stuck.

Any suggestions, recommendations, ideas would be appreciated.

thank

Azim

Next question

eaolson suggests repeating data sampling for display. The data coming from the DAQ-MX read is a one-dimensional array of signals. So I need to somehow collect or combine the waveform data for each channel. And then re-fetch the data before refreshing the front panel chart. I guess the best approach would be to queue to the data, and in the display loop, deactivate the stack build and resample the data based on screen resolution, then refresh the chart. Will there be a different approach. I'll be looking at the (NI Labview Forum) [ http://forums.ni.com/ni/board?board.id=170] for more information, as suggested by eaolson.

Update

  • changed the allowed refresh rate for graphs to 5-10 Hz (thanks to Underflow and eaolson)
  • Disk cache loop is low priority (thanks to eaolson)
  • Thanks for all the answers.
+1


source to share


2 answers


Your general description of architecture sounds solid, but ... getting up to 30Hz for any non-trivial graph will be tricky. Make sure you really need this rate before attempting this. It may take some time to optimize this level.

Links that should be helpful:

You can postpone the panel update . This prevents the front panels from updating until you are ready to do so, so you can buffer the data in the background and sometimes only fetch it occasionally.



You should be aware of (a) synchronous display . This option allows you to control the display speed.

There are some general tips for speeding up execution.

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

+5


source


TV updates at about 30 Hz. More than this is faster than the human eye can see. 30Hz should be the maximum refresh rate you should consider for the display, not the starting point. Calculate the refresh rate 5-10 Hz.

LabVIEW charts add the latest data to the historical data stored in them and display all the data at once. At 8 kHz, you get at least 8000 data points per channel per second. This means that the array supporting this schedule must constantly change to store new data. Also, even if your graph is 1000 pixels across, that means you are showing 8 data points per screen pixel. There is usually no reason to output at most one data point per pixel. If you really want fast refresh rates, please include less data. Create an array to store historical data and plot a graph for only each Nth data point where N is selected, so that you are plotting, say, only a few hundred points.

Remember that your cycles can run at different speeds. It might be satisfactory to run a write cycle to the disk at a much lower frequency than the acquisition rate, perhaps every couple of seconds.



Avoid property nodes if you can. They run on a UI thread that is slower than most other executions.

Other than that, it is very difficult to offer a lot of essential advice without seeing the code or more specific features. Consider posting your question in the NI LabVIEW Forums as well . There are many helpful people there.

+2


source







All Articles