S Groesz a9a79b6dd7 Replace progpib.py stub with a proper installable package
Builds a modern, testable API for the Prologix GPIB-ETHERNET controller
(GPIB-USB structurally supported but untested, no hardware available):
Transport abstraction (Ethernet now, serial later), GpibController for
the full "++" command set, a clean-room netfinder discovery client that
fixes a real chr()/struct-format bug present in vendortools/nfutil.py,
and a CLI (discover/config/info/terminal). vendortools/, pty-gpib-emulator/,
sampledata.txt and the manual PDF are kept untouched as reference material.

Depends on the sibling bits package (editable, not yet pinned -- see its
own commit) for MAC formatting and IEEE-488.2 status-byte bit access.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-24 18:43:08 -05:00
2026-08-24 16:45:12 -05:00
2020-11-10 01:47:47 +00:00
2024-02-07 23:01:18 -06:00
2021-04-17 01:21:54 +00:00

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.

Description
Prologix GPIB python tools.
Readme MIT 304 KiB
Languages
Python 91.2%
C++ 8%
Makefile 0.6%
Shell 0.2%