Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I have problem with NI DAQ-6210 m series, when I want to read contsmpls.

Hi     
I want to read exactly 1000 samples per second, and it would be continues and accurate reading data.
This is very important for me to read exactly 1000 samples every second.
I'm using NI DAQ-6210 m series.
   
I made a C++ sample project using these DAQ functions:
"
 DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
 DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1","",DAQmx_Val_RSE,-2.0,2.0,DAQmx_Val_Volts,NULL));
 DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,NULL,1000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
 DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1000,0,EveryNCallback,this->GetSafeHwnd()));
DAQmxErrChk (DAQmxStartTask(taskHandle));
"
//////////////////////////////////////
"
int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
{
 DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,-1,10.0,DAQmx_Val_GroupByChannel,EntireDataSet,1000,&read,NULL)); 
 time(&nowtime);
 outfile<<ctime(&nowtime);
 Error:
 if( DAQmxFailed(error) )
   DAQmxGetExtendedErrorInfo(errBuff,2048);
 return 0;
}
"
because It is important for me to read exactly 1000 sample per second, I used above example for testing that, and I logged timestamps in file every time DAQ reads data, But in my outfile I see sometimes DAQ did not work properly in one second.
Some seconds it reads no data and few seconds later, it gives me the data 2 times (in one second).
(This problem occurs after about 3 hours running. of course this time is not regular.)
here is some lines of my outfile:
Thu Feb 14 17:27:13 2008
Thu Feb 14 17:27:14 2008
Thu Feb 14 17:27:14 2008
Thu Feb 14 17:27:15 2008
Thu Feb 14 17:27:16 2008
Thu Feb 14 17:27:18 2008
Thu Feb 14 17:27:19 2008
Thu Feb 14 17:27:20 2008
Thu Feb 14 17:27:21 2008
Thu Feb 14 17:27:21 2008
Thu Feb 14 17:27:22 2008
Thu Feb 14 17:27:23 2008
Thu Feb 14 17:27:25 2008
 
Thanks.
0 Kudos
Message 1 of 2
(2,665 Views)

Hi,

I have answered your question in this Discussion Forum:

I have problem with NI DAQ-6210 m series, when I want to read contsmpls”.

Let me knot if it helps 

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 2 of 2
(2,652 Views)