キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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?

0 件の賞賛
メッセージ1/7
4,467件の閲覧回数

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 件の賞賛
メッセージ2/7
4,438件の閲覧回数

what is an "empty slot"?

0 件の賞賛
メッセージ3/7
4,422件の閲覧回数

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 件の賞賛
メッセージ4/7
4,419件の閲覧回数

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 件の賞賛
メッセージ5/7
4,415件の閲覧回数
解決策
受理者 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?

メッセージ6/7
4,412件の閲覧回数

Thank you for the solution and guidance.

 

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

 

0 件の賞賛
メッセージ7/7
4,395件の閲覧回数