LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple interfaces (multiple windows, not sure how to word this)

Solved!
Go to solution

I am trying to program a VI where it'll be able to switch the interface based on what the user selects from a dropdown menu (eg, it'll be all ready to measure voltage, everything saying voltage, then I pull the dropdown and select current, and everything changes to current, along with graphs disappearing and appearing as necessary for the different interface). 

 

I know this is probably simple, but I'm new.

 

Thank you.

0 Kudos
Message 1 of 12
(3,729 Views)

Maybe you should use subvi's and a subpanel on your main vi.  Create subvi's for your voltage functions and current functions, etc.  In the main you will have a subpanel.  Have an event structure.  When the user selects a certain menu item, an event fires.  Inside the event case, call the appropriate subvi dependent upon the selection and open it in the subpanel.

 

If all the subvi's would look the same, and you would only want name changes, that is a different story.  Please be more specific if the above scenario is not correct.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 12
(3,724 Views)
Two possible solutions are the tab control and the subpanel control.

"bobholmgren" <x@no.email> wrote in message
news:1277853006895-1164849@exchange.ni.com...
>I am trying to program a VI where it'll be able to switch the interface
>based on what the user selects from a dropdown menu (eg, it'll be all ready
>to measure voltage, everything saying voltage, then I pull the dropdown and
>select current, and everything changes to current, along with graphs
>disappearing and appearing as necessary for the different interface).&nbsp;
> &nbsp;
> I know this is probably simple, but I'm new.
> &nbsp;
> Thank you.


0 Kudos
Message 3 of 12
(3,720 Views)

 


@tbob wrote:

Maybe you should use subvi's and a subpanel on your main vi.  Create subvi's for your voltage functions and current functions, etc.  In the main you will have a subpanel.  Have an event structure.  When the user selects a certain menu item, an event fires.  Inside the event case, call the appropriate subvi dependent upon the selection and open it in the subpanel.

 

If all the subvi's would look the same, and you would only want name changes, that is a different story.  Please be more specific if the above scenario is not correct.

 


 

It would require brand new wiring and new options, along with name changes. 

How do I create subpanels?

0 Kudos
Message 4 of 12
(3,717 Views)

@bobholmgren wrote:

 

How do I create subpanels?


On the front panel, select SubPanel from the Containers palette.  Resize the subpanel to fit your largest vi front panel.  On the block diagram create code as shown below.  This is a simple example.  You have to create code to have the user select a vi.  When switching vi's, you have to remove the old vi from the subpanel before inserting a new one.  If you click on the Insert VI method, you will see a selection called Remove VI.

 

17781i1D6FF521AA8396F5

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 12
(3,687 Views)

 


@tbob wrote:

@bobholmgren wrote:

 

How do I create subpanels?


On the front panel, select SubPanel from the Containers palette.  Resize the subpanel to fit your largest vi front panel.  On the block diagram create code as shown below.  This is a simple example.  You have to create code to have the user select a vi.  When switching vi's, you have to remove the old vi from the subpanel before inserting a new one.  If you click on the Insert VI method, you will see a selection called Remove VI.

 

17781i1D6FF521AA8396F5


 

Thanks, I'm working on wiring this up. 

It seems weird to me that labview doesn't support a simplified method of this.

0 Kudos
Message 6 of 12
(3,676 Views)
Solution
Accepted by topic author bobholmgren

@bobholmgren wrote:

 

It seems weird to me that labview doesn't support a simplified method of this.


Looks pretty simplified to me.  Open Reference, Insert into SubPanel, Run VI.  You can select whatever vi, insert into or remove from subpanel.  The only thing that could be simpler would be to automatically run the subvi once it is inserted into the subpanel.  So you would save one step.  But that step allows you to define Wait until Done and Auto Dispose Reference.  I like it the way it is.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 12
(3,660 Views)

 


@tbob wrote:

@bobholmgren wrote:

 

It seems weird to me that labview doesn't support a simplified method of this.


Looks pretty simplified to me.  Open Reference, Insert into SubPanel, Run VI.  You can select whatever vi, insert into or remove from subpanel.  The only thing that could be simpler would be to automatically run the subvi once it is inserted into the subpanel.  So you would save one step.  But that step allows you to define Wait until Done and Auto Dispose Reference.  I like it the way it is.

 


 

Simplified to me would have a tab that selects which VI you want

0 Kudos
Message 8 of 12
(3,653 Views)

@bobholmgren wrote:

 

Simplified to me would have a tab that selects which VI you want


Wow, I've found someone more lazy than me.  Smiley Very Happy

If you had to select the vi during development with a tab, how would you select it programatically by a user selection?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 12
(3,644 Views)

 


@tbob wrote:

@bobholmgren wrote:

 

Simplified to me would have a tab that selects which VI you want


Wow, I've found someone more lazy than me.  Smiley Very Happy

If you had to select the vi during development with a tab, how would you select it programatically by a user selection?

 


Haha, yeah. 

 

Hmm, I found the tab control stuff, but you're right, there's no way for it to work well developmentally, it doesn't show up at all in the block diagram, aside from a "tab control" reference that does nothing.

 

Oh well, I'm going to do it the way you suggested in the first place, seems to work alright.

Thank you

 

0 Kudos
Message 10 of 12
(3,603 Views)