Skip to main content
mfc
===

Python driver and command-line tool for [MKS mass flow controllers](http://www.mksinst.com/product/category.aspx?CategoryID=406).

<p align="center">
<img src="http://www.mksinst.com/images/gseries.jpg" />
</p>

Installation
============

```
pip install mfc
```

If you don't like pip, you can also install from source:

```
git clone https://github.com/numat/mfc.git
cd mfc
python setup.py install
```

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,
"connected": true,
"ip": "192.168.1.200",
"setpoint": 5.00,
"temperature": 27.34
}

```

You can optionally specify a setpoint flow with e.g. `mfc 192.168.1.150 --set 7.5`.
See `mfc --help` for more.

###Python (Asynchronous)

Asynchronous programming allows us to send out all of our requests in parallel, and
then handle responses as they trickle in. For more information, read through
[krondo's twisted introduction](http://krondo.com/?page_id=1327).

```python
from mfc import FlowController
from tornado.ioloop import IOLoop, PeriodicCallback

def on_response(response):
"""This function gets run whenever a device responds."""
print(response)

def loop():
"""This function will be called in an infinite loop by tornado."""
flow_controller.get(on_response)

flow_controller = FlowController('192.168.1.200')

PeriodicCallback(loop, 500).start()
IOLoop.current().start()
```

This looks more complex, but the advantages are well worth it at scale.
Essentially, sleeping is replaced by scheduling functions with tornado. This
allows your code to do other things while waiting for responses.

Metadata

Release files for mfc 0.2.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.2.3
File Size Uploaded
mfc-0.2.3.tar.gz 11.4 kB Details

Built distribution (wheel)

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

Total release size: 16.4 kB

Release files / mfc-0.2.3.tar.gz

Download URL mfc-0.2.3.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b589824618c461babbd2ee86468d9850b662c48443715f5f84d7177a51b4ee45
BLAKE2b-256 checksum
How to use checksums
fc97270b9b267d7b2947435d61577c778556f8720e1ecc40af1b0db0363b6365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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

Download URL mfc-0.2.3-py2.py3-none-any.whl
Size 5.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
fef99b68a3aeec4c6ec7b34f4785d30d5da28a061423d06d0e2a015b26b7b67f
BLAKE2b-256 checksum
How to use checksums
0fbffa7d7f66962dec66a454ba010c22376a1a6d3e5ed60db45d1d7577c81a4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.3

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

This release

0.2.3 This release

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