Skip to main content

brooks-mfc

Python driver and command-line tool for Brooks Instrument mass flow controllers.

Installation

pip install brooks-mfc

Usage

This driver uses an undocumented REST API in the devices's web interface for communication. The compatibility and stability of this interface with all Brooks controllers is not guaranteed.

Command Line

To test your connection and stream real-time data, use the command-line interface. You can read the flow rate with:

$ brooks-mfc 192.168.1.200
{
    "Customer Flow Totalizer": 0.0,
    "Flow": -0.3,
    "Flow Hours": 1.0,
    "Flow Totalizer": 0.0,
    "Live Setpoint": 0.0,
    "Operational Hours": 50.0,
    "Setpoint": 0.0,
    "Supply Voltage": 22.93,
    "Temperature": 27.11,
    "Valve Position": 0.0
}

You can optionally specify a setpoint flow with the set flag: brooks-mfc 192.168.1.150 --set 7.5. The units of the setpoint and return are specified using the --units flag. See mfc --help for more.

Python

This uses Python ≥3.5's async/await syntax to asynchronously communicate with the mass flow controller. For example:

import asyncio
from brooks_mfc import FlowController

async def get():
    async with FlowController('the-mfc-ip-address') as fc:
        print(await fc.get())

asyncio.run(get())

The API that matters is get, set. Optionally, units can be passed with either command. If no units are specified the existing units configured for the device are used.

>>> await fc.get()
>>> await fc.get('%')
{
    "Customer Flow Totalizer": 0.0,
    "Flow": -0.3,
    "Flow Hours": 1.0,
    "Flow Totalizer": 0.0,
    "Live Setpoint": 0.0,
    "Operational Hours": 50.0,
    "Setpoint": 0.0,
    "Supply Voltage": 22.93,
    "Temperature": 27.11,
    "Valve Position": 0.0
}
>>> await fc.set(10)
>>> await fc.set(10, 'SCCM')

There's much more that could be set or returned from the flow controllers but I haven't had a reason to flesh all the the options out. Feel free to submit an issue with requests or a PR.

Metadata

Release files for brooks-mfc 0.1.4

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

Source distribution (sdist)

Source distribution for brooks-mfc 0.1.4
File Size Uploaded
brooks_mfc-0.1.4.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brooks-mfc 0.1.4
File Interpreter ABI Platform
brooks_mfc-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.9 kB

Release files / brooks_mfc-0.1.4.tar.gz

Download URL brooks_mfc-0.1.4.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
21407557d1d186baedb038a0b6476032d5a7f04d5b98442afb88e90c8ca7cdda
BLAKE2b-256 checksum
How to use checksums
79325c24607919c5692b3bdcf2204c28ccccdaa56d0d41e5b1a32af2bea5e7dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.7 Darwin/19.6.0

Release files / brooks_mfc-0.1.4-py3-none-any.whl

Download URL brooks_mfc-0.1.4-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65b7199bab7ebd910ef75a35e8493624d706408159cf82003ecff3b7644552c4
BLAKE2b-256 checksum
How to use checksums
9a29034418fd4996c38fa593f19dfddce6c40bf4ad5079bb6e36b32b34d4196e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.7 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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