Hi,
I am using the NI-DAQmx C API with the simulated PCIe6353. If I set the rate twice using DAQmxCfgSampClkTiming before starting my task , the acquisition stops as soon as it is started. If I set the rate only once, the acquisistion seems to run fine.
I have a algorithm that sets the rate for different devices. This works fine for all USB X-series and also M-Series devices.The code shown below is a small snippet of my algorithm to show the issue:
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev3/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandle, "OnboardClock", 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 2));
DAQmxErrChk (DAQmxGetSampClkRate (taskHandle, &rate));
DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandle, "OnboardClock", 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 1000));
DAQmxErrChk (DAQmxGetSampClkRate (taskHandle, &rate));
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1000,0,EveryNCallback,NULL));
DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
Please find attached the C file I am using.
Best Regards,
Manisha
MathWorks