LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mechanical Action of an array of buttons


@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)

Download All
0 Kudos
Message 11 of 13
(920 Views)

Spoiler

@jcarmody wrote:

I'll be ready. 😄

 

task.png


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

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 13
(903 Views)
Spoiler

@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:

labviewClusterMechanicalActions.png

 

Arrays of Booleans have no mechanical actions option:

labviewArrayNoMechanicalAction.png

 

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:

labviewArrayMechanicalActions.png

Message 13 of 13
(884 Views)