InstroDMM#

class InstroDMM(
name: str | None = None,
driver: DMMDriverBase | None = None,
publishers: list[Publisher] | None = None,
config: DMMConfig | dict | Path | str | None = None,
autostart: bool = False,
**kwargs,
)[source]#

Bases: Instrument

Digital multimeter instrument. Call set_measurement_function then read, or a single read_<function>.

Initialize an InstroDMM.

Provide either config or driver, not both.

Parameters:
  • name – Channel-name prefix for published data. Falls back to config.device.name when config is given.

  • driver –

    Concrete DMM driver; owns its own transport:

    dmm = InstroDMM(
        "main",
        driver=Agilent34401A("ASRL3::INSTR"),
    )
    

  • publishers – Publishers that receive emitted Measurement/Command data. Combined with any publishers declared in config.

  • config – A DMMConfig, a dict, or a path to a JSON config file. Its measurement block is applied through the public setters on open().

  • autostart – When True, open the connection and start background polling. Requires config with a measurement block, since polling cannot start without a measurement function.

  • **kwargs – Default tags applied to every emitted Measurement/Command. Pass dataset_rid="<rid>" to auto-create a NominalCorePublisher (uses the on-disk ‘default’ Nominal credential).

Attributes

background_interval

Seconds between background daemon iterations (0 = no wait).

channel_names

Return an insertion-ordered snapshot of all published channel names.

Methods

add_background_daemon_function

Append method to the daemon's call list.

add_publisher

Register a publisher to receive this instrument's Measurement/Command data.

close

Close the underlying driver and stop the daemon.

define_background_daemon

Replace all daemon functions with a single method (called with the given args).

get_channel

Return the most recent length samples for channel_name from the in-memory buffer.

get_single_channel_value

Return the most recent sample for channel_name from the in-memory buffer.

open

Open the underlying driver and apply any configured measurement state.

publish

Fan data out to every configured publisher; kwargs pass through.

read

Trigger a measurement under the configured function and return it.

read_ac_current

Read AC current (amperes), selecting the function first if needed.

read_ac_voltage

Read AC voltage (volts), selecting the function first if needed.

read_dc_current

Read DC current (amperes), selecting the function first if needed.

read_dc_voltage

Read DC voltage (volts), selecting the function first if needed.

read_four_wire_resistance

Read 4-wire resistance (ohms), selecting the function first if needed.

read_resistance

Read 2-wire resistance (ohms), selecting the function first if needed.

set_aperture_nplc

Set integration time as a number of power-line cycles.

set_aperture_seconds

Set integration time (aperture) in seconds.

set_digits

Set resolution in digits.

set_measurement_function

Configure the DMM for function (DC voltage, resistance, etc.).

set_range

Set manual range; None selects auto-range.

start

Start the background daemon thread.

stop

Signal the background daemon to stop and join it.