LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I start/stop a while loop programmatically inside a while loop

Hi,

 

can somebody help?

how to start and stop a while loopprogrammatically, not just by clicking run button of the vi,

 

ex:- main vi has a while loop and it has a inner loop, main while loop runs until i stop, but the inner while loop should start and stop on a button press.

 

 

0 Kudos
Message 1 of 6
(6,394 Views)
This'll do it, but I'm curious about why you'd want to... 
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(6,386 Views)

thank you so much,

 

 I am trying to code the below picture

 

it should write 30 secs of data  every 8 hrs and this should repeat for 14 days.

 

see attached vi, im using 2 elapsed time vis to control this but if i use the 30sec timer inside inner while lt stops after 30 seconds and does not start whennext 8hrs elapse

so, i wanted to try to contol the inner loop, please see the elapsed timer.vi , any help would be much appreciated

 

 

Download All
0 Kudos
Message 3 of 6
(6,373 Views)
also, in the vi you sent, the outer loop seems to halt for the time the inner loop is running, is it possible to control only the inner one while the outer one still keeps running and stop wen i press main stop?
0 Kudos
Message 4 of 6
(6,370 Views)

No you can't have one loop running continuously inside of another loop that is also running continuously.  A structure can't complete its iteration until all structures inside of it have completed, which means the inner while loop has ended.  This is a basic understanding of dataflow withing LabVIEW.  

Since you are new to LabVIEW, I would recommend looking at the online LabVIEW tutorials:
Message 5 of 6
(6,361 Views)
This discussion was also started on LAVA.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 6
(6,327 Views)