List connected VISA instruments with Python & PyVISA
The two-line health check for any automated test setup: enumerate every USB and LAN instrument your PC can see, and read back their identification strings.
Before any remote-control project, you want proof that your PC actually sees the instrument. PyVISA — the de-facto Python standard for instrument I/O — does that in two lines, over USB and LAN alike, for every Siglent oscilloscope, generator, spectrum analyzer, power supply and load.
Install PyVISA
pip install pyvisa pyvisa-py
pyvisa-py is a pure-Python backend — no National Instruments installation needed. If you already run NI-VISA or Keysight IO Libraries, PyVISA will use those instead; both work with Siglent instruments.
List every connected instrument
import pyvisa
rm = pyvisa.ResourceManager('@py') # '@py' = pyvisa-py backend; omit to use NI-VISA
for res in rm.list_resources():
print(res)USB0::0xF4EC::0x1012::SDG7ABCD5R0001::INSTR TCPIP::192.168.1.121::INSTR
USB instruments appear automatically. LAN instruments show up when the backend supports discovery — you can always open one directly by IP address instead.
Say hello: read the identification string
inst = rm.open_resource('TCPIP::192.168.1.121::INSTR')
print(inst.query('*IDN?'))Siglent Technologies,SDS2354X Plus,SDS2PEEQ6R0123,1.6.2R5
If you get a manufacturer, model, serial number and firmware version back, your link is proven — everything else (measurements, screenshots, automation) is just more SCPI commands on the same connection.
No response? Check that instrument and PC are in the same subnet, and see our Telnet and NI-MAX verification notes to isolate the problem layer by layer.
Instruments used in this note
Related application notes
Our engineers use these instruments daily — ask us anything.