LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

howto stop a subvi

Hi,

I have a question, I am running a SubVI within a control VI (kind of wizard like with subpanels) and I want to use an abort button in the main VI to stop the SubVI thats still running (just like the stop button within labview (next to run and loop)) Can someone help me...

thnx
Bart bakels
Labview CLD , Engineer/Manager

Promedes and DSM
using LV 7.1, 8.0, 8.2, 8.5 and 2009 SP1
http://www.promedes.nl
0 Kudos
Message 1 of 8
(7,930 Views)
Hi,
I did not quit understand what you want to do!!
take alook at the Attached VI Lv7.1
if it does not help you can post a snapshot of what you are trying to do.
there are guys here that can help.
good luck!!!!
Ohiofudu
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 8
(7,926 Views)
that isnt what i ment ;), I dont think its posible, I am running a Subvi in a main VI. The SubVI contains a loop. So I want to stop the subVI with a stop button located in the main VI. The only way to do this if i can control the main stop button In the control bar(run, loop, stop) from the subvi.
Labview CLD , Engineer/Manager

Promedes and DSM
using LV 7.1, 8.0, 8.2, 8.5 and 2009 SP1
http://www.promedes.nl
0 Kudos
Message 3 of 8
(7,923 Views)


@bartb wrote:
Hi,

I have a question, I am running a SubVI within a control VI (kind of wizard like with subpanels) and I want to use an abort button in the main VI to stop the SubVI thats still running (just like the stop button within labview (next to run and loop)) Can someone help me...

thnx
Bart bakels




Are you saying that you want to use LabVIEW "Abort" button to stop a VI? If so, instead of using the LabVIEW "Abort" button you use a while loop controlled by a boolean button. then when the user presses the stop button execution of your top level VI will stop. Also, you can use a Global Variable to pass the value of the boolean button to your subvi. Then when the user clicks on the boolean button, the value change will be seen by the top level VI and subVI.

You should not use the LabVIEW "Abort" button to stop execution of a program. The "Abort" button is intended to be used for development purposes.

See the attached example and run "Global Variable-Top Level VI.vi"

Chad
0 Kudos
Message 4 of 8
(7,914 Views)
If your subVI is truely a subVI to your main VI and if it was called by the main VI and is currently executing a loop internal to itself then the subVI is the VI which has "execution focus", not the main VI. The main VI is in a state of limbo waiting for the subVI to finish execution. Other than the LabVIEW ABORT button (the thing that looks like a stop sign up on the window's toolbar) and its keyboard shortcut, there is absolutely nothing you can do or push on the main VI to get it to to anything while it is in this state.

It is possible however to have the main VI launch another VI in another execution process so it executes in parallel. In this case, unless you have told the main VI to wait until execution completes in the other VI (note that I'm not calling it a subVI if it executes in parallel), the main VI still retains its own execution focus so buttons on its front panel will still work. If the buttons still work then you can use any one of several means (globals, message queues, occurances, semaphores, remote control references...) of communicating a stop-running event to the other VI. It's even possible to have the front panel of the other VI appear on the front panel of the main VI so you can push a stop button on the front panel of the other VI on the front panel of the main VI.

The simple answer is that you can use the abort button to stop a subVI from a main VI but that is the only way.
Message 5 of 8
(7,888 Views)

Hello,

I was reading this post from 2005...the line states that

 

______________________________________________________________________________________________________________________________________________________

" It's even possible to have the front panel of the other VI appear on the front panel of the main VI so you can push a stop button on the front panel of the other VI on the front panel of

the main VI."

______________________________________________________________________________________________________________________________________________________

Can someone tell how this can be done.

TIA.

 

 

*************************************************
CLD
*************************************************
0 Kudos
Message 6 of 8
(7,180 Views)

@lvrat wrote:

Can someone tell how this can be done.



Start here....

Message 7 of 8
(7,176 Views)

So when subpanel opens (or embeds) a VI does the VI runs in its own thread? If there is a stop button on the subVI (that openend in subpanel) will that stop button stop the subVI while main VI still runs. How does LabVIEW internally executes subpanels?

TIA.

*************************************************
CLD
*************************************************
0 Kudos
Message 8 of 8
(7,125 Views)