Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with acquiring Finite Samples, Measurement Time

Solved!
Go to solution

Lets say i want to aquire 262144 Samples @ 51,2kHz.

I use the SafeTaskDisposer example from the documentation and start acquiring data like this.

Snippet

analogReader.BeginReadWaveform(4096, analogCallback, continuousTask);

I count the samples that have been acquired and stop at 262144.

Snippet

if (_cancelAfterNSamples)
        {
            _nSamplesAquired += data[0].SampleCount;
            if(_nSamplesAquired != _finiteSamples)
            {
                // Do Stuff...
            }
            else if (_nSamplesAquired == _finiteSamples)
            {
                this.Dispose();             
            }
        }

The problem i heave is that my measurement should take 5.12s but in reality it measures like 10 to 15 seconds for the 262144 samples. The samplecount is right but it takes way to long. I Use the cDAQ-9174 with USB.

I feel i cant trust that the data i acquired has really a Ta = 1/51200Hz.

0 Kudos
Message 1 of 2
(2,409 Views)
Solution
Accepted by topic author rizardus

It seems that switching from

_mainTask.Timing.SampleTimingType = SampleTimingType.SampleClock;

to

 

_mainTask.Timing.SampleTimingType = SampleTimingType.PipelinedSampleClock;

fixed it for me.

 

0 Kudos
Message 2 of 2
(2,385 Views)