NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop needs a countdown timer

Solved!
Go to solution

Hello All,

 I am using aTeststand/Labview/Vision system to monitor various strings on an LCD display. Teststand while loops monitor the LCD text but sometimes the expected text is not captured and the "while" will loop forever because the product screen shutsoff after x seconds. Is there a feature in Teststand where I can init a timer with a seconds value and start it running? Then if the LCD screen timesout some seconds later the timer will reach zero and the while loop will terminate ideally moving onto the next step (or terminating the sequence would be ok). The while is running the timer in parallel with the vision acquisition.

 

I could do this in Labview but I have a lot of while loops requiring this functionality so much prefer a Teststand solution. Labview would be at least 2 extra stages per while loop. An example would be greatly appreciated.

 

I have tried downloading xyz.seq files from this site but they save as html format what am I doing wrong?

 

Thanks, Chris.

0 Kudos
Message 1 of 4
(5,558 Views)

You could declare a variable (Locals.TO) for time, and use an expression that sets an inital time before entering the loop by using

 

Locals.TO = Seconds()

 

Then use an if statement while in the loop to check for a certain timeout.

While

   while loop stuff here

 

     If  Seconds() -Locals.TO > 30                                                 greater than 30 seconds

     Break;

   end if

end while

 

Maybe this will help a little.

Why do geeks think Halloween and Christmas occur on the same day?
Because 31oct = 25dec!
0 Kudos
Message 2 of 4
(5,534 Views)
Solution
Accepted by Chris46

Try this, it may do what you want.

Why do geeks think Halloween and Christmas occur on the same day?
Because 31oct = 25dec!
0 Kudos
Message 3 of 4
(5,532 Views)

Hello Mustanghipo,

Very nice solution,

Many thanks Chris

0 Kudos
Message 4 of 4
(5,499 Views)