Discussion:
button does not pop back.
(too old to reply)
RSibagatullin
2008-08-12 20:40:22 UTC
Permalink
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.
altenbach
2008-08-12 21:10:05 UTC
Permalink
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"?)
 
RSibagatullin
2008-08-12 21:10:06 UTC
Permalink
Hmm, I just checked the button and it says  "Latch when pressed". Will changing event to "Value change" help me?
altenbach
2008-08-12 22:40:18 UTC
Permalink
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. 
Kevin_S
2008-08-13 16:40:08 UTC
Permalink
Hi RSibagatu,&nbsp;This article (<a href="http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/latchbooleanevent/" target="_blank">Using Events with Latched Boolean Controls</a>) explains the caveats about using Boolean controls with Event Structures. &nbsp;(It sounds like you might need to put your control inside the event case.)&nbsp;Best of luck,Kevin S.Applications EngineerNational InstrumentsMessage Edited by Kevin_S on 08-13-2008 11:38 AM
Ben
2008-08-13 17:10:05 UTC
Permalink
For the frequent flyers here on the Forum....&nbsp;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.&nbsp;Ben&nbsp;&nbsp;* 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 &quot;just in case&quot;.
altenbach
2008-08-13 17:10:09 UTC
Permalink
Just for completness, I am wondering about &quot;mouse down&quot; and &quot;value changed&quot; in this context.&nbsp;Is there protection in the code or could there possibly be a race condition? I assume that &quot;mouse down&quot; occurs before &quot;value change&quot;, 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. :)
RSibagatullin
2008-08-13 18:40:05 UTC
Permalink
Hi,I have attahched the code of the&nbsp; event trigger. The button by itself is outside the while loop. Thanks.&nbsp;


flag.jpg:
Loading Image...
altenbach
2008-08-13 18:40:05 UTC
Permalink
RSibagatullin wrote: I have attahched the code of the&nbsp; event trigger. The button by itself is outside the while loop.
No, you only attached an image, which only&nbsp;shows 20% of the story. Is there a reason the terminal is not INSIDE this event case? That would fix your problem as already mentioned many times above.&nbsp;(A real VI is preferred as attachment. I cannot &quot;run&quot; an image, I cannot look at other cases, I cannot look at the event configuration, etc.)
RSibagatullin
2008-08-13 19:10:05 UTC
Permalink
Sorry, I was not able to include the whole VI because the&nbsp; this VI consistst of like 20 subVI which are working with specific harware over GPIB and UDP. Thus this VI won't work unless you will have the mentioned above HW.THanks.&nbsp;
altenbach
2008-08-13 19:10:08 UTC
Permalink
Even without the subVI, we can look at all cases and the overall structure of the program.&nbsp;You still have not answered the question on why you insist that the terminal&nbsp;is outside the loop.
JoeLabView
2008-08-14 00:10:08 UTC
Permalink
RSibagatullin wrote:
The button by itself is outside the while loop.
That might be the problem.&nbsp; &nbsp;Thanks for the image, however, we would need to see the greater picture.&nbsp; If the button is outside the active code (ie: within an executing&nbsp;loop) it may not get processed, thus as a result it does not &quot;pop back up&quot;.&nbsp;R
DD
2008-08-12 22:40:49 UTC
Permalink
Is the block diagram terminal for the button located in the event frame so
that it is read after being pressed?
JoeLabView
2008-08-13 12:40:19 UTC
Permalink
It does sound like the button does not get processed...&nbsp; Can you post your code?&nbsp;R
Loading...