From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-14-2011 02:18 AM
05-14-2011 11:41 AM
Can you either post your code or a trimmed down version that exhibits this?
You seldom will want to uncheck lock front panel. I am not even sure of the use case for that. And you never want code in an event case that takes a long time to complete. A "long time" means anything that will be noticable to the user. If you _must_ do that then you should set the busy cursor and unset it when the case is done executing.
It is much better to send messages from an event handling loop to another loop using anything from a local variable (ugly) to a queue or notifier (pretty)
Take a look at the Producer/Consumer Design Pattern (Events) that ships with LabVIEW under File/New/From Template/Frameworks/Design Patterns.
05-14-2011 11:54 AM
If the event structure loop has finished executing, it means that the event structure can no longer be reached by dataflow. Thus the event can no longer fire and thus can no longer complete, meaning the front panel will lockup forever.
An event structure is always active and you should design your diagram accordingly.
(See also)
05-14-2011 03:31 PM
Sorry, I thought I'd posted the code! Here it is.
05-14-2011 03:45 PM
Is this right: if the event loop has stopped, somehow it's still active. So any event that fits one of its cases will cause it to try to execute that event case, which can't execute since no dataflow, so that case never completes execution, so the front panel locks up?
So never allow an event structure loop to finish executing before the entire VI stops if one of the events (e.g. value change of a button) can still be done?
Thanks!
05-14-2011 03:56 PM - edited 05-14-2011 04:01 PM
Do you really want the event handling to stop after detecting the first event? If so then as Christian says the event structure will cause the front panel to lock. What you can do is dynamically register and unregister the events. You right click on the event structure and enable "Show Dynamic Event Terminals" Then you can programatically register and unregister events.
Here is your vi modified to do that.
Edit: Just in case - right click on the control and create a reference. When selecting the source of the event in the structure look under the dynamic section.
05-14-2011 04:03 PM
@altenbach wrote:
An event structure is always active and you should design your diagram accordingly.
(See also)
I have never written a vi where the event loop stops while the rest of the vi continues to run. I did not know that. You will never know how many things I have learned from your replies!
05-14-2011 04:11 PM
ok I got it!
Thanks for your replies 🙂
05-14-2011 04:47 PM - edited 05-14-2011 04:50 PM
Thank people with kudos!
Edit: (Darned Swype!)