LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down menu that can contain identical values

Is there a drop down menu that allows identical values of it's members?

 

With Enum you can't change assigned value, Ring and Combo box don't allow identical values.

 

Example:

AeroSoul_0-1660891650701.png

(The values in example are a flash page size in bytes, which can be the same between microprocessors)

 

From datasheet for ATmega324A:

AeroSoul_1-1660891780061.png

 

0 Kudos
Message 1 of 3
(685 Views)

You could multiply your needed values by ten and increment then identical values.So you would have the values 1280 and 1281.

While reading the selected value use "Quotient & Remainder" with a dividing value of ten again.

Greets, Dave
Message 2 of 3
(669 Views)

Personally, I wouldn't try and encode that data into one element (e.g. store the text and page size in the enum).

 

Instead I would create an enum (Always make it a type def as well!!) containing all of your elements, and then store all of your page sizes in an array which you can index using that enum.

 

If you need this information in multiple places put this code in a subVI which accepts the enum and returns the page size.

 

Instead of an array you could use a map which would be a little more robust if you ever add elements to your enum, but it requires 2019 or later (maybe 2018) and takes up more BD space

Message 3 of 3
(649 Views)