LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time Control

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!

0 Kudos
Message 1 of 3
(3,166 Views)

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.

0 Kudos
Message 2 of 3
(3,163 Views)

The solution provided here gives you the elasped time as well. Stick to a single thread.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 3
(3,139 Views)