DMMDriverBase#

class DMMDriverBase[source]#

Bases: ABC

Vendor DMM driver contract. Concrete drivers own their transport and lifecycle.

Range and NPLC are split per function (set_dc_voltage_range, set_ac_current_nplc, …) so the driver never tracks the active function — InstroDMM dispatches based on its own _measurement_config.

Methods

close

Close the underlying transport.

measure_ac_current

Trigger an AC-current measurement and return the value (amperes RMS, vendor-dependent).

measure_ac_voltage

Trigger an AC-voltage measurement and return the value (volts RMS, vendor-dependent).

measure_dc_current

Trigger a DC-current measurement and return the value (amperes).

measure_dc_voltage

Trigger a DC-voltage measurement and return the value (volts).

measure_four_wire_resistance

Trigger a 4-wire-resistance measurement and return the value (ohms).

measure_resistance

Trigger a 2-wire-resistance measurement and return the value (ohms).

open

Open the underlying transport and put the instrument into a known state.

set_ac_current_nplc

Set AC-current integration time to nplc power-line cycles.

set_ac_current_range

Set manual AC-current range to value amperes; None selects auto-range.

set_ac_voltage_nplc

Set AC-voltage integration time to nplc power-line cycles.

set_ac_voltage_range

Set manual AC-voltage range to value volts; None selects auto-range.

set_aperture_seconds

Set integration time directly in seconds.

set_dc_current_nplc

Set DC-current integration time to nplc power-line cycles.

set_dc_current_range

Set manual DC-current range to value amperes; None selects auto-range.

set_dc_voltage_nplc

Set DC-voltage integration time to nplc power-line cycles.

set_dc_voltage_range

Set manual DC-voltage range to value volts; None selects auto-range.

set_digits

Set resolution to n digits.

set_four_wire_resistance_nplc

Set 4-wire-resistance integration time to nplc power-line cycles.

set_four_wire_resistance_range

Set manual 4-wire-resistance range to value ohms; None selects auto-range.

set_measurement_function

Configure the DMM for function (DC voltage, AC current, 2-wire resistance, …).

set_two_wire_resistance_nplc

Set 2-wire-resistance integration time to nplc power-line cycles.

set_two_wire_resistance_range

Set manual 2-wire-resistance range to value ohms; None selects auto-range.

abstractmethod open() → None[source]#

Open the underlying transport and put the instrument into a known state.

Concrete drivers also do one-shot setup here (e.g. *CLS to clear the error queue, SYST:REM for remote control).

abstractmethod close() → None[source]#

Close the underlying transport. Idempotent.

abstractmethod set_measurement_function(
function: MeasurementFunction,
) → None[source]#

Configure the DMM for function (DC voltage, AC current, 2-wire resistance, …).

Drivers may issue a dummy measurement to commit the mode change. MeasurementFunction values the instrument doesn’t support should raise NotImplementedError.

set_digits(n: int) → None[source]#

Set resolution to n digits.

Default raises NotImplementedError; override on drivers whose SCPI exposes a direct digits/resolution control. Instruments that only expose integration time (e.g. Keithley 2400) should leave this as a no-implementation and direct users to set_aperture_nplc.

set_aperture_seconds(seconds: float) → None[source]#

Set integration time directly in seconds.

Default raises NotImplementedError. Mutually exclusive with set_aperture_nplc on a given driver — vendors typically expose one or the other.

set_dc_voltage_range(value: float | None) → None[source]#

Set manual DC-voltage range to value volts; None selects auto-range.

set_ac_voltage_range(value: float | None) → None[source]#

Set manual AC-voltage range to value volts; None selects auto-range.

set_dc_current_range(value: float | None) → None[source]#

Set manual DC-current range to value amperes; None selects auto-range.

set_ac_current_range(value: float | None) → None[source]#

Set manual AC-current range to value amperes; None selects auto-range.

set_two_wire_resistance_range(value: float | None) → None[source]#

Set manual 2-wire-resistance range to value ohms; None selects auto-range.

set_four_wire_resistance_range(
value: float | None,
) → None[source]#

Set manual 4-wire-resistance range to value ohms; None selects auto-range.

set_dc_voltage_nplc(nplc: float) → None[source]#

Set DC-voltage integration time to nplc power-line cycles.

set_ac_voltage_nplc(nplc: float) → None[source]#

Set AC-voltage integration time to nplc power-line cycles.

set_dc_current_nplc(nplc: float) → None[source]#

Set DC-current integration time to nplc power-line cycles.

set_ac_current_nplc(nplc: float) → None[source]#

Set AC-current integration time to nplc power-line cycles.

set_two_wire_resistance_nplc(nplc: float) → None[source]#

Set 2-wire-resistance integration time to nplc power-line cycles.

set_four_wire_resistance_nplc(nplc: float) → None[source]#

Set 4-wire-resistance integration time to nplc power-line cycles.

measure_four_wire_resistance() → float[source]#

Trigger a 4-wire-resistance measurement and return the value (ohms).

Default raises NotImplementedError; override on drivers whose instrument has dedicated sense leads (e.g. Agilent 34401A).

abstractmethod measure_dc_voltage() → float[source]#

Trigger a DC-voltage measurement and return the value (volts).

abstractmethod measure_ac_voltage() → float[source]#

Trigger an AC-voltage measurement and return the value (volts RMS, vendor-dependent).

abstractmethod measure_resistance() → float[source]#

Trigger a 2-wire-resistance measurement and return the value (ohms).

abstractmethod measure_dc_current() → float[source]#

Trigger a DC-current measurement and return the value (amperes).

abstractmethod measure_ac_current() → float[source]#

Trigger an AC-current measurement and return the value (amperes RMS, vendor-dependent).