LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I reset a Waveform Chart?

Hi, I'm rather new to LABView.  I have a For Loop, inside of which is something that generates data points.  This "something" (I'm actually doing testing using the random-number generator) is then wired to an array outside the Loop, so that auto-indexing takes place and I end up with an array with N data points when the Loop completes.  I'd like these points to plot real-time on a Waveform Chart, so I've included a Chart inside the Loop, which is wired to the same "something".  (It seems that if the Chart is outside the Loop, plotting is not real-time.)  First time I run the VI, it works.  With N = 100, I get 100 data points plotted on my Chart.  Second time I run it, I get an additional 100 data points, but they start at "Time" 100, not at zero.  How can I reset the Chart so that data starts plotting at Time zero each time I run the VI?  Can I add some sort of Case Structure inside the Loop that only runs for iteration=0 and it acts on the Chart somehow?
 
Many thanks.
0 Kudos
Message 1 of 3
(2,865 Views)
You clear a chart by wiring an empty array to the chart's History property. There's a shipping example called How to Clear charts and Graphs that uses Initialze Array functions outside the loop but you can simply use an empty array constant. If you want to clear inside, then use the First Call? function on the Synchronization palette.
0 Kudos
Message 2 of 3
(2,859 Views)
Got it.  Thanks Dennis.
0 Kudos
Message 3 of 3
(2,846 Views)