b35864656a2ebb7262345025260e957550e8bcd0
Found against real hardware: a fixed 2.0s host-side read timeout was
shorter than the device's configured read_tmo_ms (3000ms). The
controller keeps a "++read" outstanding internally until EOI or its
own timeout, so the client gave up and sent the next command first --
that command's reply then got lost/delayed behind the still-pending
read, surfacing as a spurious TransportTimeout on the *following* call
(observed: query("*IDN?") timed out as expected with no instrument
attached, then srq() right after it timed out too, on a device with
read_tmo_ms=3000).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
progpib
A modern Python 3 API for the Prologix GPIB-ETHERNET
controller. GPIB-USB is supported behind the same interface but is
untested -- no GPIB-USB hardware was available while building this
package (see progpib/transport/serial.py).
Install (development)
This package depends on bits
(distribution name binary-bits), currently used as a local editable
checkout rather than a pinned PyPI release -- install it first:
python -m venv .venv
.venv/bin/pip install -e ../bits
.venv/bin/pip install -e .[dev]
Usage
from progpib import discover, GpibController
# Find controllers on the LAN (broadcasts on every local interface):
for device in discover():
print(device.mac_str, device.ip_address, device.name)
# Talk to one:
with GpibController.ethernet("192.168.1.50") as gpib:
print(gpib.ver())
gpib.addr = 5 # address the instrument at GPIB primary address 5
gpib.eos = 3 # no GPIB terminator appended
gpib.eoi = 1
response = gpib.query("*IDN?")
print(response.decode())
CLI
progpib discover # find controllers on the LAN
progpib info <ip> # controller version/mode/config
progpib config --mac AA:BB:CC:DD:EE:FF --dhcp
progpib config --mac AA:BB:CC:DD:EE:FF --static 192.168.1.50 255.255.255.0 192.168.1.1
progpib terminal <ip> --addr 5 # interactive pass-through terminal
Reference material
vendortools/, pty-gpib-emulator/, sampledata.txt and
PrologixGpibEthernetManual.pdf are kept as historical/reference material
(original vendor tooling, a separate PTY-based emulator side project, and a
captured protocol session) -- nothing in progpib/ imports from them.
Languages
Python
91.2%
C++
8%
Makefile
0.6%
Shell
0.2%