Skip to main content

pybpg400: Unofficial Python library to control and access the INFICON BPG400 pressure gauge (via RS232C)

This is an unofficial Python library (and a mini CLI utility) to control and access the INFICON BPG400 pressure gauge via it's RS232C serial port.

Installation

This library (and the CLI utility) is provided via PyPi:

pip install pybpg400-tspspi

Usage

More elaborate examples can be found in the examples folder.

The device can be simply opened via context management routines (in addition to imperative connect() and disconnect() routines):

from bpg400.bpg400 import RPG400_RS232
from labdevices.pressuregauge import PressureGaugeUnit

with BPG400_RS232("/dev/ttyUSB0") as pg:
	# Perform your operations

The library starts an background thread that continuously parses the datastream received by the BPG400 pressure gauge. To query the latest pressure reading one can simply use the get_pressure method. This method also allows one to supply the unit - it defaults to mbar:

print(pg.get_pressure())

or

print(pg.get_pressure(PressureGaugeUnit.TORR))

One can simply change the display unit using the set_unit method:

pg.set_unit(PressureGaugeUnit.MBAR)
pg.set_unit(PressureGaugeUnit.TORR)
pg.set_unit(PressureGaugeUnit.PASCAL)

The CLI utility

The package also comes with a simple command line utility called bpg400.

One can for example simply query the current pressure using a single shell command:

bpg400 --port /dev/ttyU0``` query
Usage: bpg400 [OPTIONS] command

Controls or queries the BPG400 pressure gauge via a RS232C
serial interface.

Options:

	--port PORTNAME
		Specifies the serial port device to use
	--json
		Sets output format to JSON for further processing
	--debug
		Run in debug mode (dump RX and TX packets)

Supported commands:

	query
		Query the current pressure in the set unit
	setmbar
		Set display unit to millibar
	settorr
		Set display unit to torr
	setpa
		Set display unit to pascal
	degas
		Enable degas mode
	nodegas
		Stop degas mode
	sleep N
		Sleep N seconds before performing next command

Release files for pybpg400-tspspi 0.0.2

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

Source distribution (sdist)

Source distribution for pybpg400-tspspi 0.0.2
File Size Uploaded
pybpg400-tspspi-0.0.2.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybpg400-tspspi 0.0.2
File Interpreter ABI Platform
pybpg400_tspspi-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / pybpg400-tspspi-0.0.2.tar.gz

Download URL pybpg400-tspspi-0.0.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
342ab72dcc20bb17dd5f33e1109748f9195465351ccc5c76ab3a0e817278f4d5
BLAKE2b-256 checksum
How to use checksums
70e704b73fe5b63d968770742e7a60995b282fc537b10b1004af265dd332cfb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.13

Release files / pybpg400_tspspi-0.0.2-py3-none-any.whl

Download URL pybpg400_tspspi-0.0.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2236e20396f855bc4383151ae5f991b36c1031ed82c079209b782b42f6cd8d48
BLAKE2b-256 checksum
How to use checksums
dd6457c1679e8d8943f5b562fe86f92dc12b5fdd45d9ffcf25b41065c7db3345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

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