LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapsed Time

Solved!
Go to solution

In a do while loop any suggestions on how restart the timer when the user hits the button?  I trued a Case Statement but it only executes it once and the time picks up where it left off.

 

 

0 Kudos
Message 1 of 16
(4,089 Views)

You're going to need a bit more code. You'll need a shift register to keep track of the last start time so you can compare the current time to this time, rather than the original start time. Thus, your tunnel needs to be a shift register. When you reset you pass out the current time to the shift register. Otherwise you pass out the current time.

 

Or, you could just use the Elapsed Time Express VI. It has a reset input.

Message 2 of 16
(4,084 Views)

Thanks..I had saw the express vi in the solution to someone elses question.  I'll give the shift registers a try and let you know.  

0 Kudos
Message 3 of 16
(4,080 Views)
Solution
Accepted by topic author MarkDavid

You'll need your timer reference inside the loop. Attached are two examples of non-Express ways to do this.

 

timers.PNG

 

<< Edit >> Smerc answered while I was copying and pasting my examples above, so I didn't see the response. About the Express VI, you can open the pront panel of it and convert it to a normal VI, and parse out what you need.

Richard






Message 4 of 16
(4,078 Views)

You both had the same solution.  Can I accept 2 solutions??  I'd like you both to get credit.

0 Kudos
Message 5 of 16
(4,072 Views)

@MarkDavid wrote:

You both had the same solution.  Can I accept 2 solutions??  I'd like you both to get credit.



Just give Kudos! Smiley Happy

Richard






0 Kudos
Message 6 of 16
(4,070 Views)

Hey Broken Arrow..

Two things.

In between readings..ie between 1 and 2 sec say...i get a bunch of numbers that don't make sense.

1...3.406e+9...2....3.406e+9...3...3.406e+3 etc

 

 

2nd.. not familiar with the "i" symbol connected to the "or" function.  Where on the pallet is that located?

0 Kudos
Message 7 of 16
(4,067 Views)

MarkDavid wrote:

[...]

In between readings..ie between 1 and 2 sec say...i get a bunch of numbers that don't make sense.

1...3.406e+9...2....3.406e+9...3...3.406e+3 etc

 


 

 Right click the indicator > Properties > Display Format... change it how you like, example shown....

 

Display Format.jpg

 

 

 


 

MarkDavid wrote:

[...]

2nd.. not familiar with the "i" symbol connected to the "or" function.  Where on the pallet is that located?


That's the very powerful synch tool called "First Call". The first time you run a VI, the output will be high. Use it to initialize something (as done here) or to fire code only once when the program starts.

 

First Call location.jpg

 

 


 

Richard






Message 8 of 16
(4,062 Views)

I'm surprised Broken Arrow did not point you to the elapsed time GERM in our community nugget.  It extends the timer functions and offers a robust method to reuse portions of your main vi's block diagram and provides consistant look and feel between your user interfaces.

 

@Richard-  never pass up an opprotunity to promote your nuggets! it helps encourage nugget development within the communitySmiley Wink


"Should be" isn't "Is" -Jay
Message 9 of 16
(4,054 Views)

I'm getting bizzar numbers between counts.  It goes 1...then 3.406e9 then  .2... then 3.406e9..  I keep getting 3.406e9  between increments.

 

When it should be 1...2...3...4...

 

Any ideas?

0 Kudos
Message 10 of 16
(4,042 Views)