LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time

The attached is a picture of a timer program.

I need to run the big while loop for 3 times, each time for a 5s+5s time elapse.

The problem is that the program stuck at the second elapsed time in the first loop,

and remains there until all 3 big loops end. The first 2 films were not executed any more

and it never reaches the last film.timing.PNG  

0 Kudos
Message 1 of 3
(2,420 Views)

Without knowing how any of the express VIs are setup, I'm guessing you need to reset the Elapsed Time on the first iteration of its while loop.

 

I question whether this is necessary.  Why not use the Wait (ms) with a 5000 wired to it.  That would be a lot cleaner than an Elapsed Time inside of a while loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,409 Views)

stay away from sequenced events, especially in your case where you want to run multiple times of the same event...change it over to a simple state machine with your timer and a shift reg. to keep track of your #cycles . case structure would be:

 

  1. "initialize"
  2. "state 1" timed event 1
  3. "state 2" timed event 2, add +1 to #cycles shift reg., if #cycles not = 3...go back to "state 1"
  4. if #cycles  = 3...then goto "exit" case.

elapsed time.png

Message 3 of 3
(2,389 Views)