Discussion:
event structure queue corruption?
(too old to reply)
lmd2
2008-08-15 19:10:05 UTC
Permalink
OK this gets a little complicated, first some background: I am writing VIs to call DLL functions using Call Library Function Nodes. One function enables IRQ interrupts and I feed it a reference to a dynamic user event. To test this I simply do an increment in the event structure, put 20 messages onto the bus at about 70mS interval, and the output counts up to 20 in about a second and a half. so far so good. Now the client wants more than a number to increment when an interrupt occurs, within the event structure I place a second CLFN that does a stack read. 
Only now if I place 20 messages on the bus only 4, or 12 or 17 stack reads occur, and if I repeat the 20 messages every 30 - 40 seconds I'll get a few cases of reading less than 20 stack words, and then out of nowhere we read 28 words????
So doing a simple increment we know that the interrupt mechanism is good, but doing a stack read seems to make the queue crazy.
I know that the event structure is a little different for dynamic events (such as there is no option to lock the front panel), what I am wondering is if there are latency issues or anything that may affect the event queue, losing elements or backing up if the code inside can't be handled as quickly as events are registered? (or anything else that you can thnk of based on what I am observing)
 
thanx
lmd2
lmd2
2008-08-15 20:40:18 UTC
Permalink
a little more info: the blocking function that waits for the interrupt seems to be  affecting the event queue. If I set the time parameter to a positive value it will poll at that frequency (like a timeout on a timed loop) but if the parameter is set to -1 it will wait indefinitely (blocked) for a trigger. With a positive setting (10mS) everything works fine, no messages are missed ever. It seems that with a negative value the blocking function is affecting the event queue (although this was not the case when the stack read was omitted - with the simple increment the blocked function did not affect the queue). Somehow both the blocked setting and the stack read in tandem are affecting the queue. And yes, if I didn't mention this in the original post, both CLFNs are configured to run in their own thread (in LV 7.0 it was called reentrant but actually designates thread safe).Maybe the question is whether or not the event structure is thread safe (I would guess 'yes' )Any insights would be greatly appreciated.thanxlmd2 
Continue reading on narkive:
Loading...