From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, 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: 

Cluster of a cluster of booleans.

Solved!
Go to solution

Hi All,

 

I am running into an issue which seems simple enough until I am trying to implement a solution for it.

 

I have a 16 port device which require a 16 button front panel control and 16 status LEDs.

 

The command is sent to the device for each button click and based of whether output is switched on or off, it should turn the status LED on. Upon pressing the button again in should be able to turn the LED off. A message is also sent at actor initialization to request the status and turn button + LEDs to true or false.

 

Now the problem is that I tried to create an array of two boolean cluster but in LABVIEW they cant have unique names, so i resorted to having a cluster of two booleans and a cluster with 16 buttons and 16 LEDs.

 

Without creating 16 events is there a way to know the status of boolean state in a cluster from value change or another method? Also, which button was clicked in a cluster even to get the appropriate index or TAB index?

 

The problem seems to be simple but for some reason I cant find an elegant solution to this. Please see front panel control below. Many Thanks

 

Screenshot 2023-12-21 215020.png

0 Kudos
Message 1 of 4
(741 Views)

When I do this, I just compare OldVal and NewVal in the event case to see what happened. I always wrap it up in a subVI because the logic gets somewhat complicated when you have several buttons, but basically something like this:

 

Example_VI.png

 

(Note that for this case, you need to write the old value back to the button or else it'll stay "stuck" in that position. This is because you're rewriting the entire cluster, not just the button value, so the mechanical latch action doesn't work.)

 

You could mod this to add a Conditional Terminal so it stops when it sees one button pressed but this was just a simple example.

Message 2 of 4
(720 Views)
Solution
Accepted by _T_M_

@_T_M_ wrote:

Now the problem is that I tried to create an array of two boolean cluster but in LABVIEW they cant have unique names, so i resorted to having a cluster of two booleans and a cluster with 16 buttons and 16 LEDs.


Of course you can have an array of clusters where the cluster has 3 elements, one a string for the "name".

 

Make sure to disable the element that act as indicators so they cannot be operated at runtime.

 

Here's one possibility:

altenbach_0-1703220974482.png

 

Message 3 of 4
(681 Views)

Thank you both for the reply. I think this has given me some ideas to implement a solution.

 

Regards

0 Kudos
Message 4 of 4
(660 Views)