10-23-2014 03:07 AM
Hello,
I am using
DAQmxRegisterEveryNSamplesEvent
to register a callback function to produce and write analogue output data for a NI PCI 6221 which is resulting in memory growth/leak of around 6MB per hour.
If I do not register a callback function and instead use
DAQmxSetWriteRegenMode(taskHandle, DAQmx_Val_AllowRegen );
to repeat the initial buffer then I do not see any growth in memory usage.
After experimenting with the contents of the callback function it appears that the growth is due to the function
DAQmxWriteAnalogF64(taskHandle,nSamps,FALSE,10.0, DAQmx_Val_GroupByScanNumber ,dataArray,NULL,NULL);
Is this expected behaviour or should I be able to use write data to the device in this manner without experiencing increasing memory usage?
Thanks
10-23-2014 06:17 AM
I believe I've solved this problem - I was writing a slightly larger number of samples to the device in the callback function than I had specified when registering the callback function.