LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i unload a front panel from a subpanel

I have two subpanels in a main vi

I dynamically load a .vit instance in each supbanel giving me two instances of the same subvi

everything is working but what i want to do is when I close the vi in the subpanel i want to unload it from the subpanel

How?   any ideas?
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 1 of 4
(2,972 Views)

"James R" <x@no.email> wrote in message news:1175807407581-503184@exchange.ni.com...
I have two subpanels in a main vi I dynamically load a .vit instance in each supbanel giving me two instances of the same subvieverything is working but what i want to do is when I close the vi in the subpanel i want to unload it from the subpanelHow?&nbsp;&nbsp; any ideas?


You'll have to use the subpanel's method "Remove VI". This can be a problem, because sometimes the VI inside the panel needs to remove itself. If that is the case, you need to pass the subpanel's reference when you dynamically start the vit. The subpanel reference is then known to the dynamic vi, and you can use the same method "Remove VI" to have the VI remove itself.


Another way is to build a user event buffer, and send a user event "empty subpanel" to the main. The main can then use the Remove VI method to empty the subpanel.


NI should have made a propery "What SubPanel Am I In" (and "What VI Is In This Subpanel"), but unfortunatelly they didn't.



Regards,


Wiebe.
Message 2 of 4
(2,956 Views)
Thanks for the tips !

I will have to try passing events that is interesting. 

the way i got it  to work was to put a button on the main vi that triggered an event and used the control value set method to push the stop button then used the remove vi

but I don't really want to have a button in my main vi i'd rather use the stop button in the subvi so events with passing the subpanel reference  would be a good solution

thanks again

Message Edited by James R on 04-06-2007 08:49 AM

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 3 of 4
(2,942 Views)

"James R" <x@no.email> wrote in message news:1175868607769-503434@exchange.ni.com...
Thanks for the tips ! I will have to try passing events that is interesting.&nbsp; the way i got it&nbsp; to work was to put a button on the main vi that triggered an event and used the control value set method to push the stop button then used the remove vibut I don't really want to have a button in my main vi i'd rather use the stop button in the subvi so events with passing the subpanel reference&nbsp; would be a good solutionthanks againMessage Edited by James R on 04-06-2007 08:49 AM



Check out the presentation called "Presentatie LabVIEW User Group Meeting 2006", at www.caya.nl . The presentation is in Dutch, but the code should be generic.


Regards,


Wiebe.
0 Kudos
Message 4 of 4
(2,931 Views)