LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can be controled the event queue??

I've got a problem because I've created a button to disable a subVI
through an event and leave it inactive in a window (to see some
results). Then, I can execute another part of the main program and I
also can close the window with the top right button "X". The problem
comes when I try to call the subVI again. It executes correctly but
when it arrives to the event structure, it handles the "Close Window"
event case ("X"), that it was treated in the event case structure,
too. So, the subVI stops. I suppose this happens this way because the
"X" event is waiting in the event queue until the next execution of
the subVI, so I would like to know if there's any way to empty the
event queue when the subVI starts executing.

Thanks for a
ll,

Obatistor
0 Kudos
Message 1 of 3
(2,562 Views)
Is the subvi located in an event? If so, you might want to move it to a case.

You can also try to call the problemetic subvi dynamically without waiting it to finish.

-Joe
0 Kudos
Message 2 of 3
(2,562 Views)
> too. So, the subVI stops. I suppose this happens this way because the
> "X" event is waiting in the event queue until the next execution of
> the subVI, so I would like to know if there's any way to empty the
> event queue when the subVI starts executing.
>

If you are using dynamic registration, I think you can unregister and
register for the events, but another solution is to add a bit of state
information. The close event will still arrive, but you will know that
you are supposed to ignore it, and can return Discard as TRUE.

Greg McKaskle
0 Kudos
Message 3 of 3
(2,562 Views)