04-26-2016 12:01 PM - edited 04-26-2016 12:26 PM
@NeatNit wrote:I just want to thank nightwalker's example because it's exactly what I needed - specifically version 2 which allows to clear the selection.
If you use a radiobutton control, you can configure it to "allow no selection" (right-click...), which is exactly "version 2". No need for all that code!
...and it works if the VI is not even running, i.e. in edit mode. 😄
Less code complexity means fewer places for bugs to hide and simplified code maintenance. Just compare the two diagrams!
Version 2 is also a bit faulty. For example, if you change more than one boolean in edit mode to TRUE and run the VI. It is in an illegal state. If you now click one of the TRUE buttons, that button will not turn off as it should. A radiobutton control cannot be in an illegal state, even in edit mode.
(And yes, in ancient times (before radio button controls and event structures!), I did make my own. At this point in time it is just what a pianist would call Fingerübungen. Good for honing (coding) skills, but not for public consumption. :D)
04-26-2016 12:27 PM
@jcarmody wrote:I'll be ready. 😄
Unless NI gives me a license to LV, I will be retired, tending to my gardens and wondering if I can still remember how to spell LabVIEW.
Ben
04-26-2016 04:07 PM
@altenbach wrote:
@NeatNit wrote:I just want to thank nightwalker's example because it's exactly what I needed - specifically version 2 which allows to clear the selection.
If you use a radiobutton control, you can configure it to "allow no selection" (right-click...), which is exactly "version 2". No need for all that code!
...and it works if the VI is not even running, i.e. in edit mode. 😄
Less code complexity means fewer places for bugs to hide and simplified code maintenance. Just compare the two diagrams!
Version 2 is also a bit faulty. For example, if you change more than one boolean in edit mode to TRUE and run the VI. It is in an illegal state. If you now click one of the TRUE buttons, that button will not turn off as it should. A radiobutton control cannot be in an illegal state, even in edit mode.
(And yes, in ancient times (before radio button controls and event structures!), I did make my own. At this point in time it is just what a pianist would call Fingerübungen. Good for honing (coding) skills, but not for public consumption. :D)
Thanks, but in this case I really do need to use an array. The number of elements changes constantly, in sync with a different array. I have it working nicely now.
Sort-of on the topic of mechanical actions of boolean arrays, I'm completely baffled at the design choices. Radio Buttons has the following options:
Arrays of Booleans have no mechanical actions option:
And as we all know, Boolean controls inside Boolean arrays have the Mechanical Action option greyed out.
HOWEVER!!
If you take the control out of the array, change its mechanical action, and put it back in - it WILL change the mechanical action! Even Switch Until Release works! Latching won't work though - if you pick one of the latching actions it will be mapper to either Switch When Pressed or Switch When Released.
This is SUPER useful and I can't fathom why NI didn't allow you to change the mechanical action between the Switch ones without having to drag the control out and back in.
Front panel of the example VI attached: