07-02-2015 04:48 AM
hi,
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.
07-02-2015 05:52 AM
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.
07-02-2015 06:05 AM
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.
Refer http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE
07-02-2015 06:09 AM
HI,
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.
07-02-2015 11:01 PM
hi,
led mean two boolean indicator blink...for difference while loop and difference time delay.if i will use state machine totall delay is added.so pls tell me to stop without delay while loop.
07-03-2015 12:01 AM
Show your latest attempt with using the state machine.
It sounds like you are wiring things up to work in series rather than parallel.