I'm using USB-6210 for continuous acquisition.
To set the sampling rate
DAQmxCfgSampClkTiming(gTaskHandle, "",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,sampsPerChan));
To read the data
DAQmxReadAnalogF64(taskHandle,nSamples,10.0,DAQmx_Val_GroupByScanNumber,gData,nSamples*gNumChannels,&numRead,NULL);
I set rate = sampsPerChan, which means I suppose to read the data every second.
I use clock() to show me the time up to milisecond.
After 100 seconds running, it is running slower 0.002 second.
And different computer will give different time after running the program for few hours, some are faster but some are slower few seconds.
May I know how should I set in my program, to read the data every 1.000second exactly.