Showing results for 
Search instead for 
Did you mean: 

how to stop sub vi while loop


      i have three while loop.

        1)main vi out side of event structure with timeout

        2)second while 1sec time delay

        3).sub vi 3sec delay

all while stop one globle bool controll button.


when i will stop this main vi it will take some time to stop.bcaz delay in while how sop immediate.pls tell me any other methode.


Download All
0 Kudos
Message 1 of 6

Use a state machine. Have the state machine keep running with a small execution timing (e.g. 10ms) and keep checking if the 3s has elapsed (to do your process) or if it's time to exit.

LabVIEW Champion, CLA, CLED, CTD
0 Kudos
Message 2 of 6

Hi Gokul,


try using Queues.


Attached a sample ,on how Queues used to stops parrallel loops.


In ur case u can pass the Q refnum to sub Vi and stop all the loops.Dont forgot to close refum after while loop.



0 Kudos
Message 3 of 6


        I want blink two LED.


        1).while two LED 1sec

         2).sub vi while LED 3sec


if i will use state machine  both led blink 4sec.

0 Kudos
Message 4 of 6


         led mean two boolean indicator blink...for difference while loop and difference time delay.if i will use state machine totall delay is pls tell me to stop without delay while loop.

0 Kudos
Message 5 of 6

Show your latest attempt with using the state machine.


It sounds like you are wiring things up to work in series rather than parallel.

0 Kudos
Message 6 of 6