LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Events: event structure missing events intermittantly

Solved!
Go to solution

Hello,

 

I am experimenting with the framework presented here:

http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/...

...essentially a many-to-many communication bus using user defined events.

 

The problem I am seeing is that occupationally one of the event loops seems to miss an event being fired.  I can't see any pattern except that it occurs more often if events are rapid, though they can be missed even with 50ms or more between events.  It looks like about one in every 70 events or so are missed with a 5ms between events, maybe a tenth of this at 50 ms between events.

 

The parts are summarized in the images below. The VI is attached.  If you run it a few times, and this isn't a machine related issue, you'l see one of loops not process the same set of events as the other.

 

Thanks for any guidance that may be on offer.

 

Creation of event:

pic2.png

Firing off events:

pic1.png

 

Event processing loops, one handles one task, another the other. both handle exit:

pic3.png

 

Front panel after an error run:

pic4.png

 

Download All
0 Kudos
Message 1 of 4
(3,726 Views)
Solution
Accepted by topic author AdamZeroK

You cannot use the same registration.  You need a registration for the event at each place you want to "listen" for the event.

 

Think of each registration as a queue.  If you dequeue from the same queue in multiple loops, you do not know who will read which element.  Works the same for the registration.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(3,711 Views)

Great, makes sense.  Thank you.

0 Kudos
Message 3 of 4
(3,701 Views)

It is probably also not a great idea to bury event structures inside case structures. Under error condition, the events will accumulate forever in the event queue because it cannot react due to dataflow, and once the error condition clears, you get the oldest event first, which might be stale by then, or not even valid because it happened during an error condition.

Message 4 of 4
(3,679 Views)