10-10-2018 11:31 AM
I have the USB-6251 DAQ device. I am using an external clock to sample an analog input. When I sample the data at a higher rate everything works as expected. When I drop the frequency of the external clock to below 810 Hz, I receive DAQmx Error -200019: ADC conversion attempted before the prior conversion was complete.
I am using the Example code found at "Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Analog In\Measure Voltage\AcqVoltageSamples_ExtClk\CS". Also Digital Filtering is disabled.
Solved! Go to Solution.
10-10-2018 09:38 PM
Umm... Conversion rate is automatically decided by DAQmx driver.
You are setting sampling rate to "10000". Why don't you change the value to "810Hz"?
How is the Convert Clock Rate Determined in NI-DAQmx and Traditional NI-DAQ (Legacy)?
10-11-2018 10:31 AM
I don't have the referenced example to look at, but I'm assuming that the external signal is configured as a *sample* clock. There's also a conversion clock that must fire between sample clock edges. It will pulse as many times as the # channels in the task to control the multiplexing and the actual ADC conversion.
The specific language of your -200019 error isn't *entirely* clear to me, but the part that *is* clear is that it's an error due to timing signals arriving too *quickly*. The fact you see the error at lower sample rates rather than higher is counterintuitive, and suggests a problem in signal quality. Try *enabling* digital filtering for the incoming clock signal and see if that helps clear up the error.
-Kevin P
(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
10-18-2018 03:24 PM
Success! Turning on the Digital Filter for the PFI0 line did the trick. The ADC errors are gone.
var myTask = new Task();
var PortName = "/Dev3/ctr1";
myTask.CIChannels.CreateFrequencyChannel(PortName, "EncoderPulse", 1, 1250000, CIFrequencyStartingEdge.Rising,
CIFrequencyMeasurementMethod.HighFrequencyTwoCounter, 0.1, 4, CIFrequencyUnits.Hertz);
myTask.CIChannels.All.FrequencyTerminal = "PFI0";
myTask.CIChannels.All.FrequencyDigitalFilterEnable = true;
myTask.CIChannels.All.FrequencyDigitalFilterMinimumPulseWidth = 0.000006425; // 6.425 uS
myTask.Control(TaskAction.Verify);
myTask.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples, 8);
myTask.Start();