Hi.
My application is loading a wav file, carving it up into a number of blocks and then continuously playing the file with DaqMxWriteAnalog64. I am seeing a non fatal buffer error and I do not understand the error.
I have created representative sample code that shows the error (error checking removed to keep it simple).
int WriteBlockSize = 51200;
double* pSampleSet = (double*)malloc(WriteBlockSize);
int WriteBufferSize = WriteBlockSize * 4;
DAQmxSetTimingAttribute(taskHandle, DAQmx_SampClk_Rate, 200000.0F);
DAQmxGetTimingAttribute(taskHandle, DAQmx_SampClk_Rate, &resultingSampClkRate);
DAQmxCfgSampClkTiming(taskHandle, "", resultingSampClkRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, WriteBufferSize);
DAQmxRegisterEveryNSamplesEvent(taskHandle, DAQmx_Val_Transferred_From_Buffer, WriteBlockSize, 0, ReloadCallback, (void*)pSampleSet);
DAQmxWriteAnalogF64(taskHandle, WriteBlockSize, 0,10.0, DAQmx_Val_GroupByChannel, data, &written, NULL);
DAQmxStartTask(taskHandle);
The error that I am seeing is a error -200920. This states that "
NON-FATAL RUN-TIME ERROR: Function DAQmxWriteAnalogF64: (return value == -200920 [0xfffcef28]). Requested Every N Samples Event Interval is not supported for the given buffer size. 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. Property: DAQmx_Every N Samples Transferred From Buffer Event Interval Requested Value: 51200 Buffer Size: 10000 Task Name: _unnamedTask<0> Status Code: -200920"
I have done the reading about buffer sizes and the help states that
"NI-DAQmx allocates a buffer equal in size to the value of the samples per channel attribute/property, unless that value is less than the value listed in the following table. If the value of the samples per channel attribute/property is less than the value in the table, NI-DAQmx uses the value in the table." - the table states a 100kS
My requested buffer size is 204800 which should satisfy the note above but the error is saying that my buffer size is 10000.
Any help would be gratefully accpeted.
Thanks