LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I open a vi while in another vi as if it was a pop up

I would like to create a program to where I can open a vi while still in another vi.  I would like it to come up sort of like a pop up box.  How can I go by doing that?
0 Kudos
Message 1 of 7
(3,806 Views)
After you have created your "dialog box" sub-vi you can configure it to act like the built in ones. Right clicking on the icon/connector pane in the upper right will give some choices. Select "VI properties". Select "window appearance" in the pulldown menu then click on "Custom" and click on the "Customize" button. In the menu that you get there will be a lot of selections, but the primary ones for this are in the lower left (the others will modify the the final look, whether there are icons across the top, title bar, etc.) the buttons "Show front panel when called" and "Close afterwards if originally closed". Another one, if you want your sub-vi to remain on top of the other vi's while open is the one in the upper right  "modal". There are a couple of examples, the one of most interest to you is probably "Dialog Box Demo.vi" which shows how to call a dialog, how to pass info in and out and if you look in the "VI properties" how to configure (as mentioned above).
 
Have Fun!
P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(3,799 Views)

I've written programs (one in mind) as LV_Pro mentioned, where I have a main menu with small diagnostic programs and the main test program which can be called individually.  This lets you always exit the diagnostic or test program to the main menu again.  I've successfully run the program in excess of 1000 hours for long life tests without problems, but i'm curious if there are serious disadvantages of programming this way?  I guess i'm trying to contribute and ask in the same post.

 

Thanks,

Matt

maat
LV2019
0 Kudos
Message 3 of 7
(3,784 Views)
What serious disadvantages are you concerned about? It has run "1000's of hours" without  you apparently having any major issue so it sounds successful. Are there performance issues in programming this way? Well it is hard to say from your discription what the underlying architecture is, so it is hard to comment on it. Most of my current big programs have a main program that launches a number of sub-vi's, which are, except the UI, not visible. They are queued state machines, communicating with each other through queues. There are many, many, different ways to solve most problems in LabVIEW and as with any other engineering effort the pros and cons are weighed to determine the appropriate, hopefully optimal, solution based on the driving constraints.
 
P.M
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 4 of 7
(3,780 Views)
How do I go by having a main program and launching many small sub-vis from it?  I tried clicking on the icon and selecting vi properties but it still isn't clear what to do.
0 Kudos
Message 5 of 7
(3,777 Views)

I just posted a vi somewhere else which shows how to call a subvi and have it pop up

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=132249#M132249

you could create a simple state machine to with a different subvi in each frame, depending on which button was pushed, it could call a different state and open a different subvi

maat
LV2019
Message 6 of 7
(3,773 Views)
Hi there,

It's important to remember that there are two basic ways to make the front panel of a SubVI appear when the SubVI is called from another VI. Only the first method has been mentioned in this thread:

1. In case you have a SubVI that you always want to open as a dialog when it's called from any other VI, go to the "File » VI Properties..." menu and customize the "Window Appearance" to "Show front panel when called" and "Close afterwards if originally closed". After applying these settings, the front panel of the SubVI will pop up every time the SubVI is called within another VI.

2. If you only want a SubVI to pop up in some places where it is called, you should not customize the actual SubVI, but instead customize the call to the SubVI. Do this by right-clicking on the icon of the SubVI on the block diagram of the main VI. Select "SubVI Node Setup..." and enable "Show Front Panel when called" and "Close afterwards if originally closed". After this, the SubVI will only pop up in the actual call.

To run the SubVI only when a button is pressed, use a Case Structure or an Event Structure. Here's a small example that shows these two methods:



Have fun!

Message Edited by Philip C. on 07-20-2005 09:13 PM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
Message 7 of 7
(3,749 Views)