diff --git a/secop_psi/ls370res.py b/secop_psi/ls370res.py index 26786ae..27e1a33 100644 --- a/secop_psi/ls370res.py +++ b/secop_psi/ls370res.py @@ -120,6 +120,11 @@ class Main(HasIodev, Drivable): self.status = [Status.BUSY, 'switching'] return channel + def write_autoscan(self, value): + scan.send_change(self, self.value, value) + # self.sendRecv('SCAN %d,%d;SCAN?' % (channel, self.autoscan)) + return value + class ResChannel(HasIodev, Readable): """temperature channel on Lakeshore 336""" @@ -158,16 +163,24 @@ class ResChannel(HasIodev, Readable): dwell = Parameter('dwell time with autoscan', datatype=FloatRange(1, 200), readonly=False, handler=inset) filter = Parameter('filter time', datatype=FloatRange(1, 200), readonly=False, handler=filterhdl) + _trigger_read = False + def initModule(self): self._main = self.DISPATCHER.get_module(self.main) self._main.register_channel(self) def read_value(self): - if self.channel != self._main.value: - return Done if not self.enabled: self.status = [self.Status.DISABLED, 'disabled'] return Done + if self.channel != self._main.value: + if self.channel == self._main.target: + self._trigger_read = True + return Done + if not self._trigger_read: + return Done + # we got here, when we missed the idle state of self._main + self._trigger_read = False result = self.sendRecv('RDGR?%d' % self.channel) result = float(result) if self.autorange == 'soft':