NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout on while loop

Solved!
Go to solution

Hello,

I need to insert a timeout on a while loop to exit this loop in the case of the device isn't able to answer.

How can I do ?

Best regards

0 Kudos
Message 1 of 3
(6,660 Views)
Solution
Accepted by topic author ThGO

Create a Local Variable:

Locals.StartTime

 

In an expression step before you start the while loop set Locals.StartTime = Seconds()

 

 

As part of the condition for the While Loop use: (Seconds() - Locals.StartTime) < X

where X is your timeout in seconds.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 3
(6,651 Views)

Thank you it works very well.

0 Kudos
Message 3 of 3
(6,637 Views)