Commit cc69162b authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Agilent pressure bug fixed

parent 9c650c80
......@@ -79,8 +79,14 @@ class pumpAgilent:
def getPressure(self):
stat = self.serWriteAndRecieve(b"\002\200\062\062\064\060\003\070\067")
if stat is not None:
stat = stat[4: 12]
return float(stat)
print(":".join("{:02x}".format(ord(c)) for c in stat))
hdr = stat.find("2240")
stat = stat[hdr + 3: hdr + 11]
try:
pressure = float(stat)
except ValueError:
pressure = 1.20E+03
return pressure
return 1.20E+03
def getRpm(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment