LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limiting array size of waveform graph

Solved!
Go to solution

I am trying to display two graphs to the user in the front panel.  The data is continous waveform data with 5 channels at 10ksps.  Graph 1 displays the entire data decimated to 1 out of every 50 samples, and Graph 2 displays every sample but only for the last X seconds of data (adjustable Seconds to Display control).

 

This code works but it runs out of memory very quickly because in Graph 2 all data is being stored even though only 10 seconds may be displayed.   I've attached an image of a simplified version of the block diagram.

 

I've tried fooling with Replace Array Subset and Rotate 1D Array but just can not get it quite right.  Either the timestamps are off, the timestamp doesn't incremenent, or it the DAQMX read buffer overfills and it crashes.  Does anyone have a suggestion on how to create a finite sized array with something like a FIFO buffer so that will plot Graph 2 correctly?  An example VI or screenshot would be great.

 

Thank you. 

 

waveform graph memory.png

0 Kudos
Message 1 of 3
(3,383 Views)
Solution
Accepted by topic author CNewPP

The easy solution is to use Waveform Subset to get the data you want to display in Graph 2, then only write that to the graph instead of all the data.

 

As a side comment, you may want to max/min decimate the data going to graph 1 instead of simple decimation. It will give you a much more accurate graph.

 

You might find the following post helpful.

the entity formerly known as DFGray
0 Kudos
Message 2 of 3
(3,366 Views)

Be careful with the Waveform Subset.  If you pass that data to the graph while not taking care to ensure that's also the data that is sent to the shift register, you'll still grow without bounds.

 

You want to make sure you're limiting the amount of data sent to the shift register to be built up for the next iteration.

0 Kudos
Message 3 of 3
(3,340 Views)