LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Led lights up if array clicked on.

Solved!
Go to solution
Highlighted

The code can determine what array index is being clicked on.

How can I make the Led to also light up, and all other leds go out?

 

0 Kudos
Message 1 of 4
(527 Views)
Solution
Accepted by topic author RickDTS

I'd recommend switching to a shift register instead of a local variable, but you don't absolutely have to.

 

Use a FOR loop and a Bundle by Name terminal:

 

Forum post.png

0 Kudos
Message 2 of 4
(518 Views)

That is exactly what I wanted it to do.

Thanks for the help.

0 Kudos
Message 3 of 4
(513 Views)

In addition, you should really get rid of that "swarm" of local variables. All data should be carried in a shift register. I assume the array of clusters is also a control, so its terminal would belong in a value change event for it. If several events modify the data, you can write to a single local variable e.g. as follows.

 

SetOneBoolean.png

 

Of course if only one (or none) boolean can be on at any give time and the array is large, it might be more efficient to remember the previous boolean (in a shift register). Now you only need to write two instead of all (unset old, set new).


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 4 of 4
(484 Views)