Skip to main content

Unofficial library to control and read the BPG400 pressure gauge via RS232C interface

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybpg400-tspspi-0.0.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybpg400_tspspi-0.0.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file pybpg400-tspspi-0.0.2.tar.gz.

File metadata

  • Download URL: pybpg400-tspspi-0.0.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for pybpg400-tspspi-0.0.2.tar.gz
Algorithm Hash digest
SHA256 342ab72dcc20bb17dd5f33e1109748f9195465351ccc5c76ab3a0e817278f4d5
MD5 faccba1b92715641f7d54cbe2c4ed2dc
BLAKE2b-256 70e704b73fe5b63d968770742e7a60995b282fc537b10b1004af265dd332cfb3

See more details on using hashes here.

File details

Details for the file pybpg400_tspspi-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pybpg400_tspspi-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2236e20396f855bc4383151ae5f991b36c1031ed82c079209b782b42f6cd8d48
MD5 3f5ba9a420b3e67cdadb9a344206a2ba
BLAKE2b-256 dd6457c1679e8d8943f5b562fe86f92dc12b5fdd45d9ffcf25b41065c7db3345

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page