LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequentially plotting on top of prev

I am using a waveform chart to plot sampled data in realtime, with the x-axis (t-axis) scaled to a user input domain (representing a voltage sweep). I would like to run a single experiment (sweep) multiple times (same x, new y), and plot the new data on top of the old. I am able to reset the chart, but only by clearing the history.

Is there a way to return to t0 (with same delta t) without clearing old data? If not, what is the best way to buffer the data, since now it is immediately written to spreadsheet file (does that save memory?).

thank you
Nate Merrill - UW Electrical Engineering
0 Kudos
Message 1 of 2
(2,480 Views)

This sounds like you want a storage scope!

This can be done using a waveform chart but you will have to resort to using the history property of the chart to repeatedly re-write your display. Better off using a waveform graph.

Issue with chart.
The chart wants to slapp the new data at teh end of the old. This is fine if you want to watch the graph as the experiment procedes, but not good for adding plots as you go.

A graph will plot all the data you pass to it whenever it is updated. You can take advantage of this feature along with another property of both graphs and charts, that being, NaN's will not plot!

So...
Set up a 2-d array that will hold all of the data from all runs and use it to intilize a shift register big enought hold all of you
r runs with room for all of your samples. It should be inititialized such that is is filled with all NaN's.

Now as your experiment runs it should start at teh first row of the array and start replacing the NaN's with your readings. Present this update array to you graph as the updates come in. The data should plot as you expect.

On the next and susequent runs, incremet your row number and drop the new readings in on top of the NaN's for the next row. Now when the data is presented to the graph the old data should remain pltted as earlier, but now a new plot will be developed.

I am attaching a crude eaxample that demostrates the concepts. Watch the code in execution highlighting to see how it operates. If your tests are short and you do not care to watch the plot of each test devlop, move the graph terminal update outside the for loop.

I hope this help,

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 2
(2,480 Views)