Skip to main content

tools for communicating with Bronkhorst MFCs with the API for BM31

Project description

repository for communicating with Bronkhorst MFCs remotely. Intended to be used with Pylatus or similar scripting environment. To install, clone the repository, then run 'pip install -e .' inside. This will create the bronkhorstServer program. Can also get from PyPi, 'pip install bronkhorstControlbm31'

Usage: On the PC connected to the MFCs run bronkhorstServer in a terminal. Options are -c/--com input the com number as an integer (default 1, but check com ports in Device Manager), this will save next time you run so you shouldn't need to input it again. -p/--port port number, (default is value in the script, probably unnecessary to change). A positional argument which can be 'local' or 'remote' (default local). If remote the hostname will be displayed to connect from another computer, otherwise it will be 'localhost'. The port number will also be displayed.

e.g.

bronkhorstServer remote -c 7

To send commands import the MFCclient class and connect function, then run it's methods. Initial arguments are MFC address (will be an integer), the IP address (default localhost) and the port (default is that in the script).

E.g.

from bronkhorstControlbm31.bronkhorstClient import MFCclient

MFCclient(3,'<hostname or ip address>').pollAll()

(this gives information about all MFCs that are connected in a dataframe, the MFC address isn't used and can be anything in this case).

To change setpoint on MFC address 3:

MFCclient(3,'<hostname or ip address>').writeSetpoint(value)

A second server is available for accepting multiple clients:

bronkhorstMultiServer remote

then for the client use multi=True:

MFCclient(3,'<hostname or ip address>', multi=True).pollAll()

There are also 2 other functions in bronkhorstClient called barPlot() and timePlot() which can be run in conjunction with the bronkhorstMultiServer. Takes host as a required aguement. These are also packaged as executables, so run e.g. 'timePlot <hostname>'

I should mention this article https://realpython.com/python-sockets/ and the associated repository which helped me to make this.

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

bronkhorstcontrolbm31-1.2.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

bronkhorstControlbm31-1.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file bronkhorstcontrolbm31-1.2.0.tar.gz.

File metadata

  • Download URL: bronkhorstcontrolbm31-1.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for bronkhorstcontrolbm31-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6a90d6a94c2f2fdb8db6e5c407db5bcc158673e12032f8f88bea5fd2e3249842
MD5 cd2278d64683c36ac076f8674dc8d8db
BLAKE2b-256 1b9ee44709ad42aab0f7c5f80f78ce8aa40187307c9f49d60e627d5cdd1c3e98

See more details on using hashes here.

File details

Details for the file bronkhorstControlbm31-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bronkhorstControlbm31-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e66be81ef490ed9240e5463f05b49040dceb044c84b9428033ffc3fef844981
MD5 820d4efebde8fed63037140b547fd9ab
BLAKE2b-256 faa4632ea6f7ba6be8bfef99a1a6c65f9ff47be9db00792e9b3de2f2cbc29d0d

See more details on using hashes here.

Supported by

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