A basic DMM reading#

dmm_basic.py#
"""Example: A basic DMM reading.

Demonstrates a single-call measurement published to a Nominal dataset. Swapping
in another vendor's driver leaves the rest of the script unchanged.

"""

from instro.dmm import InstroDMM
from instro.dmm.drivers import Agilent34401A  # or Keysight34461A, Keithley2400, SimulatedDMM
from instro.lib.publishers import NominalCorePublisher

VISA_RESOURCE = "ASRL3::INSTR"
DATASET_RID = "<dataset_rid>"  # Replace with your dataset RID.

dmm = InstroDMM(
    name="myDMM",
    driver=Agilent34401A(VISA_RESOURCE),
    publishers=[NominalCorePublisher(dataset_rid=DATASET_RID)],
)
with dmm:
    print(dmm.read_dc_voltage().latest)

Source: examples/dmm/dmm_basic.py