LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show & hide sub vi

Solved!
Go to solution
Hello
I want to hide and show the VI's, have 3 buttons in my front pannel Sub vi 1, Sub vi 2 & exit button.
when i select sub vi 1 button  my front pannel will hide & Sub vi 1.vi will run when i stop the sub vi1.vi it will close & the front pannel will again display, & sub vi 1 will hide, & sub vi 2 will also show & hide when the buttons are pressed.
 
but in my program when i press Sub vi 1.vi front pannel is closing & sub vi 1 is opening but when i stop the sub vi 1.vi it closes and again its opening automatically, because my front pannel buttons becomes true always.
 
how to do it give me an idea.
 
i attached my VI with this mail.
 thanks
sk

I am using LabVIEW 7.1
0 Kudos
Message 1 of 13
(6,068 Views)
Solution
Accepted by developer help
You should set your buttons to "Mechanical action=latch if released".
 
Attached is a quick modification.
Message 2 of 13
(6,057 Views)
I wrote an example a while back on a method that I used to conveniently hide or show a panel. I have a couple subVIs that I wrote called Show VI and Hide VI. They only have error in and out terminals. The idea is just to drop them in a VI when you want to hide or show it respectively. I'm attaching an example with these VIs included that shows what I mean. Try them out!
Jarrod S.
National Instruments
Message 3 of 13
(6,035 Views)
I also posted these examples to the new community forum where users can post, download and maintain example code for general use. It's a good place to look for what you're missing or post what might help others. The site is still in beta, so you won't be able to use your current forums login, but it only takes a second to make a new one!
Jarrod S.
National Instruments
0 Kudos
Message 4 of 13
(6,028 Views)
jarold, the example from you still worked even when the hide and show vis were removed. So what is the point? If left alone like that but with the 'run vi when opened' property disabled then it would not work at all.
0 Kudos
Message 5 of 13
(5,930 Views)
What do you mean the example still "works" with the Show and Hide VIs deleted? Do you mean it still runs? Yes, it still runs, but it doesn't solve the original problem that Developer had in the original post I responded to. The question was how to hide front panels for a main VI while a popup dialog is executing. That does not happen without the Show and Hide Vis. Now, if you look in those subVIs, you'll see there's really nothing special about them at all. They are just property node calls to show or hide a front panel. The only point of having them in a subVI is because I had seen that question so many times from users.

I don't know what you mean about it NOT working if Run when Opened is disabled. For what VI? The main VI? One of the popup dialogs? What doesn't work? Run when Opened is already disabled for all three VIs, and it seems to "work."
Jarrod S.
National Instruments
0 Kudos
Message 6 of 13
(5,907 Views)
It still worked, not just run, exactly like the original! To make it work like that, you need to enable the 'open panel when called' in the sub vis properties (the consecutive message vis) and that is it!
0 Kudos
Message 7 of 13
(5,901 Views)
I don't think you understand the whole point of the example. It was not to make the subVIs front panels visible. It was to hide the calling VI's front panel. Your idea does nothing to address the original question. And, the properties of the posted subVIs is set to 'Show front panel when called'.
Message 8 of 13
(5,895 Views)
OK my bad. The original desire is to make the calling vi disappear!
0 Kudos
Message 9 of 13
(5,886 Views)
But just one caution, if anything goes wrong with the sub vis then there is no way without shutting down labview to see and control the calling vi. Before you wander far enough for new things, just keep in mind logical order should be maintained throughout the entire program.
0 Kudos
Message 10 of 13
(5,877 Views)