‎06-29-2010 06:08 PM
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.
Solved! Go to Solution.
‎06-29-2010 06:24 PM
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.
‎06-29-2010 06:40 PM
‎06-29-2010 06:49 PM
@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?
‎06-30-2010 11:06 AM
@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.
‎06-30-2010 01:01 PM
@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.
Thanks, I'm working on wiring this up.
It seems weird to me that labview doesn't support a simplified method of this.
‎06-30-2010 02:57 PM
@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.
‎06-30-2010 03:21 PM
@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
‎06-30-2010 03:58 PM
@bobholmgren wrote:
Simplified to me would have a tab that selects which VI you want
Wow, I've found someone more lazy than me.
If you had to select the vi during development with a tab, how would you select it programatically by a user selection?
‎07-01-2010 11:35 AM
@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.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