07-14-2009 09:48 PM
07-15-2009 08:33 AM
You can use "Set Occurrence" in the ISR handler VI to send notifications.(of source, the occurrence refnum will be stored in the Global vi, as well).
how do you know your data is current???
1) Perhaps you are also thinking here to synchronization. I imagine you read continuously the globals and cannot distinguish between old values and ISR updated ones. Well, you could continue with this polling manner, and add a global counter (i.e.. Increment the counter in ISR, and compare this counter with a local one in the main VI).
2) Be aware about data passed between handler and VIs. You should pass only scalars for at least two reasons:
- writing/reading up to 4 bytes are always atomic operations;
- there is KI 44734(http://digital.ni.com/public.nsf/allkb/270545BCCF971FE9862574F20049095C)
However, keep in mind general rules, such "time spent in interrupts should be kept at minimum". Also, the overall design matters (e.g.. how fast are those interrupts? do you really need an interrupt handler? or you could trigger a timed loop?).
07-15-2009 01:05 PM
The latency time between the interrupt and the isr is very consistant, so i'm using external hardware on a daughterboard to trigger the sampling of a periodic waveform. I want the a/d in the isr since the timing is critical.
Polling is only desirable in politics and you know how reliable that is... and a lot of wasted time. Can i use the RTFIFO or a notifier be used as you suggested for the "set occurance" (global refnum)? It seems the creation of these objects in the isr is where the problem lay.
David
07-16-2009 12:20 AM