LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster of boolean controls does not update in the expected way

Solved!
Go to solution

Hello,

I am confused about the following issue: In the attached Test Cluster of Boolean Controls Functionality.vi, I have a cluster of bolean controls, some disabled and grayed out, some enabled. If I click on one of the two enabled boolean controls, and then on the other, I want the boolean control selected first to reset to False. The indicator Update Cluster shows the desired behavior. What confuses me, is that the New Value does not update accordingly. Once I have clicked on both booleans at least once, the New Value stays [TRUE,TRUE] at all times, and the event structure no longer executes.

 

I already have a workaround, as shown in the Test Cluster of Boolean Controls Functionality Workaround.vi, but this does not look "nice", as it is more complicated than necessary. Does anybody know why the New Value does not update as expected? Please advise. Thank you.

Best regards,

Peter

0 Kudos
Message 1 of 9
(4,430 Views)

Seems very convoluted! Are you trying to do a "radiobutton" style control where only zero or one can be true at any given time? There are much easier ways!

 

0 Kudos
Message 2 of 9
(4,421 Views)
Solution
Accepted by topic author pbuerki

Here is a simple solution.

 

Of course you could use a radiobutton container instead of a cluster for even simpler code. Try it!

 

 

Message 3 of 9
(4,412 Views)

Thank you for your reply. Your proposed solution is elegant and works. (In my application I actually need to retrieve the label text of the control being selected.) It is still counterintuitive to me, though, why in my example the Cluster of Boolean Controls is not updated.

0 Kudos
Message 4 of 9
(4,395 Views)

It does update. After you click the new boolean, the old one is still true (in addition to the new one!) and that's the "new value" from the event terminal that you are reading. If you want the "new value" to reflect the updated cluster, connect it in parallel to the "updated cluster" control.

0 Kudos
Message 5 of 9
(4,379 Views)

Thank you for your reply. And sorry for not expressing myself clearly. I realize that the New Value indicator caused some confusion.

 

What I meant is why the NewVal terminal of the event structure does not update to the value shown in the updated cluster, after the value has been written to the local variable "Cluster of Boolean Controls". I would expect that when the event executes the next time, it will show the updated value in the NewVal terminal.

0 Kudos
Message 6 of 9
(4,334 Views)
Solution
Accepted by topic author pbuerki

pbuerki wrote:

What I meant is why the NewVal terminal of the event structure does not update to the value shown in the updated cluster, after the value has been written to the local variable "Cluster of Boolean Controls". I would expect that when the event executes the next time, it will show the updated value in the NewVal terminal.


Because when the event fires again, another button has obviously been pressed so...

  1. if a different button (a grey one) has just been pressed, the previous and new boolean are true in the "new value".
  2. if the same button (a green one) has just been pressed, it will be false in the "new value".
Message 7 of 9
(4,320 Views)

Thank you so much for your time.

Peter

0 Kudos
Message 8 of 9
(4,308 Views)

@pbuerki wrote:

(In my application I actually need to retrieve the label text of the control being selected.)


Here's one way to get the label with little additional code.

 

 

0 Kudos
Message 9 of 9
(4,287 Views)