LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a time control for while loop?

Solved!
Go to solution

Hello all,

 

I would like to control my while loop's execution time. In other words I want to stop while loop's execution after time (in ms) which is set by user. For example user sets 5 seconds to front panel control and a while loop runs and stops after 5 seconds.

 

I am not sure is it possible with the while loop. I succeed with the timed loop but it suits badly to my application. Is there any other loops for timed control if it is not possible with while loop? There is also a simple while loop with Random Number (0-1).vi as attachment.

 

Best Regards,

Jick

0 Kudos
Message 1 of 9
(32,462 Views)

"Elapsed time" express VI...Please see attached

Message 2 of 9
(32,457 Views)

hi,

see this, may be it will help.

 

 

 

 

Best luck

Gaurav kSmiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 3 of 9
(32,445 Views)
Solution
Accepted by topic author Jick

Hi again,

 

I managed to solve my problem right after I posted my first message. I did it with elapsed time and shift register (for reset elapsed time).

Thanks for your replies anyway! 🙂

 

Best R,

Jick

0 Kudos
Message 4 of 9
(32,436 Views)
Hi Jick, I realize this is old but would it be possible to post the code you used.
0 Kudos
Message 5 of 9
(29,846 Views)

Hi egyptiandude,

 

I also have the same problem right now. I have to conntinuosly update some values in a while loop for a time decided by the user. So the while loop must continuosly run for an arbitrary time. I am also using elapsed time function, but it works only for the first iteration (everything is into a for loop). I figure out I have to use shift registers to reset the elapsed time function, but still did not understand how.

 

Also, how to reset the elapsed time output boolean back to false,once it has reached the target time? thanks

0 Kudos
Message 6 of 9
(28,182 Views)

fabbro continued that question in it's own thread!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(28,164 Views)

 How can I do time control for while loop without express vi.

0 Kudos
Message 8 of 9
(22,783 Views)

Hi Fawuuz,

 

there are other timing functions available. Choose one of them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(22,771 Views)