Skip to main content

mfc

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

Installation

pip install mfc

If you want the older python2/tornado driver, use pip install mfc==0.2.11 and review this README.

Usage

This driver uses the ethernet port on the side of the device for communication. If you use this driver, you only need to provide power to the top ports.

Command Line

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

$ mfc 192.168.1.200
{
  "actual": 4.99,
  "gas": "CO2",
  "max": 37,
  "setpoint": 5.00,
  "temperature": 27.34
}

You can optionally specify a setpoint flow and/or gas with e.g. mfc 192.168.1.150 --set 7.5 --set-gas N2. 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 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, and set_gas.

>>> await fc.get()
{
  "actual": 4.99,
  "gas": "CO2",
  "max": 37,
  "setpoint": 5.00,
  "temperature": 27.34
}
>>> await fc.set(10)
>>> await fc.open()   # set to max flow
>>> await fc.close()  # set to zero flow
>>> await fc.set_gas('N2')

There is also set_display, which will only work on devices that support it.

>>> await fc.set_display('flow')

Metadata

Release files for mfc 0.3.3

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

Source distribution (sdist)

Source distribution for mfc 0.3.3
File Size Uploaded
mfc-0.3.3.tar.gz 13.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mfc 0.3.3
File Interpreter ABI Platform
mfc-0.3.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 27.1 kB

Release files / mfc-0.3.3.tar.gz

Download URL mfc-0.3.3.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
af5cc42d8c8db4598b9f2d2f6c4df814d42ed5123134ba66fb2c3e01774386e7
BLAKE2b-256 checksum
How to use checksums
dade28d20d1050675adfb085343e2814c52f54d2e28af113b8e80d112e11b057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

Release files / mfc-0.3.3-py2.py3-none-any.whl

Download URL mfc-0.3.3-py2.py3-none-any.whl
Size 13.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3dceed04d44002479c5665979eb277a716198bc40093584acc1fd9daa9fbcee1
BLAKE2b-256 checksum
How to use checksums
8a4097d0b3c7bc6faa4573c2edfa3828ce25f7d0b46164e850243e6744026e61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.11

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

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