LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore Multiple Button Clicks

Solved!
Go to solution

My front panel consists of a "Latch when released" button and a numeric indicator.  The [0] "Boolean" Value Change is the only event in the structure.

 

If I click the button twice quickly (within 500ms), a second "Value Change" event queues and executes after the first.  

 

How can I ignore "Value Change" events that occur while executing other events?

 

simple loop.GIF

0 Kudos
Message 1 of 7
(5,823 Views)

You could try and disabling the control in the event and reenabling it when you are ready to get the next one.

 

Mind you if the event isn't picked up right away, two clicks could still be registered.  To avoid that, you can put in the event case immediately after disabling the control, a loop with an event structure in it that waits on that event and has a timeout of 0.  If it goes thought the timeout, there is no button press so exit the loop.

 

Hope this helps.

 

 

A

0 Kudos
Message 2 of 7
(5,803 Views)

You could use the Mouse Down? event and check for a double-click.

 

Example_VI_BD.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

0 Kudos
Message 3 of 7
(5,787 Views)
Solution
Accepted by topic author CodeSDz

Another option that also adds some UI feedback is to set the Busy Cursor. This prevents clicks, and alerts user that the program is cranking:

 

SetCursorBusy.png

Message 4 of 7
(5,786 Views)

@jcarmody wrote:

You could use the Mouse Down? event and check for a double-click.


Double-click method may or may not be reliable since DC settings are user-specific and typically less than 500msec. Also, I'm guessing the 500msec generally refers to "something that takes a while to crunch", so that threshold is possibly a moving target.

0 Kudos
Message 5 of 7
(5,781 Views)

A co-worker had a similar problem in a specific project where users were complaining that some screens were not appearing.

 

Some psychic debugging eventually revealed the problem - the users were double clicking the OK button, and the next time the dialog was called, it dutifully executed the second value change event which occured the last time that the dialog was open.

 

I don't remember what the solution we did there was (either educating the users, or a specific solution for those dialogs), but it makes me think that maybe there should be an idea on the idea exchange for a way to globally disable this. I don't have any suitable mechanism, so I have nothing to post yet.


___________________
Try to take over the world!
0 Kudos
Message 6 of 7
(5,725 Views)

Hi, This VI was created some time back (in LV7.1) in answering to a question raised in the Chinese Language forum. And, I thought it may be useful to prevent a double click by setting a minimum time a button must be clicked and hold to constitute a valid click. (Though the question of how fast a double-click may varies)

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 7 of 7
(5,689 Views)