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.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Zafer.Depe

While Loops With Time Out Condition

Status: New

Idea is while loops with time out condition. That means if the maximum duration is exceeded, loop stops executing the code inside and gives a time out error. So we don't have to check the maximum iteration number or time passed inside the code and it prevents unexpected long execution timing.

Timed Out Loop.jpg

 

 

5 Comments
AristosQueue (NI)
NI Employee (retired)

This would seem to be a request more appropriate for the Timed Loop than for the standard While Loop.

Zafer.Depe
Active Participant

You are a bit true. This loop will be a basic model of the timed loop. No synchronization or time critical operation is needed. After For Loops with condition terminal, I almost quit using while loops (I use just as an acquisition loop or communication loop or some continuous no critical loops.) Actually time out should be added to both For Loops and While Loops. Loop keeps running normally but if the time is up it stops running with a time up error. Just an idea maybe different ideas would be better.

RnDMonkey
Active Participant

I think this would still be useful for the standard While Loop, not just the Timed Loop. It makes a cheap and dirty way of a programmer to make an escape from an unknown error that might otherwise lock up your program.

 

That assumes that such a timeout added to the loop would actually terminate functions/subVIs within the structure, not just force a stop condition after a certain elapsed time.

____
Ryan R.
R&D
dthor
Active Participant

As AQ mentioned, here's the similar Idea (Timed FOR loop)

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Timed-FOR-Loop/idi-p/2100408

Zafer.Depe
Active Participant

@RnDMonkey

 

I think this would still be useful for the standard While Loop, not just the Timed Loop. It makes a cheap and dirty way of a programmer to make an escape from an unknown error that might otherwise lock up your program.

 

That assumes that such a timeout added to the loop would actually terminate functions/subVIs within the structure, not just force a stop condition after a certain elapsed time.

 

+1