Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite sampling on each trigger

Solved!
Go to solution

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:

error.PNG

 

 

       
_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)) )); }

 

 

 

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 1 of 2
(6,385 Views)
Solution
Accepted by topic author anarkie

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.

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 2 of 2
(6,383 Views)