improvements when testing leiden
- triple current source - software loop
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
from frappy.core import StringIO, HasIO, Writable, Parameter, Property, FloatRange, IntRange, BoolType, \
|
||||
ERROR
|
||||
from frappy.errors import CommunicationFailedError, HardwareError
|
||||
from frappy.ctrlby import WrapControlledBy
|
||||
|
||||
|
||||
class IO(StringIO):
|
||||
@@ -36,7 +37,7 @@ class Heater(HasIO, Writable):
|
||||
channel = Property('channel (source number)', IntRange(1, 3))
|
||||
value = Parameter('current reading', FloatRange(0, 0.1, unit='A'))
|
||||
target = Parameter('current target value', FloatRange(0, 0.1, unit='A'), readonly=False)
|
||||
on = Parameter('turn current on/off', BoolType(), readonly=False)
|
||||
on = Parameter('turn current on/off', BoolType(), readonly=False, default=False)
|
||||
|
||||
def query_status(self):
|
||||
reply, txtvalue = self.communicate('STATUS?').split('\t')
|
||||
@@ -64,13 +65,14 @@ class Heater(HasIO, Writable):
|
||||
if reply != '0': # not as in manual
|
||||
raise CommunicationFailedError(f'Bad reply: {reply!r}')
|
||||
|
||||
def read_target(self):
|
||||
def read_value(self):
|
||||
txtvalue = self.query_status()
|
||||
current_range = txtvalue[(self.channel - 1) * 4 + 1]
|
||||
current = txtvalue[(self.channel - 1) * 4 + 1 + 1] # percent of range
|
||||
multipliers = {'1': 99e-6, '2': 990e-6, '3': 9900e-6, '4': 99e-3}
|
||||
multipliers = {'1': 1e-4, '2': 1e-3, '3': 1e-2, '4': 1e-1}
|
||||
value = float(current) / 100 * float(multipliers[current_range])
|
||||
return value
|
||||
|
||||
# no measured value available
|
||||
read_value = read_target
|
||||
|
||||
class WrappedHeater(WrapControlledBy, Heater):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user