LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to abort subvi in subpanel?

Hi is there anyone who knows how to abort and close the sub-vi inside the subpanel
while the main.vi  or sub-panel is still running and able to open the another sub-vi again?
0 Kudos
Message 1 of 7
(4,292 Views)

Hi

I assume you have a sub-vi, which has a while-loop. Just stop this loop and close the front panel using an invoke node. If you insert the sub-vi into the subpanel, check if the front panel is open. If so, just insert and run it, otherwise open it first.

Hope this helps.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 7
(4,283 Views)
You should be able to insert a vi, run the vi with an invoke runVi node (use wait for completion = FALSE so the vi runs in its own thread) and if you need to stop the vi, call "abortVi" with the reference to the sub-panel's vi, this will stop the vi, then you can programmatically close it and insert a new vi.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 7
(4,273 Views)

A better way to stop a vi then abort is to allow for some communication protocol like a custom event or a message queue to signal to shutdown this will allow for a safe abort  of the vi in the sub-panel but requires more planning so think if it is worth the work.

Paul.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 7
(4,270 Views)
It always depends on the situation, how you implement communication. But it's always better to know what's going on than just abort a vi.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 5 of 7
(4,271 Views)
Hi. Here are 2 attached. They are simple. First I created one that increments the number throught out the loop inside the subpanel.till it is stopped by button outside the subpanel. . However, there are two problems that do not work right. One, the loop stops at 2 or 3 even the button is not pressed outside sunpanel. Maybe due to notifier communications. Two, vi inside the subpanel cannot be stopped and removed.
 
So how do I do about it. There are no good examples shipped with LV.
 
Clement
Download All
0 Kudos
Message 6 of 7
(4,200 Views)
Hi,  Becktho and Falkpl,
I manage to solve the problem All I have to do is create a another loop for send notification. So now it works.
Most important, is that the I must create send notification and wait for notification in each loop.
Thanks
Clement   
0 Kudos
Message 7 of 7
(4,169 Views)