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.
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.
12-21-2023 03:59 PM
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
Solved! Go to Solution.
12-21-2023 04:42 PM
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:
(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.
12-21-2023 10:59 PM
@_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:
12-22-2023 03:03 AM
Thank you both for the reply. I think this has given me some ideas to implement a solution.
Regards