VirtualDMM#
- class VirtualDMM(
- stimulus: dict[MeasurementFunction, float] | None = None,
Bases:
DMMDriverBaseDMM simulated in-process: no transport, server, or hardware.
Each function reads its stimulus value plus noise (0.5%, the SCPI simulator’s level). Range, NPLC, digits, and aperture settings are accepted and have no effect on readings, so any
InstroDMMcall works. To exercise the VISA transport as well, useSimulatedDMMwith the bundled SCPI simulator.Create a virtual DMM.
- Parameters:
stimulus (dict[MeasurementFunction, float] | None)
The value each function measures before noise, in volts, amperes, or ohms. Functions left out keep their defaults (1.25 V DC, 0.5 V AC, 0.1 A DC, 0.05 A AC, 1000 ohms).
Example:
from instro.dmm import InstroDMM, MeasurementFunction from instro.dmm.drivers import VirtualDMM dmm = InstroDMM(name="dmm", driver=VirtualDMM({MeasurementFunction.DC_VOLTAGE: 3.3})) with dmm: print(dmm.read_dc_voltage().latest) # about 3.3
Methods
Nothing to disconnect.
Trigger an AC-current measurement and return the value (amperes RMS, vendor-dependent).
Trigger an AC-voltage measurement and return the value (volts RMS, vendor-dependent).
Trigger a DC-current measurement and return the value (amperes).
Trigger a DC-voltage measurement and return the value (volts).
Trigger a 4-wire-resistance measurement and return the value (ohms).
Trigger a 2-wire-resistance measurement and return the value (ohms).
Nothing to connect to.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accepted; no effect on readings.
Accept any function;
InstroDMMcalls the matchingmeasure_*method to read it.Accepted; no effect on readings.
Accepted; no effect on readings.
- set_measurement_function(
- function: MeasurementFunction,
Accept any function;
InstroDMMcalls the matchingmeasure_*method to read it.
- measure_ac_voltage() float[source]#
Trigger an AC-voltage measurement and return the value (volts RMS, vendor-dependent).
- measure_dc_current() float[source]#
Trigger a DC-current measurement and return the value (amperes).
- measure_ac_current() float[source]#
Trigger an AC-current measurement and return the value (amperes RMS, vendor-dependent).