LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Aborting a SubVI from front panel?

Hi,

I have a VI which calls a SubVI that continously acquires data from a
DIO board. Usually the SubVI finishes when a certain number of data
words have been collected. If there is a problem with data acqusition,
there is a 'Stop' button on the front panel of the SubVI which aborts
a while loop (and therefore data acqusition) and returns to the
calling VI.

I would like to be able to have a 'Stop' button on the front panel of
the calling VI to manually stop data acqusition if necessary.
Unfortunatly this does not seem to work, as the SubVI does not seem to
check the status of the input that I wire to the 'Stop' button via the
connector panel.

Does anyone know how to solve this problem?

Many thanks,

Joe.
0 Kudos
Message 1 of 4
(2,425 Views)
An easy way to solve this problem is to use a global variable for the stop
function.

"Joe" wrote in message
news:f156295.0108210623.2cc35a27@posting.google.com...
> Hi,
>
> I have a VI which calls a SubVI that continously acquires data from a
> DIO board. Usually the SubVI finishes when a certain number of data
> words have been collected. If there is a problem with data acqusition,
> there is a 'Stop' button on the front panel of the SubVI which aborts
> a while loop (and therefore data acqusition) and returns to the
> calling VI.
>
> I would like to be able to have a 'Stop' button on the front panel of
> the calling VI to manually stop data acqusition if necessary.
> Unfortunatly this does not seem to work, as the SubVI does not seem to
> check the status of
the input that I wire to the 'Stop' button via the
> connector panel.
>
> Does anyone know how to solve this problem?
>
> Many thanks,
>
> Joe.
0 Kudos
Message 2 of 4
(2,425 Views)
You could use a global stop.

"Joe" wrote in message
news:f156295.0108210623.2cc35a27@posting.google.com...
> Hi,
>
> I have a VI which calls a SubVI that continously acquires data from a
> DIO board. Usually the SubVI finishes when a certain number of data
> words have been collected. If there is a problem with data acqusition,
> there is a 'Stop' button on the front panel of the SubVI which aborts
> a while loop (and therefore data acqusition) and returns to the
> calling VI.
>
> I would like to be able to have a 'Stop' button on the front panel of
> the calling VI to manually stop data acqusition if necessary.
> Unfortunatly this does not seem to work, as the SubVI does not seem to
> check the status of the input that I wire to the 'Stop' button via
the
> connector panel.
>
> Does anyone know how to solve this problem?
>
> Many thanks,
>
> Joe.
0 Kudos
Message 3 of 4
(2,425 Views)
The input to a subVI is only entered into the subVI when it is first run. While it is possible to rebuild the subVI to look at a global variable, a better solution might be to "push" the subVI's Stop button using a reference.

I have built a set of library routines to make this a little easier (attached). Use the Open Reference and wire in the name of the subVI. Feed the reference and error cluster into the Set Boolean and wire in the name of the button and a True to "push" the button. These routines were originally built for updating the front panel from a subVI, but they work other ways as well (including setting controls on seperate programs).

Rob
Message 4 of 4
(2,425 Views)