LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing front panels

Hi there,

is there a way to close a vi's front panel (in labview 6.1) besides the quit labview function,
this function closes all vi's that are open.
Say you have a main vi and several subvi's, in the main you select a task which opens a subvi where you can select several subtasks. But from the moment the subvi opens the main vi should be gone, sort of like browsing thru your files in windows. I would also like to integrate a back button for when the vi has finished so that you can go back to the main.
Is this possible?

Thanks
0 Kudos
Message 1 of 5
(3,145 Views)
Most often controlling the closing and opening of the panel is done from the VI properties -> window appearance setup, there you can set whether the VIs front panel should open when called or loaded and whether it should close when finished. The same properties can be set/overrun when calling the VI in the sub-VI node setup which you can access by right-clicking on the sub-VI.

However - you can also open and close front panels using property nodes or methods. If you get a reference to the VI and set it's front panel open property to false you close the window and vice versa.
Using an invoke node there is a method called Open FP...lot's of options in other words.

You'll need to make sure the data flow is correct though; it does not help to close a window if yo
u really need the VI to stop and unload e.g.

Closing the last open front panel by making all code end and then set the front panel open property to false is the cleanest way to exit a built application by the way; unlike using the quit function the last window will dissapear instantly, no flashing of a halted VI window (In my oppinion NI should modify this function so that it does not do this in built applications...but anyaway).
0 Kudos
Message 2 of 5
(3,145 Views)
Hello f_d,

yes it's possible. You have to use the VI property
nodes. With this you can control the front panel of
sub-vi's (or main-vi's).
You have to pass a vi reference (Open VI Reference)
and then select the property FrontPanel.Open, wire
true (or false, just as needed) and then it works...

Best regards
Gerd
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(3,145 Views)
"Hello
(1)Place your "sub vi" inside your case structure inside your main vi
(2)The control for sub vi's is a switch in the main.vi
(3)Then in the main vi right click the mouse on sub vi and you will get an option for "Sub Vi node setup" Click it on and you will have a options to make, click this two option given below
"show front panel when called"
"close afterwards if orginally closed"
(4)Whenever the main vi switch becomes true it will go inside Sub vi and executes and comes out when execution is over
Check the main.vi which i am sending
Regards
mathews.j@consultant.com
0 Kudos
Message 4 of 5
(3,145 Views)
Yes, you can make front panels visible and not visibile programatically
using vi property nodes.

"f_d" wrote in message
news:50650000000800000052BE0000-1075935269000@exchange.ni.com...
> Hi there,
>
> is there a way to close a vi's front panel (in labview 6.1) besides
> the quit labview function,
> this function closes all vi's that are open.
> Say you have a main vi and several subvi's, in the main you select a
> task which opens a subvi where you can select several subtasks. But
> from the moment the subvi opens the main vi should be gone, sort of
> like browsing thru your files in windows. I would also like to
> integrate a back button for when the vi has finished so that you can
> go back to the main.
> Is this possible?
>
> Thanks
>
0 Kudos
Message 5 of 5
(3,145 Views)