LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display a Limited Enum?

Is it possible to have a type def enum on the Front Panel that only shows a couple of options instead of the entire enum?  The work around is of course to have a limited FP enum then choose the appropriate option from the type def enum in a case statement.  But curious if we can just do this in the properties of the control so that this little work around isn't required.

 

Example: DMM comes with many options, but you only wish to allow the user in your specific app to use RES and VOLT.  It's an object situation.

0 Kudos
Message 1 of 3
(703 Views)

You can set the Disabled Items []  property:

 

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/properties-and-methods/vi-server/generic/g...

 

All of the selections will be shown, but only the non-disabled ones can be selected by the user, the rest will be greyed out.

Message 2 of 3
(696 Views)

Instead of showing the enum, I would suggest showing a ring control and populating it dynamically. This will look better and will be easier for the user.

 

To do this, you can have an array of the allowed enum values, iterate over it and use Format Into String and the enum value to set the strings and values for the ring and after reading from the ring use Variant to Data to convert its value back to the enum. Or just set the strings and use the value of the ring with Index Array to get the value of the enum from the original array.


___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(631 Views)