python-vxi11

raw JSON →
0.9 verified Fri May 01 auth: no python

A Python driver for controlling instruments over Ethernet using the VXI-11 protocol. It allows remote control of oscilloscopes, power supplies, and other test equipment. Current version 0.9, released periodically.

pip install python-vxi11
error ModuleNotFoundError: No module named 'vxi11'
cause The library is not installed.
fix
Run 'pip install python-vxi11' and ensure the correct Python environment.
error AttributeError: module 'vxi11' has no attribute 'Instrument'
cause Importing 'Instrument' directly from vxi11 (e.g., 'from vxi11 import Instrument').
fix
Use 'import vxi11' and then reference 'vxi11.Instrument()'.
error vxi11.Vxi11Error: VXI-11 connection timeout
cause Instrument unreachable or wrong IP/hostname, or timeout too short.
fix
Verify network connectivity and increase timeout (milliseconds).
gotcha The constructor 'vxi11.Instrument(host, ...)' does not raise an exception on connection failure immediately; errors may occur on first command.
fix Wrap the first command in a try block to catch timeouts or connection errors.
gotcha Timeout parameter is in milliseconds, not seconds. Default is 10000 (10 seconds).
fix Pass timeout in milliseconds, e.g., timeout=5000 for 5 seconds.
gotcha The 'ask()' method sends a command and reads response; it does not include a trailing newline. For commands that require termination, use 'write()' explicitly with '\n'.
fix Use 'instr.write('*IDN?\n')' then 'instr.read()' if needed.

Connect to an instrument and query its identity.

import vxi11
instr = vxi11.Instrument('192.168.1.10')
print(instr.ask('*IDN?'))
instr.close()