# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Multiple Boolean values used in case structure

Hi,

I'm trying to build a system with 100 Boolean true class button. I know it can work by building an array. But it quite hard to program when there are multiple example 100 button.

From my understanding array structure goes this way:

0 0 0

0 0 1    Button A

0 1 0    Button B

0 1 1    Button D

1 0 0    Button C

1 0 1

1 1 0

1 1 1

so, when I press Button D I need to press both Button A and button B in order for D button to be pressed.

Is there any way to program it so that I can press every single button with single function and fully utilize the empty slot of the array structure?

Message 1 of 7
(2,797 Views)

## Re: Multiple Boolean values used in case structure

I'm afraid you are going to have to explain a bit more about what you are trying to do.

First of all, what is a "100 Boolean true class) button?

Message 2 of 7
(2,768 Views)

## Re: Multiple Boolean values used in case structure

what is an "empty slot"?

Message 3 of 7
(2,752 Views)

## Re: Multiple Boolean values used in case structure

Hi,

Ok, example I want to build a tv remote control with 50 button (using Boolean true and false)

I know we can use "build array" function with case structure to build this system, but right know my problem is I need to add more than 100 array input in order to include all the 50 button.

Example:

0 0 0 0 empty slot

0 0 0 1 input 1

0 0 1 0 input 2

0 0 1 1 empty slot

0 1 0 0 input 3

0 1 0 1 empty slot

....

1 0 0 0 0 input 4

....

1 0 0 0 0 0 input 5

....

The empty slot is not use is bcos I don't want to press 2 button at the same time to perform particular function

Hope you can understand my problem. 😄

Thank you.

Message 4 of 7
(2,749 Views)

## Re: Multiple Boolean values used in case structure

Hope its better to provide info on the kind of application/the scope of your work, LabVIEW'ers can give you an different way to approach the problem, than using too many buttons.

----------------------------------------------------------------------------------------------------------------
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 5 of 7
(2,745 Views)
Solution
Accepted by topic author GavinT

## Re: Multiple Boolean values used in case structure

You can use a 2D array of buttons (or put all booleans into a cluster container, then use cluster to array for further processing). Assuming only one button can be pressed at any given time, use "search array" to find the index of the value that is true.

It would really help if you could attach a draft of your code. Why do you need a case structure often not even needed)? What is the mechanical action of the buttons?

Message 6 of 7
(2,742 Views)

## Re: Multiple Boolean values used in case structure

Thank you for the solution and guidance.

I just add another "search array" and my problem solve 😄

Message 7 of 7
(2,725 Views)