Skip to main content

instrutech-gauges

Python drivers for InstruTech gauges over serial or TCP serial gateways.

Install

uv add instrutech-gauges

Or for local development:

uv sync

Available drivers

  • VGC301
  • HornetIGM402
  • Public base class for custom devices: InstruTechAsciiGauge

Quick start (VGC301)

from instrutech_gauges import SerialTransport, VGC301

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = VGC301(t, address=1)

with g:
    print(g.read_sw_version())
    print(g.read_pressure_torr())
    g.set_trip_point(1, "on_below", 4.00e2)
    print(g.read_trip_point(1, "on_below"))

Quick start (Hornet IGM402)

from instrutech_gauges import HornetIGM402, SerialTransport

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = HornetIGM402(t, address=1)

with g:
    print(g.read_sw_version())
    print(g.read_system_pressure_torr())
    print(g.read_pressure_unit())

Firmware notes for HornetIGM402:

  • SES emission setting responses like 0.1MA_EM / 4.0MA_EM are parsed.
  • RU accepts long unit tokens (TORR, MBAR, PASCAL).
  • Optional command families (RU/SU, RDIG*) raise InstruTechUnsupportedCommandError on firmware that returns SYNTX ER.
  • Socket transport defaults to \r command termination.

Without context manager (with)

Use explicit open() / close() with try/finally:

from instrutech_gauges import SerialTransport, VGC301

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = VGC301(t, address=1)

g.open(probe=True)
try:
    print(g.read_sw_version())
    print(g.read_pressure_torr())
finally:
    g.close()
from instrutech_gauges import HornetIGM402, SerialTransport

t = SerialTransport(port="/dev/ttyUSB0", baudrate=19200, timeout_s=0.3)
g = HornetIGM402(t, address=1)

g.open(probe=True)
try:
    print(g.read_sw_version())
    print(g.read_system_pressure_torr())
finally:
    g.close()

Public base class

InstruTechAsciiGauge exposes shared protocol and transport helpers for building new drivers:

  • framing/parsing (#xx...<CR>, *xx...<CR>)
  • query() / query_float() / command_prog_ok()
  • serial reconfiguration (set_baud, set_parity, set_serial_comm)
  • common Mini-Convectron-style commands (VER, RD, TS, TZ, SL/SH, RL/RH, FAC, RST)

Minimal custom driver:

from instrutech_gauges import InstruTechAsciiGauge

class MyGauge(InstruTechAsciiGauge):
    def read_custom_value(self) -> float:
        return self.query_float("RDCUSTOM")

Transport

  • SerialTransport: local serial via pyserial
  • SocketTransport: TCP serial gateways (raw TCP)

SocketTransport defaults to CR (\r) command termination. If your gateway expects CRLF, override it:

from instrutech_gauges import SocketTransport

t = SocketTransport("192.168.1.50", 4001, timeout_s=1.0, write_terminator=b"\r\n")

Runtime serial reconfiguration (set_baud, set_parity) is supported only with SerialTransport.

VGC301 serial notes

Per the VGC301 manual, SB* / SP* / SA* / FAC require RST before they take effect.

  • VGC301.set_baud(...) defaults to reset_after=True
  • VGC301.set_parity(...) defaults to reset_after=True
  • For ODD/EVEN parity, data bits default to 7; for NO parity, data bits default to 8

Error handling

Typical exceptions:

  • InstruTechTimeoutError
  • InstruTechProtocolError
  • InstruTechDeviceError
  • InstruTechUnsupportedTransportOperationError

Release flow

  • CI runs on every push and PR (.github/workflows/ci.yml).
  • PyPI publish runs only on tags that start with v (.github/workflows/publish.yml).
  • Publish is blocked unless tag version matches pyproject.toml version exactly.

Example release:

git tag v0.1.1
git push origin v0.1.1

Configure PyPI Trusted Publisher for this repository so the publish workflow can upload without storing an API token.

Release files for instrutech-gauges 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instrutech-gauges 0.3.4
File Size Uploaded
instrutech_gauges-0.3.4.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instrutech-gauges 0.3.4
File Interpreter ABI Platform
instrutech_gauges-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size:24.0 kB

Release files / instrutech_gauges-0.3.4.tar.gz

Download URL instrutech_gauges-0.3.4.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
497fa0d549be61eb33ef595208c83d6233ff835b74f0976c5cfd235fe93d6527
BLAKE2b-256 checksum
How to use checksums
70cc24500d72e34d4a66d8a9c0a6a1a8302a4f45c19722400f0b57461432af6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / instrutech_gauges-0.3.4-py3-none-any.whl

Download URL instrutech_gauges-0.3.4-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c6784e6cae4805441efaffa1bc7959441c99c31d11d29de3f7dc19fe9d0f312
BLAKE2b-256 checksum
How to use checksums
4dd2ecf87e5d9775fb3ad6df9373c5cfb227c267ddfa16859a661ddda189004b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page