LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure and automatic queueing of events.

I have found out the long way that the event structure queues all the events taken place while it has been executing yur most current event.

In other words... I understand why the locking of the front panel is an automatic option that is selected. As it will prevent you from queueing more events,  and causing yur program to execute endless event structure runs, when you wanted it to stop 15 button presses ago.

case in point.... is in this simple VI i attached.

My question is ... is there a way to turn off this automatic queueing of events??


0 Kudos
Message 1 of 4
(2,895 Views)
Disable any other event throwing controls.  Obviously if you're using programmatically generated events you can control when they're thrown, but if you have booleans A, B, C, and the user clicks A, first thing you do in the event handler for A is disable both B and C.  Re-enable them when it becomes safe again.

EDIT: Just looked at the VI you posted.  Some of the comments made me laugh a bit.  The queing of events can be useful in other respects  though.  I understand why you're frustrated with it, but with careful coding practice it can become quite useful.

Message Edited by Novatron on 06-30-2006 03:09 PM

0 Kudos
Message 2 of 4
(2,889 Views)
Well ... the problem for me... was, for example, in the VI I posted....

The OK button in the VI I posted, has an event triggered to it in the event structure.... So when I enter that loop after hitting the enter loop button... it registers those OK clicks...

Say the OK button and NOT the continue button takes me out of the little loop and back into the big loop. Now, after leaving the little loop and entering into the big loop, I will immediatly enter back into the event structure to handle the OK button click.

Basically I wanted one button to control the termination condition of the little loop, but also have an event in the event structure associated with it, so basically one button to exit the little loop AND the big loop.


I hope Im making sense. I found a solution, by just making two buttons, when entering into the little loop, the one button dissapears... and vice versa when entering into the big loop. So to the USER it appears like ONE button... but in the code its actually two.

I just wasnt sure if there was another way around it... it was tough to figure out what was really happenening in my code... took my about an hour or two to track down.


EDIT: Yea.. thanks for the reply....  as for the comments in my code... yea, I get a little crazy towards the end of the day... after 6-8 hours of straight labview programming.  🙂

Message Edited by MJBrehm on 06-30-2006 02:21 PM

0 Kudos
Message 3 of 4
(2,886 Views)
I think part of the problem is that the OK button is in an event case which "belongs" to another control and it is in a loop that continues until another button (Continue) is pressed. A better architecture would be to have the event structure send messages (via a queue for example) to a parallel loop which performs the actions required by the buttons.

I do not understand what purpose is served by having the OK button in another event case, other than to create the effect you showed.

Lynn
0 Kudos
Message 4 of 4
(2,872 Views)