LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i get subpanel to blank when sub-VI finishes running

I have a top-level VI with while loop in the B/D code which contains a sub-panel control. I have a series of buttons 4 the user 2 select which function they want, each of which pops-up or displays the appropriate sub-VI F/P in the SubPanel. When the sub-VI finishes running, however, the sub-VIs panel remains in the subpanel control until I click another button or quit,etc. I want the sub-VI's F/P to disappear from the subpanel control when it has finished running...

Does anybody have any idea how I might achieve this?
0 Kudos
Message 1 of 6
(3,543 Views)
Hello.
To have a subVI open its front panel when it executes and close its front panel when it finished executing you can simply right click on the subVI in the top-level VI's block diagram, go to "subVI node setup" and put a checkmark both on "Show front panel when called" and "Close afterwards if originally closed". Note that this configuration only affects this instance of the subVI. If you want the subVI to behave that way always, you can open the subVI, go to File > VI Properties, go to the "Window Appearance" section, click on "Customize" and again put a checkmark on both "Show front panel when called" and "Close afterwards if originally closed". This will open and close the subVI's front panel every time it is called as a subVI.
0 Kudos
Message 2 of 6
(3,543 Views)
Hi,

With Sub-Panels, there's no Sub-VI node to right-click on in the BD, so that ruled that out 4 me...

I tried setting this behaviour for the VI in it's VI Properties, and even though I've verified that the settings are there & set, when I call it using the Sub-Panel it opens the FP, runs the VI, but when the sub-VI finishes, the FP doesn't disappear...

I assume it's something to do with the SubPanel's way of calling it or something?
0 Kudos
Message 3 of 6
(3,543 Views)
Have you tried creating an invoke node for the subpanel and setting the remove VI node? That should, well, remove the current vi in the subpanel.

Abe Stoker
Software Engineer
Sytronics, Inc.
0 Kudos
Message 4 of 6
(3,543 Views)
Tried an invoke node using a shift register to close the FP of the current sub-VI on the next iteration of my loop (i.e. when it's finished)... had to create VI Ref constant to init shift register, and this kept creating errors for me every time I tried to run the loop when I called my sub-VI... unless I was generating the constant incorrectly r something, don't think this is gonna work...

M.J.
0 Kudos
Message 5 of 6
(3,543 Views)
I am sorry I didn't read your question carefully the first time, and I answered as if you were simply using subVIs. Since nobody has seemed to be able to come up with a better answer to "blank" out the subpanel window when the subVI finishes execution, you might try what I show in the attached VIs, which is simply to place the subpanel control in a tab control, and switch the tab page to an empty page when the subVI is no longer executing. Does this work for you?
(when you download the VIs, place them both in the same directory)
Download All
Message 6 of 6
(3,543 Views)