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.

Usage

The device can be simply opened via context management 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.1.tar.gz (7.0 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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybpg400-tspspi-0.0.1.tar.gz
  • Upload date:
  • Size: 7.0 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.1.tar.gz
Algorithm Hash digest
SHA256 7403cc153724d91da1134de6c8a68de283e8a92ed038c35dd05577d6d0e5cf68
MD5 99874bef2c9c64be1797c51587b93672
BLAKE2b-256 9326737cebc7fdcbbff84b5f4857aada8403b8077b253b287d72920659ea882a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pybpg400_tspspi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec8dc6e6a4ddefa3969004e84c23a974c67ad5713295107b451139ecb782e1a2
MD5 672b89b8a71422b021e26110a89b9bf9
BLAKE2b-256 887d519c55ec27ef05627a69a6a3378a269ec3478768c2874444b7417ade7c1d

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