LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I select a control based on another control's selection and how do I remove enumerations from a control?

Hi everyone,
 
I have a question and I *think* the answer may be the new active controls, so here goes:  I have a control which contains a variety of enumerated items - essentially a typedef enum.  I may have up to several dozen items in this control, like this:
 
Position - 1
Current - 2
Pressure - 3
Temperature - 4
Duty Cycle - 5, etc.
 
I also have a 2nd control (actually a set of controls) that refer to the indices of the above control.  For example, if I "Position" chosen, I wish the 2nd control to appear that refers to position - an enumeration with "X axis, Y axis, etc."  If I select "Temperature", I wish the 2nd control to appear that refers to temperature - a different typedef'd enum - "Inlet, Outlet, Air, Water, etc."
How do I do this?
 
Lastly, the first enum with ALL of the items, pressure, current, etc. does not need to be used.  For certain configurations, I wish to eliminate, say the 1st and 3rd item - I don't wish to just gray them out, I wish to remove them from the enumeration, WITHOUT changing their enumerated value.  Perhaps I need to write the resultant enum into a temporary ring enum - any ideas?
 
Thanks,
 
Jason
0 Kudos
Message 1 of 3
(2,525 Views)

Unfortunately, you cannot edit the list of enums during runtime, only during edit mode.  You can use a ring control however.  Then you can use the Strings[] property to set the selections to whatever you want depending upon the 1st enum.  See attached vi.

 

- tbob

Inventor of the WORM Global
Message 2 of 3
(2,517 Views)
Hey thanks, that's great!  This solves the first problem too.
 
Jason
 
 
0 Kudos
Message 3 of 3
(2,507 Views)