Python drivers for InstruTech gauges over serial or TCP serial gateways
Project description
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
VGC301HornetIGM402- 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:
SESemission setting responses like0.1MA_EM/4.0MA_EMare parsed.RUaccepts long unit tokens (TORR,MBAR,PASCAL).- Optional command families (
RU/SU,RDIG*) raiseInstruTechUnsupportedCommandErroron firmware that returnsSYNTX ER. - Socket transport defaults to
\rcommand 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 viapyserialSocketTransport: 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 toreset_after=TrueVGC301.set_parity(...)defaults toreset_after=True- For ODD/EVEN parity, data bits default to 7; for NO parity, data bits default to 8
Error handling
Typical exceptions:
InstruTechTimeoutErrorInstruTechProtocolErrorInstruTechDeviceErrorInstruTechUnsupportedTransportOperationError
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.tomlversion 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file instrutech_gauges-0.1.2.tar.gz.
File metadata
- Download URL: instrutech_gauges-0.1.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f50048b3996320144def195550c160e9b928fe08f4106bb5af5beafec20a0c9f
|
|
| MD5 |
616d48c83c1717c1cfc88f6ba57e6c16
|
|
| BLAKE2b-256 |
a028bae804ac5dd4ce45b012d02009f9f4dc81842f6570d0db9c3e83583eaa82
|
Provenance
The following attestation bundles were made for instrutech_gauges-0.1.2.tar.gz:
Publisher:
publish.yml on ograsdijk/instrutech-gauges
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instrutech_gauges-0.1.2.tar.gz -
Subject digest:
f50048b3996320144def195550c160e9b928fe08f4106bb5af5beafec20a0c9f - Sigstore transparency entry: 1186558806
- Sigstore integration time:
-
Permalink:
ograsdijk/instrutech-gauges@866e5b7a108421d3e31ca2a9e5ee2e9edd9b0d26 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ograsdijk
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@866e5b7a108421d3e31ca2a9e5ee2e9edd9b0d26 -
Trigger Event:
push
-
Statement type:
File details
Details for the file instrutech_gauges-0.1.2-py3-none-any.whl.
File metadata
- Download URL: instrutech_gauges-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b2b54952173f99b96ad3c35e5a84cdd48b6579cfb47b70c50614b4f99b7ee8c
|
|
| MD5 |
4dfa79b9bddc34ca111c2c9f37cc9f4d
|
|
| BLAKE2b-256 |
cdbc92490a8dfce07ab2b57268c7917e5209cf34a848c7594a00efbf29c684e2
|
Provenance
The following attestation bundles were made for instrutech_gauges-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on ograsdijk/instrutech-gauges
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
instrutech_gauges-0.1.2-py3-none-any.whl -
Subject digest:
4b2b54952173f99b96ad3c35e5a84cdd48b6579cfb47b70c50614b4f99b7ee8c - Sigstore transparency entry: 1186558810
- Sigstore integration time:
-
Permalink:
ograsdijk/instrutech-gauges@866e5b7a108421d3e31ca2a9e5ee2e9edd9b0d26 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ograsdijk
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@866e5b7a108421d3e31ca2a9e5ee2e9edd9b0d26 -
Trigger Event:
push
-
Statement type: