Hi,
This problem has plagued me for a long time and I could really do with a definitive answer.
I'm using GPCTR functions for Buffered Event Counting, and at the same time doing an AI DAQ. Both functions are running in separate threads.
The problem is I fairly randomly, and at even moderate pulse frequencies, get -10920 errors, and the frequency of these seem to get worse the more threads I have running. I am not using any synchronous NI-DAQ functions and am testing for data availability with GPCTR_Watch() and DB_HalfReady() (trusting to memory on function names so could be wrong) then reading the data. I am putting the threads to sleep for 0.1s between each call to the data ready check functions. The AI DAQ is slow, ~1kHz.
Trying to simp
lify the problem down, I have made the following assumption:
-10920 only occurs when NI-DAQ cannot read the DAQ-STC save register before it is overwritten by the card - therefore there is nothing I can do in my code to cause this error UNLESS my calls into the NI-DAQ DLL (which I know is non-reentrant v6.9.2) are also blocking the interrupt service routine if I am in the DLL when the interrupt comes in.
If calls into the DLL can block the ISR then that would explain the problem, particularly if a suspended thread is the one that is in the DLL when the interrupt comes in.
Could someone confirm if I am right or wrong on this. Also, if I am right, is there anything I can do to prevent the problem, e.g. to change the process and/or thread priorities while calling NI-DAQ functions.
Any help much appreciated.
Regards
Jamie Fraser