LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Boolean values used in case structure

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(2,971 Views)

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?

0 Kudos
Message 2 of 7
(2,942 Views)

what is an "empty slot"?

0 Kudos
Message 3 of 7
(2,926 Views)

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.

 

 

 

 

 

0 Kudos
Message 4 of 7
(2,923 Views)

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.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
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.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 7
(2,919 Views)
Solution
Accepted by GavinT

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,916 Views)

Thank you for the solution and guidance.

 

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

 

0 Kudos
Message 7 of 7
(2,899 Views)