07-08-2010 10:11 AM
Experts,
Any adverse affect of having two Event Structures, one in the main BD handing UI events (button presses, menu items etc), another running in a looping subVI handling User Events?
My reason for doing so is otherwise all blocking UI calls (like brining up a password entry dialogue) cannot be handled directly in the Event Structure. I am using User Events (and so a corresponding Event Structure) as the basis for a periodic task scheduler, and my tasks get queued and not handled properlyif anything blocks the Event Structure.
Of course I would be careful that there would be no common events between the two structures. This would be made easier due to the subVI nature of the User Event handling Event Structure.
Thoughts?
Solved! Go to Solution.
07-08-2010 10:18 AM
@nrp wrote:
Experts,
Any adverse affect of having two Event Structures, one in the main BD handing UI events (button presses, menu items etc), another running in a looping subVI handling User Events?
...
Of course I would be careful that there would be no common events between the two structures. This would be made easier due to the subVI nature of the User Event handling Event Structure.
Thoughts?
Sounds good to me.
The "no common ..." disclaimer rules out filter events fighting.. so go for it.
Ben
07-09-2010 02:26 AM
I have implemented this and it seems to be operating exactly as before (i.e. really well) except now I can have blocking UI events (which are not common, but do exist).
Designing all simple pop-up dialogues to not pause the operation of running loops is an interesting task...
07-11-2010 11:24 AM
Nothing inherently wrong with having multiple event structures. Our application tend to have dozens upon dozens running in parallel, due to the fact that User Events, while requiring a bit of wiring and infrastructure, are incredibly useful things.
The main caveats are:
Another easy way to get around the blocking dialog problem would be to create another loop whose sole responsibility is to pop up blocking dialogs. You could use a queue or user events or whatever to send messages to and from this loop. One loop should be enough, especially if the pop ups are modal and only one could be active anyway. To be honest I've never had to do this, but it seems like it would work fine.
03-29-2012 04:39 PM - edited 03-29-2012 04:41 PM
Hallo Experts!
Even i have the similar situation.
please find the attached VIs.
i have a main VI which has event structure and another subVI which is also loaded in the subpanel of the main VI.
can i use event structure like in the subVI , if the subVI handles only small operations, bundle, unbundle etc?
instead of the subVI in the example, i have to use some dynamic dispatching methods. and i dont want to run the subVi in parallel to some UI, send msgs using events, queues etc.
does this solution ok? or any other suggstions?
Thanks a lot
RENN
LV2010SP1
06-04-2013 08:06 AM
Is there any problem to use more than event structure in single VI ?
06-04-2013 10:05 AM
@kumuch wrote:
Is there any problem to use more than event structure in single VI ?
Read the help for "event structures." Particularly, the "caveats and recommendations for using events" section.
06-04-2013 10:18 AM
@kumuch wrote:
Is there any problem to use more than event structure in single VI ?
No.
(You can even have mutiple event structures react to the same control. Her is a simple example ).
You should make sure that all event structures are ready to react at all times, so each should be in it's own, independent toplevel loop. Event structures should never be buried inside case structures, sequence structures, or other event structures. Event structures should not contain lengthy or interactive code (such as while loops with stop controls).