From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,651 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,642 Views)

Thank you it works very well.

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