LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use binary flag enum on FP but allow multiple flags

Solved!
Go to solution

Hi,

 

I have some clusters that contain enums where the user can select one value among many. However, sometimes these enums stand for binary flags and I want the user to be able to select more than one flag at the same time which will then be ORd. What I normally do is have an array with the data type as the enum and I simply OR all the elements in the array.

 

I was just wondering if anyone has a better suggestion of how to do this?

 

Thanks,

M

0 Kudos
Message 1 of 2
(2,217 Views)
Solution
Accepted by topic author myle00

Use a listbox and allow multiple items to be selected.  It returns an array containg the indices of all the selected items.  You can use that to look up the values of what each element means to you from another array.  Or if the order of the items in the array is just right, you can do a 2 ^ array math function and add the resulting array together.

 

Message 2 of 2
(2,211 Views)