I don't seem to be able to get continuous sampling to work. I am guessing that I do something wrong with the steps that I take (out of order or I might be missing one). Here is the code, simplified by taking out all the error checking (the program runs without issuing any errors, i.e. DAQmxFailed(error) is always 0, and data is not NULL).
The problem is that nSamplesRead is always 0, and data is always full of 0s as well. If I use the same program and replace the line error = DAQmxCfgSampClkTiming(...,DAQmx_Val_ContSamps,N_SAMPLES); by error = DAQmxCfgSampClkTiming(...,DAQmx_Val_FiniteSamps,10); for example, and do not issue the DAQmxStopTask, I am able to read 20 samples from the DAQ card (DAQcard-6024E). I al
so tried to add DAQmxDisableStartTrig before starting the task, but it didn't help. I tried not stopping the task, but that didn't help either.
Any help would greatly be appreciated.
Thanks!
Laurent