Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200877

I'm doing continuous acquisition with 2 AI channels
sample rate = 1500, samplesPerChanToAcquire = 150
DAQmxCfgSampClkTiming(m_taskHandle, NULL, 1500, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 150);

DAQmxRegisterEveryNSamplesEvent(m_taskHandle,DAQmx_Val_Acquired_Into_Buffer, 150, 0, EveryNCallbacks, NULL);

When i do the DAQmxStartTask() the following error is displayed.
Error -200877 Requested Every N Samples Event Interval is not supported for the given Data Transfer Mechanism and buffer size. To keep DMA as the Data Transfer mechanism, modify the buffer size and/or the Every N Samples Event Interval so the buffer size is an even multiple of the Every N Samples Event Interval. To keep the same Every N Samples Event Interval and buffer size, change the Data Transfer Mechanism to Interrupts.
Property: DAQmx_Every N Samples Acq Into Buffer Event Interval
Requested Value: 150
Buffer Size: 10000

1. Why does this error occur?
How should i calculated nSamples value? Do i need to use some logic for nSamples to make it even multiple of buffer size before i start my acquisition? also i dont want to change the transfer mode to interupt.
0 Kudos
Message 1 of 3
(5,481 Views)
Hello Asha,

When you created your task, the buffer size was automatically set to 10000 samples.  When you register the event and start the task, it requires that the buffer size be a multiple of the requested callback size.  In your case, if you want a callback every 150 samples you can manually set the buffer size to 1500 using the DAQmxSetBufInputBufSize in C.   If you later change the number of sample to acquire in the callback you can just update the buffer size to be a multiple of that, and everything should work.

Alternatively, you can set the transfer mechanism to interrupts using the DAQmxSetAIDataXferMech function in C however interrupts are more processor intensive.

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 3
(5,467 Views)
Thanks a lot
0 Kudos
Message 3 of 3
(5,432 Views)