LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does event structure timeout prevent recognizing other events?

I have an event structure that I'm using to detect a dynamic event (from a DAQ counter). That part works fine. But I also want to monitor a shared variable and stop the loop that the event structure is in when that shared variable is set to true. I can start another loop, monitor the variable there and trigger an event to stop the event structure, but I thought it should also work to monitor the variable in the Timeout event of the event structure. The problem is that the timeout seems to be keeping some of my dynamic events from being recognized. Right now I'm simply monitoring the loop count when my dynamic event happens (I've verified that the signal that generates the event happens without fail every second). Every once in awhile the loop count doesn't advance. I assume this is because the event structure was handling the timeout. I've tried timeout values both less than and greater than the frequency of my dynamic event. Any ideas what's going on?
 
George
0 Kudos
Message 1 of 2
(2,275 Views)
George,

I've never seen an event being missed and my understanding of the event system is that they are buffered by the system.
BUT it is seen as bad style to do the real work inside an event handler - unless it is really a quick and easy job. The better way is to just generate a named queue or similar means and to use this to send some commands to parallel running loops.
So you have an event handler in one loop that waits for the event(s) and sends commands to other loops or processes. In the case of a timeout of that event handler it checks your shared variable and stops your loop.

In a demo on the last NI LV user meeting here in Berlin I have seen some missing data when arrays have been transferred via a shared variable. In order to avaoid this possible problems you might want to run a third parallel loop that accesses the shared variable and buffers the result in a local to be accessed in the timeout event. Or it could send an occurence or so to the other loops to stop.

just my Euro 0,02!
Greetings from Germany!
--
Uwe

0 Kudos
Message 2 of 2
(2,263 Views)