Python driver and command-line tool for [MKS mass flow controllers](http://www.mksinst.com/product/category.aspx?CategoryID=406).
<img src="http://www.mksinst.com/images/gseries.jpg" />
pip install mfc
If you don't like pip, you can also install from source:
git clone https://github.com/numat/mfc.git
python setup.py install
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.
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
You can optionally specify a setpoint flow and gas with e.g.
`mfc 192.168.1.150 --set 7.5 --set-gas O2`. See `mfc --help` for more.
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).
from mfc import FlowController
from tornado.ioloop import IOLoop, PeriodicCallback
"""This function gets run whenever a device responds."""
"""This function will be called in an infinite loop by tornado."""
flow_controller = FlowController('192.168.1.200')
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.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.