Skip to content
Snippets Groups Projects
Commit cc69162b authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Agilent pressure bug fixed

parent 9c650c80
Branches
No related tags found
No related merge requests found
...@@ -79,8 +79,14 @@ class pumpAgilent: ...@@ -79,8 +79,14 @@ class pumpAgilent:
def getPressure(self): def getPressure(self):
stat = self.serWriteAndRecieve(b"\002\200\062\062\064\060\003\070\067") stat = self.serWriteAndRecieve(b"\002\200\062\062\064\060\003\070\067")
if stat is not None: if stat is not None:
stat = stat[4: 12] print(":".join("{:02x}".format(ord(c)) for c in stat))
return float(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 return 1.20E+03
def getRpm(self): def getRpm(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment