LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search Cluster of Booleans for only True element

Solved!
Go to solution

Running Labview 2016

 

I have a cluster of just boolean values that correspond to points on a coordinate grid.  The button labels on the front panel correspond to the button's location on the grid so that there is some awareness of the button's location in space.  I did not use a 2D array because I couldn't find a way to make the major and minor components of an array different sizes on the front panel to be distinguished to the operator.

 

I am looking for a way to extract the button that was changed to true in the cluster (since the buttons are set to latch, this should only be one at a time).  From there, I will extract the label of that button to pass into numeric fields denoting the x and y values of the button pressed, which I have the structure set up for in the VI.  All I need is the ability to extract the reference of the button that changed to true in the cluster and I think I've got it from there.

0 Kudos
Message 1 of 4
(2,343 Views)
Solution
Accepted by topic author ryancam

Just compare the new value with the old value to find the button that is different.  Search the array to get the index and find the label.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 2 of 4
(2,304 Views)

Just to clarify, you can compare a cluster to another cluster directly!  What you get is a cluster of Boolean values structured the same way the original clusters were.  Each Boolean represents whether a value has changed or not.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 4
(2,301 Views)

That is exactly what I needed.  Thank you!

0 Kudos
Message 4 of 4
(2,297 Views)