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: 

compare two arrays and output a true

I have a pair of arrays; one is an inventory subset of elements; the other is an array of all the elements in the periodic table.  I want to compare the two arrays and enable only those boolean controls for the elements listed in the inventory sub array. 

 

I've created code that creates the inventory sub array (3).  Initially, I had set it up to enable all (2) of the elements in the periodic table cluster (1), but now I want to replace that code with the scenario above, only enabling those elements which appear on our inventory sub array.  A colleague suggested the solution in (4), which I've modified to (5).  I just can't figure out how to create the array of true false values from the sub array to enable those elements in the larger array.

0 Kudos
Message 1 of 2
(2,888 Views)

I think I understand.

 

BD.jpg FP.jpg

 

The 1st For Loop returns an array of matching indices, the second builds your Boolean array.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 2
(2,871 Views)