LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sub VI popup button

How do I open the front panel of a sub VI with a button on the main front panel?
Thanx for any help!
0 Kudos
Message 1 of 8
(3,179 Views)
In order to do this you can open a reference to your SubVi and change the state of its "Front Panel Window->Open" property. If you'll need futher explanations then I can make an example of this approach.
0 Kudos
Message 2 of 8
(3,179 Views)
I think I need some more explanation to this, yes. If you could make a small example I would appretiate it 🙂
0 Kudos
Message 3 of 8
(3,179 Views)
Ok, here it is - I don't know what your application does, so I make some general example - just type in the path of any vi you want to manipulate (or select it when file open dialog appears). If the vi is not alredy in memory this will also load it.
Hope this will help to get an idea.
Message 4 of 8
(3,179 Views)
Your solution can work, but I want to be able to open the sub vi before I run the main vi as the sub vi contains the device and channel names to save space on the main front panel.
My main vi is the "Mini-Loop Control Panel.vi" and I want the "Mini Loop IO" to be opened with the button.
0 Kudos
Message 5 of 8
(3,179 Views)
Ops... I'm not sure that you start your project from the good side.
Problem #1: "You cannot do something while doing nothing" - and in this case it means that you can not open one vi with a button on another while none of them are running. Minimum one MUST be already in run mode in order to supervise changes in controls. May be it can be some kind of a third vi that opens both vi's when starting up. Also, I see that your Mini-Loop IO MUST be configured before the application starts in order to supply valid configuration data to its outputs (Some kind of dialog with user, so while loop and Ok button when finished). Think about deviding your project in a "configuration phase" and a "work phase".

Also, for you may be there is no
need to use references - to open front panel of a subvi when it is called you can set this flag in vi's properties dialog.

And, BTW, it is more simply to change directly a button boolean text then placing a label above one.

Sorry for my poor english
0 Kudos
Message 6 of 8
(3,179 Views)
Ok, I've edited a bit some of your vi's - now this can work, I assume...
A little tip here - you can tune setting of the vi that it's front panel opens when the vi is loaded. So when user opens your main vi, the panel of the subvi with this flag cheked will also appear. If this is enough for your application it's a simpliest solution. Othervise look for the changes I've made for your vi's...
0 Kudos
Message 7 of 8
(3,179 Views)
Thank you so much for all your suggestions and solutions!! I think I have to sit down now and get everything to work together, and maybe I can get some good data for my research as well...

Lars
0 Kudos
Message 8 of 8
(3,179 Views)