取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 3 条)
3,466 次查看
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 项奖励
2 条消息(共 3 条)
3,460 次查看
Got it.  Thanks Dennis.
0 项奖励
3 条消息(共 3 条)
3,447 次查看