Skip to main content

DMM simulator

The DMM simulator is a local SCPI server for development, tests, and demos. It listens on a TCP socket and exposes a digital-multimeter command set: function switching plus the five primary measurements (DC/AC voltage, DC/AC current, and two-wire resistance). Each function measures a configurable stimulus value returned with Gaussian noise, so repeated reads look like a real bench instrument. Unlike the PSU simulator, the DMM simulator is headless: there is no terminal UI. Set stimulus values with CLI flags at startup, or through the Python API when embedding the simulator in tests.

Quickstart

Start the simulator in one terminal:
It binds to 127.0.0.1:5026 by default. If you are working from a source checkout, run the same command through uv:
Connect from another terminal or script with the SimulatedDMM driver. This small Python client opens an InstroDMM, switches functions, and reads measurements:
Use CLI flags to change the bind address, port, or the stimulus each function measures:

Stimulus model

The stimulus is the simulator’s stand-in for the physical quantity on the probes (the DMM analog of the PSU simulator’s load model). Each measurement function has one stimulus value, and every measurement returns that value with Gaussian noise (±0.5% at 3 standard deviations). When embedding the simulator in Python (for example in tests), construct the server in-process and set stimulus values at runtime:
Stimulus values persist across *RST: reset returns the instrument state (active function, error queue) to defaults, but the simulated physical world stays put.

Programming guide

Brackets mark optional SCPI path components. For example, [SENSe:]FUNCtion accepts FUNC, FUNCTION, and SENS:FUNC. Keywords match in short or long form, in any case. Unknown headers queue -113,"Undefined header"; an unknown function name queues -224,"Illegal parameter value". The SimulatedDMM driver checks SYST:ERR? after every transaction and raises on any queued error.