aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'qolab/hardware')
-rw-r--r--qolab/hardware/i_server/i800.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/qolab/hardware/i_server/i800.py b/qolab/hardware/i_server/i800.py
index 0e83444..318be11 100644
--- a/qolab/hardware/i_server/i800.py
+++ b/qolab/hardware/i_server/i800.py
@@ -7,9 +7,14 @@ Querying of this controller is slo-o-o-w at least 0.2 second and can be longer.
"""
from qolab.hardware.basic import BasicInstrument
+from cachetools import cached, TTLCache
import socket
class I800(BasicInstrument):
+ """ Newport i800 series controller, should work with similar Omega controllers """
+ TTL_MEASURED = 30 # Time To Live for device measured things, i.e. Temperature
+ TTL_SEATABLES = 600 # Time To Live for user seatables, i.e. SetPoints, Gains, etc
+
def __init__(self, *args, host='192.168.1.200', port=1000, **kwds):
"""
host - default hostname or IP of the controller unit (192.168.1.200) is factory default
@@ -38,6 +43,7 @@ class I800(BasicInstrument):
return reply[5:-1] # last symbol is '\r'
@BasicInstrument.tsdb_append
+ @cached(cache=TTLCache(maxsize=1, ttl=TTL_MEASURED))
def getTemperature(self):
command='X01'; # give decimal representation (X) of the temperature (01 address)
return float(self.query(command))
@@ -65,12 +71,14 @@ class I800(BasicInstrument):
return(sign*val/scale)
@BasicInstrument.tsdb_append
+ @cached(cache=TTLCache(maxsize=1, ttl=TTL_SEATABLES))
def getSetPoint1(self):
command='R01'
reply=self.query(command)
return (self.setPoinStr2value(reply))
@BasicInstrument.tsdb_append
+ @cached(cache=TTLCache(maxsize=1, ttl=TTL_SEATABLES))
def getSetPoint2(self):
command='R02'
reply=self.query(command)