LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a VI with multiple windows/displays?

Hi, I'm new to LabVIEW and just trying to increase my understanding so please bear with me.I want to write a VI where the user is presented with a series of windows and depending on the button, different windows are displayed. What would be the best way to implement this? Is there a way to change the Front Panel all in one VI? Or would it be better to do it using SubVIs? Or separate VIs for each window? I've looked at the Open VI Reference and Invoke Node VIs and can see a possible implementation that way, but I'm still curious if this is the best way. I also considered using tabs, but I want the different "windows" to be unique and not tabs. By "windows" I mean when the user clicks a button, a completely different Front Panel is displayed and the previous one is hidden/closed. Thanks for any help.

0 Kudos
Message 1 of 27
(11,422 Views)

First.  Yes the property "FP Open" is writable during run time.  So you can programatically show and hide the front panels of several sub vis that your main "launcher" can control.  Another option is to launch sub-vis that are "Modal" so that they act like dialog pop-ups and float to the top until the user performs some action that closes the sub-vi execution.  Personally I use this method frequently for actions like setting test options, selecting test vectors or displaying error information to the user.

 

But I do want to add a caution,  Make sure your user can understand what is going on!  By that I mean that you must take into account that most applications have one main interface and, your user is used to this behavior in the applications that they run, so this MUST affect your UI design.  Unless you want all of your users to start using the phrase "Well, this is a sdsdsding mess!" you can't get very far away from the typical application UI paradigm.  If I ran an app that changed panels, and kept closing where I came from, throughout its normal functions I would become frustrated as a user.  As the Developer of that App I would know how I coded it and therefore the switching would make sense to me but, the target user is the person that must deal with it.  (And you never know when even the code you develop as a "development aid" will have reuse potential and need to be adapted for a large target  audience).


"Should be" isn't "Is" -Jay
Message 2 of 27
(11,403 Views)

Thanks. I'll definitely look into that method too. Also, if I understand correctly, you're talking about the differences between the designer's conceptual model and the user's conceptual model. This can never be stated enough and thanks for reminding me. I'll definitely design with the goal of decreasing the gulf of execution.

Message 3 of 27
(11,398 Views)

 


@sdsdsd wrote:

Thanks. I'll definitely look into that method too. Also, if I understand correctly, you're talking about the differences between the designer's conceptual model and the user's conceptual model. This can never be stated enough and thanks for reminding me. I'll definitely design with the goal of decreasing the gulf of execution.


Exactly- (And a lesson I once learned the hard way- Ah youth!)

 


"Should be" isn't "Is" -Jay
Message 4 of 27
(11,388 Views)

May I suggest the use of subpanels.  Put a subpanel on your main VI front panel.  When a need for a new screen is called for, open the subvi front panel in the subpanel.  By doing it this way, all of the main functionality is still present.  You can have buttons to switch to different windows (subvi front panels), and stop the entire execution, all on one screen.  Attached is an example of using a subpanel to display two different windows on top of the main.  You won't be able to run it without the subvi's, but you can modify the code to include your own subvi's.  You would have to do this anyway since my paths are hard coded.

 

- tbob

Inventor of the WORM Global
Message 5 of 27
(11,367 Views)

Thanks mate. Could you save that as a LabVIEW 8.5 file? That's what I'm currently working on.

0 Kudos
Message 6 of 27
(11,356 Views)

You can find examples of subpanels shipped with LabVIEW. Just open the Example Finder (Help -> Find Examples) and search for subpanels.

Message 7 of 27
(11,350 Views)

I decided to just create a SubPanel and figure it out for myself. I have a question though, if I go this route where I load the VI into a sub panel, will subsequent "windows" have to be in a sub panel of the VI I load?

 

Here's an example:

 

I create Main.vi with a Sub Panel. Into this Sub Panel, I load a VI called First.vi which has 1 button. When this button is clicked, I want to load Second.vi. Will Second.vi have to be loaded into a Sub Panel in First.vi? Or is there a way to create a reference to the button control in First.vi and then have a condition to change which VI reference is attached to the Sub Panel in Main.vi.

 

I apologize if this is a confusing example and tell me if it is (so I can explain more). Also, thanks for bearing with a newbie.

0 Kudos
Message 8 of 27
(11,342 Views)

One subpanel in main will display First vi when called.  Then when Second vi is called, you have to remove First vi from subpanel and add Second vi to subpanel.  Don't put buttons in First vi to load Second vi.  Put all buttons on the main just below the subpanel.

 

Here is my example in LV8.5  Just substitute your First and Second subvi's in place of the ones I have there now.

 

- tbob

Inventor of the WORM Global
Message 9 of 27
(11,337 Views)

Thanks bob, that makes sense. So the use of Sub panels would be best for "windows" that only display?

 

Whereas if I wanted to have user input in each "window" (maybe better named a dialog?) it seems the best method is individual VIs (where once each button is connected to the VI for the subsequent window).

 

Here's a map of what I'm trying to practice implementing: http://imgur.com/uVVDB.png So, for this, would I want to use individual VIs and map each button to the correct VI?

0 Kudos
Message 10 of 27
(11,326 Views)