From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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

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

 

Lynn

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

Something like this?

 

 

 

Message 3 of 7
(3,051 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,039 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,030 Views)

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

0 Kudos
Message 6 of 7
(3,026 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,016 Views)