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.3

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.3
File Size Uploaded
instrutech_gauges-0.3.3.tar.gz 10.1 kB Details

Built distribution (wheel)

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

Total release size:23.9 kB

Release files / instrutech_gauges-0.3.3.tar.gz

Download URL instrutech_gauges-0.3.3.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
41ae54a6b44e0dc0620b96da307b939b128f9ab55a150ffde62072b7d821e189
BLAKE2b-256 checksum
How to use checksums
12b40a15722cc1f3008206830e820f37812c141d83fb20c9ade4b788dfd073c8
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 Aug 29, 2026.

Transparency log

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

Download URL instrutech_gauges-0.3.3-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2200542440e56a45548de6a770a2d3dc3b1fdb7c5b60acbf18bc7a454e34780c
BLAKE2b-256 checksum
How to use checksums
6c39869e6e8fc4c7381ca778f7819ce895f396aee41d8f154491903c5a7c42f9
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 Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.4

2 release files

This release

0.3.3 This release

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