AnsweredAssumed Answered

34410a Sampling Interval

Question asked by jt on Oct 16, 2012
I am writing an application with GUI to allow take the following parameters from user:

Range: 3A | 1A | 100mA | 10mA | 1mA | 100uA | Auto
NPLC:     0.006 | 0.02 | 0.06 | 0.2 | 1 | 2 | 10 |  100
AutoZero: off | on | once
Sampling Duration: seconds

With these information from user, I like to program the DMM to continuously take measurement as fast as possible and the application from read it and log it for the sampling duration (could be 10 sec, 1 hour, 1 day)

I am coding in C# using IVI and I already have something working, something like this

Dmm = new Agilent34410();
Dmm.Initialize(addr, true, false);

Dmm.Measurement.MeasurementFunction = Agilent34410MeasurementFunctionACCurrent;
Dmm.Current.DCCurrent.Range = range;
Dmm.Current.DCCurrent.NPLC = nplc;
Dmm.Current.DCCurrent.AutoZero = autozero;
Dmm.Trigger.TriggerSource = Agilent34410TriggerSourceEnum.Agilent34410TriggerSourceImmediate;

Dmm.Math.Function = Agilent34410MathFunctionEnum.Agilent34410MathFunctionAverage;
Dmm.Math.Enable = true;

Dmm.Trigger.SampleSource = Agilent34410SampleSourceEnum.Agilent34410SampleSourceTimer;
Dmm.Trigger.SampleInterval = ?
Dmm.Trigger.TriggerCount = ?
Dmm.Trigger.SampleCount = ?

How do I figure out the last three parameters for "as fast as possible" depending on the input from above?

I like to use "Agilent34410SampleSourceImmediate" but then how do I figure out the time stamp?  I see that with SCPI command, you can set SAMPle:TIMer to "MIN".

I have tried some values and ended up getting timing violation for some combination and with some values,I get range errors.

Ultimately, I want to log the result for the x duration with timestamp and measurement.

As for removing/reading the measurements, I am planning to have a background thread that do something like this:

cnt = Dmm.Measurement.get_ReadingCount(Agilent34410MemoryTypeEnum.Agilent34410MemoryTypeReadingMemory);

if (cnt > 0)
    rdgs = Dmm.Measurement.RemoveReadings(cnt);
 
Will this work? Please advice.

Thank you.  

Outcomes