04-14-2012 06:11 PM
Hello,
I have this elapsed time VI.
I want to add a boolean button to control the loop start and stop.
How do I do that?
Thanks!
04-14-2012 06:24 PM
You already have a control to stop the loop, and you start the program by pressing the run button. Still, that's not the right way to do all this.
A properly designed program should be running as long as it is useful to have around, so I assume you want a control to start, stop, reset, etc the elapsed time by the user. you don't need to stop the loop for that, you just need tho change the state of your code.
Add a case structure for the vvarious states and keep/update the start time in a shift register. Do a forum search, there are many examples.
Also you should place a small wait inside the loop. You don't really need to read the time and update the indicator billions of times per second, cosuming 100% of a CPU core while doing so.
04-15-2012 03:47 AM
The solution provided here gives you the elasped time as well. Stick to a single thread.