event structure queue corruption?

This is a discussion on event structure queue corruption? within the labview forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-15-2008, 03:10 PM
lmd2
Guest
 
Default event structure queue corruption?

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
Reply With Quote
  #2  
Old 08-15-2008, 04:40 PM
lmd2
Guest
 
Default Re: event structure queue corruption?

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 
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 10:57 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.