07-29-2009 02:55 PM
Hello? I have some error problem regarding to DAQmxSetReadOffset().
Whenever I set this codes,
short* DataBuffer = new short[_countof(dbuffer)]; ... DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",fRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,_countof(dbuffer) )); ...
I receive this error:
_countof(dbuffer) is a buffer size of data. I wish to acquire _countof(dbuffer) size sample.
I have tried this, but no use.
DAQmxErrChk (DAQmxGetReadAvailSampPerChan(taskHandle,&reading)); if(reading>_countof(dbuffer)) { DAQmxErrChk(DAQmxSetReadRelativeTo(taskHandle, DAQmx_Val_MostRecentSamp )); DAQmxErrChk(DAQmxSetReadOffset(taskHandle, -(_countof(dbuffer)) )); }
Solved! Go to Solution.
07-29-2009 03:32 PM
Ah,,,I have solved the problem. It was using while() condition, but it is causing that error.
The continuous sampling needs while() but in this case it doesn't need it.