10-28-2008 10:45 AM
I have a USB-6251 that I am controlling using C3 and .Net3.5.
The code is as follows:
Task theTask = new Task("Measure");string lines = GetLinesForPins(pinsToMeasure);
DIChannel chan = theTask.DIChannels.CreateChannel(lines, theTask.ToString(), ChannelLineGrouping.OneChannelForAllLines);theTask.Timing.ConfigureChangeDetection(lines, lines, SampleQuantityMode.ContinuousSamples, 1000);
// Start the reading asynchronously:
DigitalSingleChannelReader reader = new DigitalSingleChannelReader(theTask.Stream);reader.BeginReadWaveform(numberOfSamples, null, null);
// Wait code removed for clarity
theTask.Stream.ReadAllAvailableSamples = true; // We should wait untill the
DigitalSingleChannelReader reader = new DigitalSingleChannelReader(theTask.Stream);DigitalWaveform wave = reader.ReadWaveform(-1);
if (theTask.Timing.ChangeDetectionOverflowed)TestIsNonConclusive("ChangeDetection overflowed. DUT is too fast for NI-DAQ module");
The ChangeDetectionOverflowed is not set, despite the fact that the IO line toggles every ~810ns (measured with Logic Analyzer).
Also the timestamps in samples indicate sample every 1ms - which measn about 1000 overflow events occured...
This is how I read the timestamps:
foreach (DigitalWaveformSample sample in wave.Samples){
PrecisionTimeSpan dt = sample.PrecisionTimeStamp - wave.PrecisionTiming.StartTime;
What am I doing wrong?
Regards
Espen
10-29-2008 10:34 AM
I think I discovered the issue here. The 6251 uses the 80MHz clock for changedetection - which is more than fast enough not to loose any triggers.