LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxRegisterEveryNSamplesEvent with DAQmxWriteAnalogF64 and memory growth/leak

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

0 Kudos
Message 1 of 2
(4,473 Views)

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.

0 Kudos
Message 2 of 2
(4,458 Views)