numat / alicat

Python driver and command line tool for Alicat mass flow controllers.
GNU General Public License v2.0
21 stars 27 forks source link

Cannot call two set functions in series #2

Closed patrickfuller closed 9 years ago

patrickfuller commented 9 years ago

Controller setters commonly fail and need to be re-run. This should be solved with a retry loop.

patrickfuller commented 9 years ago

It turns out that this bug is due to the controller sending two lines of data after receiving a set command. For example:

command = "AS0.10"  # Set flow to 0.1
controller.connection.write(command)
print(controller.ser.readline())  # 0.1000
print(controller.ser.readline())  # A +093.53 +029.49 +00.007 +00.044 00.100     Air
print(controller.ser.readline())  # Empty

Setting the gas does something similar.