Reusable patterns for automating bench instruments in post-silicon validation.
Your test (pytest / OpenTAP / script)
↓
PyMeasure (high-level procedures)
↓
PyVISA (transport)
↓
pyvisa-py / NI-VISA / linux-gpib (backend)
↓
Instrument (LXI / GPIB / USB-TMC)
# List LXI instruments on the subnet
lxi discover
# PyVISA resource scan
python -c "import pyvisa; print(pyvisa.ResourceManager('@py').list_resources())"import pyvisa
rm = pyvisa.ResourceManager("@py")
inst = rm.open_resource("TCPIP0::192.168.1.100::INSTR")
inst.timeout = 10000
inst.write("*RST")
inst.write(":MEAS:VOLT?")
print(float(inst.read()))
inst.close()from pymeasure.instruments.keithley import Keithley2400
from pymeasure.adapters import VISAAdapter
adapter = VISAAdapter("TCPIP0::192.168.1.10::INSTR")
source = Keithley2400(adapter)
source.apply_voltage()
source.source_voltage = 1.8
source.enable_source()
print(source.current)- Set explicit timeouts on every session
- Send
*CLS;*RSTat test start for deterministic state - Log raw SCPI transcripts alongside parsed measurements
- Store calibration due dates in your test-plan metadata (Doorstop / Kiwi TCMS)
- Use
@pytest.mark.hardwarefor tests that require physical instruments
| Class | Example tools | Typical validation use |
|---|---|---|
| DMM / Source-meter | Keithley 2400, Keysight 34461A | Rail current, PMIC efficiency |
| Scope | Keysight DSOX, Tektronix MSO | Eye diagram, rise time |
| Spectrum analyzer | Keysight N9000 | EMI spot checks |
| Traffic generator | Spirent, pktgen-DPMDK | Line-rate packet validation |