LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frontpanel freezes when an event of an already closed event structure occurs

Hello,

I´d be very glad if someone could explain to me the behaviour of the attached short and simple vi.

If you press the OK button #1 once and then the OK button #2 the vi finishes, but if you press the first button more than once before pressing the second button, the front panel is locked. In both event structures, the feature "Lock front panel until the event case for this event completes" is enabled. If it is disabled the front panel is not locked after pressing the first button twice. What I do not understad is why if the feature is enabled the front panel locks after pressing the first button twice. I would think that after the loop containing the event structure closes, the event case should definitively be completed.
0 Kudos
Message 1 of 9
(3,802 Views)
If you take a look at the highlighted execution upon pressing the first button the event structure releases a true command to the second event structure which then completes upon pushing the second button.  The vi locks up by pressing anything other than the 1-2 sequence because of the while loops you have them inside.
 
I don't really see any relevance in this though...unless you have it inside some other program.
 
Regards
0 Kudos
Message 2 of 9
(3,796 Views)
"The vi locks up by pressing anything other than the 1-2 sequence because of the while loops you have them inside."

Could you please explain that more fully?
I understand that the front panel is locked when pressing 2-1 but why is it locked when pressing 1-1, shouldn't the first event structure be closed before doing 1 for the second time?

In this form i don't see any relevance in it either, i had problems implenting two event structures in one program, although i've made it with one now,  i'm curious why it didn't work.
0 Kudos
Message 3 of 9
(3,793 Views)
From what I understand, it looks as if it has to do with the boolean signal coming out of the event structure and going into the loop condition.  I don't work with event structures very often, but if you notice, the same thing happens when you remove the while loop from the first event structure...upon pressing the 1-1 sequence it continues to lock up.
 
Sorry I can't be of more help.
 
Regards
0 Kudos
Message 4 of 9
(3,784 Views)
The event structure in the first loop does not 'close' when the while loop finishes. The event structure in the second loop does not 'start' when the second while loop runs. They are both active and running at all times. Please read the 'caveats and recomendations for using events in LabVIEW' topic in the on-line help. This is linked under the general Event Structure help topic.
0 Kudos
Message 5 of 9
(3,774 Views)

Hello Flamming

i acknowledge the problem. it occurs as well when the events have " value change" instead of "mouse up" (preferable btw).

Altough not cleary written in the caveats for using events, i think this behavior is not a bug. the reason is that all the structures must recieve all the events, even the ones not treated for. in other words, the two loops recieve the event queue, even if the second loop still waits on another value (in your case the boolean).

we might need a confirmation on that though.

in the mean time, why even think of using two separated event structures? surely you can design your application to work with a single structure 🙂

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 6 of 9
(3,770 Views)
This is expected behavior.
 
If you look at your event configuration, both events are set to "lock front panel until event completes". If you fire the second event first, the FP locks and you cannot trigger the first event any more.
 
Quick and dirty solution: uncheck "lock front panel...". 🙂
 
Better solution: learn about dataflow and proper program design. What you are doing here is not a good program architecture. Deadlocks, too sequential,  event structures that cannot be serviced immediately due to dataflow dependency, etc.
 
Maybe you can tell us in a more general way what you are trying to do. 🙂
0 Kudos
Message 7 of 9
(3,768 Views)

Hi Dennis,

i was just looking into the caveats, and i cant find there a clear "dont do" on that, atough it could clearly lead to problems, as here.

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 8 of 9
(3,768 Views)
Thanks, i think i understand the problem now.

This is how i got it: there is only one queue for any number of event structures, i have thought each event structure has its own queue. So when an event happens that  has no active event structure to handle it and you enable "Lock front panel ...." for this event, the front panel locks, because this event simply cannot be processed.

From my point of view the labview help on that topic is obscure..

My interest was rather academic, i already stated that i eventually made it with one event structure.



Message Edited by Flaming Moe on 09-24-2007 02:16 PM

0 Kudos
Message 9 of 9
(3,758 Views)