Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6251 - Analog Input acquisition with low sampling rate provided by external clock sourcegenerates Error -200019

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 4
(2,239 Views)

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)?

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 4
(2,220 Views)

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 4
(2,208 Views)
Solution
Accepted by wlattery

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();

0 Kudos
Message 4 of 4
(2,186 Views)