02-20-2014 12:14 PM
My program collects a couple points of data on a button press using a state machine. The data are velocity measurements from multiple points along a track - I've got that part working (in the vi attached it's just random numbers so I can tinker with the code without plugging in the hardware).
Each measurement is appended to an array and added to a graph. Oon each button press the data exits the case structure and goes through a for loop with a shift register. Using this array, I am trying to implement two buttons: clear and save. Pressing clear would empty the array and the graph, while pressing save opens a dialog to save the numbers. It almost works! It saves fine, but to clear I have to press "clear" and then "measure" again.
I think my problem lies in how I'm attempting to reinitialize the main array, but after a lot of searching the forums I'm still stuck. I'm not sure if I'm almost there, or if a for loop is the wrong way to go and I need to get rid it altogether?
Thanks for any help!
Solved! Go to Solution.
02-20-2014 12:37 PM
Fairly close. You forgot that latching booleans need to be in the event case that reads them- A chart works better than a graph and you never provided for a stop event. The User interaction is enough to throttle the loop and the wait is not required.
No LAVA CCT here so a snippette would be unusable but I did attach the modified code (Saved to LabVIEW 2011)
02-20-2014 01:05 PM
Thanks a ton!
02-20-2014 01:26 PM
Actually it's still not quite there, sorry for being hasty. Now when I press save, only the most recent measurement is saved to disk. How can I make it so every data point showing on the waveform chart can be saved?
02-20-2014 01:34 PM
Just get the chart history instead of using a local variable. You do that with a property node. Look in the Clear case, copy that property node, change it to a read and wire it up appropriately.
02-20-2014 02:36 PM
Or simply right-click the Local and Change to Property node