LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make a front panel that is "adaptive" to a choice I make on the front panel?

Hi, I wasn't sure how to phrase this, so apologies for the confusing title.

 

I have a front panel for a program where I use a bunch of drop down menus I've created to select strings representing the values for various experimental parameters. Then, I click OK, and it creates a config file with all the parameters, that I can use later.

 

Now here's the thing. One of the "parameters" is actually the type of experiment. I can do a few different experiments that all use some of the same parameters (applied bias range, for example), but some of parameters are only used by one of the experiments (laser power, for example). Likewise, there are a couple parameters where almost always, if I'm doing one experiment, it's one value, and if I'm doing the other experiment it's the other value.

 

So that's what I mean by "adaptive", I'd like it so I have the drop down menu that selects the type of experiment ("A", "B", etc). Then, let's say A is selected, only fields for the parameters that apply to A will appear on the front panel, and the "default" parameters for A will appear in the fields for parameters that are used by several experiements. If I select experiment B instead, they won't appear on the front panel.

 

Is there an easy way to do this? One nice thing I have right now is that I set the parameters, and then hit run, and it produces the config file. I suspect from the little I know about Labview that to do what I'm asking, I'll have to set the parameters while the program is running, and it will have to run in a while loop or something. Thanks!

0 Kudos
Message 1 of 5
(2,795 Views)

Visible, Disabled/Greyed Out Property Nodes sound like they'd do what you're seeking.

0 Kudos
Message 2 of 5
(2,780 Views)

the easiest way to do this is by using property nodes. I personally do not use the hide/ visible because of the look and feel of the UI. I would disable and gray out the controls as needed. See Example




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 5
(2,777 Views)

It sounds like the test parameters are already pre-defined (to an extent:  A requires XYZ, B requires XQU, and C Requires ZWV)

 

Given those options, I'd create a polymorphic dialogue.  Prompt for the specific test, then call the appropriate dialogue SubVi.  That gives you the opportunity to expand the program in the future. 

0 Kudos
Message 4 of 5
(2,771 Views)

One method which looks clean that I've used is to set the position of the controls to show up in the VI front panel or show them beyond the front panel viewed area with values from config files. Then in VI Properties\Customize Window Appearance turn off show vertical scroll bar and show horizontal scroll bar.This method can get a bit unwieldy pretty fast as the number of controls grows too high.

Another method, which I prefer, is to bring VIs into a panel control for what I need to do. Then I can have as many VIs as I like, called in by a drop down, buttons, or most any selector. This would allow for similar experiments to show/hide controls as needed with the method above without getting unwieldy. I typically use a functional global variable for passing data in/out of the called VIs.

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/loading_panel_in_subpanel/

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 5 of 5
(2,742 Views)