ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
11-17-2009 05:11 PM
I am catching on mouse up events for a button and the button is sometimes staying down after being pressed.
I have the button itself inside the event handler- I thought putting it there sovled this problem.
Is there something else I am missing?
The button is set to latch when released.
Thanks!
11-17-2009 05:18 PM
11-17-2009 05:29 PM
I haven't tried value change yet. Using LabVIEW version 7.1. I haven't quite stripped everything out of the VI but if there's nothing common that I'm missing that will be my next step.
As far as sometimes, I haven't found anything specific its related to. It happens maybe 5% of the time tops. The event still fires properly and when I click the button again, while it is in the down state, the event fires properly again.
Dave
11-17-2009 05:43 PM
11-18-2009 12:52 AM
A boolean latch action completes its action only when node is executed (or data is read from the boolean) When a mouse up event or any other event triggers except for the value change, you are trying to trigger event on a front panel object but you are not actually reading the data. No matter the boolean button is spaced inside or outside the event.
To get the latch action properly, add a value change event and place the boolean control inside this event. Do nothing in this event if it is not required. Let me know if it works properly.
11-18-2009 07:56 AM
Thanks Vsh. The value change is working.
Why isn't the data read if the button is placed inside the loop?
11-19-2009 02:42 AM
Data is indeed read, but if you notice, you'll see the last selected data. If you have set to true, data in mouse up event case reads false (When the control is inside the mouse up event case)
When you trigger an event on a Boolean control configured with a latching mechanical action, the Boolean control does not reset to its default value until the block diagram reads the terminal on the Boolean control. You must read the terminal inside the event case for the mechanical action to work correctly. As a reminder, a note appears in the Edit Events dialog box when you configure a vale change event on a latched Boolean control.