numat / mfc

Python driver and command line tool for MKS mass flow controllers.
GNU General Public License v2.0
9 stars 1 forks source link

Using .set() function #3

Closed unmanned15 closed 5 years ago

unmanned15 commented 5 years ago

@patrickfuller .set(##.#) function is returning NoneType in python script? I can get it to work in command line but is there a way to use .set() within a python script? I am trying to set the flow controller to a particular setpoint but would like to do it in a script.

Thanks for your help!

patrickfuller commented 5 years ago

Hi,

set works but it only supports asynchronous usage.

First, copy-paste the README tornado example to see if that works. Then, replace get with set. From the source, set won't return anything but does allow a no-arg callback to fire on completion.

Hope this helps, Pat

unmanned15 commented 5 years ago

Thanks! Adding the callback parameter in the set worked!