LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

button does not pop back.

Hi,
I trigger  a dialog on mouse down event on one button which is located on my GUI. But  after the user finished the dialog the button that invoked the dialog does not pop back. Is the button supposed to pop back automatically or am I supposed to programatically pop it back?
Thanks.


0 Kudos
Message 1 of 14
(4,263 Views)
What is the "mechanical action" setting?
 
(Latch action booleans will reset once they are read by the code, so make sure they are inside the releveant loop or event case. Why don't you use "value change" instead of "mouse down"?)
 
Message 2 of 14
(4,254 Views)
Hmm,
I just checked the button and it says  "Latch when pressed". Will changing event to "Value change" help me?
0 Kudos
Message 3 of 14
(4,250 Views)


RSibagatullin wrote:
Hmm,
I just checked the button and it says  "Latch when pressed". Will changing event to "Value change" help me?

No, this will not help. In order for a latch action boolean to revert, it needs to be read by the code, i.e. be in the dataflow. If the terminal of the boolean is somewhere random on the diagram there is no garantee that it will get read after a press (e.g. If the terminal is outside the main while loop, it will be in the dataflow exactly once at the start of the program and then never again).
 
Why don't you attach a simplified version of your program so we can see where the problem is. 
Message 4 of 14
(4,227 Views)
Is the block diagram terminal for the button located in the event frame so
that it is read after being pressed?


0 Kudos
Message 5 of 14
(4,218 Views)

It does sound like the button does not get processed...  Can you post your code?

 

R

Message 6 of 14
(4,199 Views)

Hi RSibagatu,

 

This article (Using Events with Latched Boolean Controls) explains the caveats about using Boolean controls with Event Structures.

 

(It sounds like you might need to put your control inside the event case.)

 

Best of luck,

Kevin S.

Applications Engineer

National Instruments

Message Edited by Kevin_S on 08-13-2008 11:38 AM
0 Kudos
Message 7 of 14
(4,176 Views)

For the frequent flyers here on the Forum....

 

I have personally wittnessed a sticking boolean* both in LV 8.2 and LV 8.5. 8.5 seems much better but I have still seen them stick in LV 8.5.

 

Ben

 

 * Its a real pain when you press the emergency stop button, it sticks and your customer is standing there giving you a puzled look. The good news was there was a complete mechanical back-up safety system implemented "just in case".

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 14
(4,173 Views)

Just for completness, I am wondering about "mouse down" and "value changed" in this context.

 

Is there protection in the code or could there possibly be a race condition? I assume that "mouse down" occurs before "value change", so it is conceivable that a mouse down event could leave the boolean unread for the current event. I have not done any tests, just curious. 🙂

0 Kudos
Message 9 of 14
(4,166 Views)

Hi,

I have attahched the code of the  event trigger. The button by itself is outside the while loop.

Thanks. 

0 Kudos
Message 10 of 14
(4,150 Views)