I'm working to upgrade an existing VC++ application (without Measurement Studio only NIDAQ) that use traditional NIDAQ double buffering realtime acquisition. The target is to add the ability of use the serie M NIDAQ Board that unfotunately not support traditional NIDAQ API :'(
To maintain the thread architecture of the existing application I need something like the old DAQ_DB_HalfReady that inform the acquisition thread when a buffer is complete and ready to be read.
I use the Examples\DAQmx ANSI C\Analog In\Measure Voltage\Cont Acq-Int Clk structure, but is missing a function that tell me when the buffer is complete, I want to polling this and then take the complete buffer when is ready.
I try to use DAQmxRegisterEveryNSamplesEvent but with no success, my application is too mutch busy to respond fast enough to the callback, while register the callback in my acquisition thread using option DAQmx_Val_SynchronousEventCallbacks is not possible because it not processing messages.
I take advantage of this post to ask two question on DAQmxRegisterEveryNSamplesEvent:
- with option DAQmx_Val_SynchronousEventCallbacks what does mean "In order for the callback to occur, you must be processing messages", exist an example?
- how can I unregister a callback? if I register a callback twice at the second time obtain an error that explain me to unregister the previous callback first, but how can i do this? I have not found a function for that.
Many thanks Massimo.