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

Serial Handling Improvments #3

Closed lsgunth closed 7 years ago

lsgunth commented 7 years ago

Hi,

I've made some minor improvements to deal with a number of data corruption issues I've seen using this library. These changes have been working much better with my setup than the original code.

See the individual change logs for more information.

Thanks,

Logan

patrickfuller commented 7 years ago

Thanks for the pull request. I'll merge now and aim to test on my controllers early Jan. If it's good, I'll bump the version and upload to PyPI.

Regarding your comments - I've been running 6 alicats (2 controllers, 4 meters) in experimental setups for the last year or two, and I have found that I can't shake the communication stability issues. I think there's a strong hardware dependency, and a lot of the cruft you removed was originally added to handle one meter in particular. I'll test on both my regular meters and the temperamental one.

Thanks again!

lsgunth commented 7 years ago

Cool thanks.

I think the big thing is the timeout. If a response is on it's way but you miss it because of a timeout it's going to be a bit of racy mess trying to flush and retry. If it still doesn't work for you, try increasing the timeout some more. If that then still doesn't work, you may have hardware/cabling issues. If necessary add back some of the cruft, but if you're going to retry you need to keep the timeout high to make sure that the response wasn't simply late.

Anyway, thanks for the library, it made my job a bit quicker!

Logan