diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-05 22:38:28 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-05 22:38:28 -0500 |
commit | 3f1aeba530eed7b4a5310f829e2214af1c551cb8 (patch) | |
tree | 7d2682f0966a8867e109d846cd1c4791ca79ba36 /qolab | |
parent | 80f87a4667bf318737a0e48027363fdda29665a1 (diff) | |
download | qolab-3f1aeba530eed7b4a5310f829e2214af1c551cb8.tar.gz qolab-3f1aeba530eed7b4a5310f829e2214af1c551cb8.zip |
added set point aquisition
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/i_server/i800.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/qolab/hardware/i_server/i800.py b/qolab/hardware/i_server/i800.py index 7743d84..bc87719 100644 --- a/qolab/hardware/i_server/i800.py +++ b/qolab/hardware/i_server/i800.py @@ -38,10 +38,41 @@ class I800(BasicInstrument): @BasicInstrument.tsdb_append def getTemperature(self): command='X01'; # give decimal representation (X) of the temperature (01 address) + return float(self.query(command)) + + def setPoinStr2value(self, spStr): + raw = int(spStr, 16) + if raw & (1<<23): + sign = -1 + else: + sign = 1 + + if raw & (0b1 << 20): + scale = 1 + elif raw & (0b10 << 20): + scale = 10 + elif raw & (0b11 << 20): + scale = 100 + elif raw & (0b100 << 20): + scale = 100 + else: + print('Error: unknown decimal point position') + return None + + val = raw & 0xFFFFF + return(sign*val/scale) + + @BasicInstrument.tsdb_append + def getSetPoin1(self): + command='R01' reply=self.query(command) - t = float(reply) - return t + return (self.setPoinStr2value(reply)) + @BasicInstrument.tsdb_append + def getSetPoin2(self): + command='R02' + reply=self.query(command) + return (self.setPoinStr2value(reply)) if __name__ == '__main__': tc = I800() |