LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count Boolean Buttons in Cluster to Array

Solved!
Go to solution

I am trying to figure out how to have an array output showing which button is pressed depending on what buttons are pushed in a cluster of boolean buttons.  

 

Basically if the first button is pressed, then the output array would have a value of 1.  If the first button is pressed and the 9th and 10th button is pressed, then the output array would be 1, 9, and 10...so on an so forth.

 

 

 

I attached my .VI with the cluster of buttons that output into an array that shows the boolean value (1 or 0)....but this isn't quite what I am wanting to do.

 

Any suggestions would be appreciated.

0 Kudos
Message 1 of 7
(3,706 Views)

Autoindex through your boolean array. When true append index to output array.

 

Lynn

0 Kudos
Message 2 of 7
(3,704 Views)
Solution
Accepted by topic author MCHammer

Something like this?

 

 

 

Message 3 of 7
(3,699 Views)

Stupid question...what is the item I circled in red?  I looked through the menus and could not recreate it.  

0 Kudos
Message 4 of 7
(3,687 Views)

It is an empty array of I32 integers, or in other words an array constant.

 

The following link tells you how to make one.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/creating_array_constants/

 

Cheers

0 Kudos
Message 5 of 7
(3,678 Views)

Thanks guys.  That's exactly what I was looking for.

0 Kudos
Message 6 of 7
(3,674 Views)

@mcduff wrote:

The following link tells you how to make one.


Or, after wiring up the inside of the loop, simply right-click the left shift register and select "create constant". 😄

0 Kudos
Message 7 of 7
(3,664 Views)