LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make one listbox's choices be dependent on another listbox selection?

I want one listbox that allows user to choose 1 of 3 units. Depending on which unit is selected, a 2nd listbox will display/provide user inputs for tests that are valid for that type unit selected. I am totally new to Labview and am struggling greatly. Any help appreciated!
0 Kudos
Message 1 of 5
(2,710 Views)
Paul,

wire the numerical value of the first listbox to a case statement. Inside the case you can build an array of strings that correspond to the values you want to display in the 2nd list box. then create a property node for the 2nd list box and select the 'item names' property - this is an array of strings which will be the names that appear in the listbox. wire the array from the listbox to this property. hope this helps.

pat
Message 2 of 5
(2,710 Views)
Having some trouble here... I did per your suggestion the build array and the case statement. However, when I try to wire the output of the case into the ItemNames property box, Labview will not show a complete connection--but rather broken wires. How do I get the ItemNames to accept the array output? Thanks, Paul
0 Kudos
Message 3 of 5
(2,710 Views)
It'll work a lot better if the property node is set to write instead of read. Right click the property node to change it.
0 Kudos
Message 4 of 5
(2,710 Views)
Paul;

I've attached a simple example VI performing what you need.
I hope that helps.
Regards.
Filipe Altoe
Application Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,710 Views)