04-02-2007 09:48 PM
04-04-2007 01:16 PM
04-04-2007 09:29 PM
"I see that you are also using the "DAQmxGetReadAvailSampPerChan" function, which gets the status of the available samples per channel property. This property indicates the number of samples available to read per channel."
Yeah, it is exactly where my problem is. I tried to get the available samples per channel, but it always returns zero, which means no sample is available all the time. There must be something thing wrong. Then I change the tast from continuous sampling to finite number sampling and then it worked correctly. Why didn't DAQmxGetReadAvailSampPerChan work in continous sampling mode? Is it because I set DAQmx_Val_MostRecentSam? For the offset, I didn't change it and it should be the default value.
David
04-05-2007 09:43 AM
04-08-2007 08:32 PM
Actually, I did start the task after I configured DAQmxSetReadRelativeTo. I just forgot to paste the code.
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",SampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,BuffSize));
DAQmxErrChk (DAQmxSetReadRelativeTo(taskHandle,DAQmx_Val_MostRecentSamp));
DAQmxErrChk(DAQmxStartTask(taskHandle));
Then I use DAQmxGetReadAvailSampPerChan to check the available number of samples as
DAQmxErrChk(DAQmxGetReadAvailSampPerChan(taskHandle,read));
The problem is read always returns zero.
David
04-09-2007 11:11 AM
02-22-2018 09:46 AM
Hi,
Turns out I am having exactly the same problem. Continuous acquisition is working fine for reading a defined number of samples (read function returns immediately) but I cannot manage to have the read all available samples working (see https://github.com/ni/nidaqmx-python/issues/49).
The function DAQmxGetReadAvailSampPerChan is always returning zero for me too.
Is there any solution for this problem?