LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: exit from a while loop in sub vi

I think the mail didn`t get through first time. Repeat posting - Sorry if
this occurs twice

Shane

Hallo,

Can the use of occurrences solve this problem?

The Main program can create an occurrence which can be passed to the
sub-VIs. Upon pressing the button to cancel the loop, the occurrence can be
set, instantly transmitted to all other VIs sharing which were passed the
same occurrence. Of course a small handling routine has to be written (say
a sequence parallel to the executing while loop waiting for the occurrence
and then setting the exit parameter to "true") but this is trivial.

I have checked this with a small program splitting an occurrence to three
seperate VIs and it works.

If you want, I can send a cop
y of it.

It may well be possible with notifiers or something else, but I have far
less experience with them.

Hope this helps

Shane

>pcu schrieb in Nachricht
><506500000008000000A7200000-991728092000@quiq.com>...
>>Main vi has several sub-vi's. Each sub vi has a while loop and Boolean
>>button. When program runs, sub-vi front panel appears, and I can
>>stop/continue the while loop. But when I stopped a while loop in a
>>sub-vi, I cannot control other while loops in other sub vi.
>>I need exit function from a while loop, not stop function of entire
>>program.
>>Thanks.
>
>
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 1 of 2
(2,454 Views)
The notifier is probably better than occurence at this case - than it is not neccessry to write a parallel sequence.

The use of notifier is very simple, just follow an example in Help/Search example -> Advances -> Execution control -- Synchronization -> SubVI notification.

Good luck

Ferda
0 Kudos
Message 2 of 2
(2,454 Views)