From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Mechanical Action of an array of buttons

I have an array of buttons that get dynamically built when the front panel is loaded. When I select one of the buttons it remains "pressed in". If I right click on the button the "Mechanical Action" is greyed out. I pulled the button out of the array and checked the settings and its set to latch when released, its just not happening. Is their any way to set this property?
0 Kudos
Message 1 of 13
(6,668 Views)
Inside an array a button will work just for setting the value true or false. Imagine that using a mechanical action for it will be more than confusing if you want to use some values in that array (everything will depend on the delay time between pressing the button and reading the value and you can not be sure that this will be constant).
0 Kudos
Message 2 of 13
(6,668 Views)
Latching mechanical action is not compatible with local variables or reading the value property of Boolean Controls. Anyway, the following example will do what you are trying to accomplish.

-jim
Message 3 of 13
(6,668 Views)
I have been using an Exclusive-0r Array VI to return the Index number selected and reset the array to its original state (see attached LV 6). It acts like a latch-when-released action - and is just 1 of a few ways to do what your asking.
Good luck with it, Doug
0 Kudos
Message 4 of 13
(6,668 Views)
Doug,

Please email me at jkring@calbay.com . I have a question for you that I would like to take offline.

-Jim Kring
0 Kudos
Message 5 of 13
(6,668 Views)

Hi Rob,

 

 

enclosed you will find two other solutions, simulating a radio button array based on a standard button array,

this solution use a event loop.

 

 

Version 1: Simulates Radio Buttons without "Allow False" Option

Version 2: Simulates Radio Buttons with "Allow False" Option

Download All
Message 6 of 13
(6,088 Views)

nightwalker wrote:

enclosed you will find two other solutions,


Did you notice that you replied to a thread that is eight years old?

 

Anyway, you are using LabVIEW 8.6, so none of this is necessary. Simply use the radio button control. No code needed.

 

There is also a mistake in your example 1: If no selection exists, the index should indicate -1 for consistency. Also, instead of Xor, I would use " not equal". Functions the same, but is less nerdy and more obvious. 😉

0 Kudos
Message 7 of 13
(6,079 Views)

I just want to thank nightwalker's example because it's exactly what I needed - specifically version 2 which allows to clear the selection. Let this be a lesson to everyone that in the internet, if you come across a very old thread and have something to add, it is a good idea to post and bump the thread, and you shouldn't be telling people off when they do that. (I'm looking at you altenbach!)

 

This post that I'm making right now, on the other hand, is completely pointless and you should be telling me off. Oops.

0 Kudos
Message 8 of 13
(4,212 Views)

An update to a thread once every 7-8 years is just proof that LabVIEW is here to stay!


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 9 of 13
(4,196 Views)

I'll be ready. 😄

 

task.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 10 of 13
(4,186 Views)