Hi!
I want to read in a given period of time, 20 samples from my 6025E.
I configured my task like this:
In the constructor:
this.KraftT.AIChannels.CreateVoltageChannel("Dev1/ai0","aiChannel",AITerminalConfiguration.Differential,0,10.0, AIVoltageUnits.Volts);
this.KraftT.Timing.ConfigureSampleClock("",this.konfig.100,SampleClockActiveEdge.Rising,SampleQuantityMode.ContinuousSamples);
this.KraftC = new AnalogSingleChannelReader(this.KraftT.Stream);
analogCallback = new AsyncCallback(AnalogInCallback);
this.KraftT.Start();
In the Callback:
this.m_NICallback(NationalInstruments.Analysis.Math.Statistics.Mean(this.KraftC.EndReadMultiSample(ar)));
In the called function:
return NationalInstrume
nts.Analysis.Math.Statistics.Mean(this.KraftC.ReadMultiSample(20));
My problem:
If I call my function just one time, I get the real value. The next values are all stored in the buffer, and when the voltage is in real higher, I only read the "old-values" which are stored in the buffer.
So I need any buffer - clear method, before calling my function, because I only need the actual values.
Can I reduce the buffer size to solve the problem, or what can I do ?
Please write back soon.!
Thanks,
Klaus