11-05-2010 08:22 AM
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?
Solved! Go to Solution.
11-05-2010 09:42 AM
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
11-05-2010 10:45 AM
11-05-2010 10:46 AM
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:
11-05-2010 10:49 AM
@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.
11-06-2010 11:02 AM
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.
11-08-2010 01:10 AM - edited 11-08-2010 01:11 AM
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)