12-25-2021 07:28 AM
Hello,
I have two event structures handle the same user event(dynamic event), but meet a problem that I cannot understand.
If one event structure takes long time to handle the event (for example in the second loop of the attached example vi, waiting 5s in the case ),
the other event structure will repeatedtly handling the case (i.e., in the 3rd loop, the dialog "2nd event stopped" continuously pops out).
Thanks.
WT
LV2013sp1, Win10 64bit
Solved! Go to Solution.
12-25-2021 09:20 AM
There are good reasons that multiple Event Structures, particularly handling the same Event, are "discouraged". You can get yourself in "confusing" situations.
In the LabVIEW Help, under "Caveats and Recommendations when Using Events in LabVIEW, Caveat #11 reads
You not only have multiple Event structures in the same VI, you have multiple Event structures responding to the same "Event" (changing the Stop control) as "separate Events", a Value Changed and a User Event.
I also notice you have the Event Loops responding to TimeOut events frequently (at 100 and 200 Hz), but doing nothing! If I'm not using the TimeOut Event, I don't wire the TimeOut Node. So I unwired the TimeOut Nodes and "magically" fixed your program -- it no longer hangs!
Bottom line -- avoid using multiple Event structures in the same VI. ("Avoid" does not necessarily mean "Never do this", but rather "Do this at your own risk -- you better have a good and clear reason for it ...").
Bob Schor
12-25-2021 09:32 AM
Thanks, Bob.
WT
12-25-2021 09:58 AM
As in LV2013 help
I find under "Caveats and Recommendations when Using Events in LabVIEW"
instead of
And also, in my real application, the time out case is useful for handling regular jobs.
Best,
WT