frappy_psi.nanov: minor fixes

Change-Id: I0c6f1f09358155f49d4dedfe0c254dbe6b514b36
This commit is contained in:
2025-11-05 16:37:42 +01:00
parent ebfb8a005d
commit 308283412e
2 changed files with 309 additions and 3 deletions

View File

@@ -45,18 +45,18 @@ class NanovIO(StringIO):
channel = self._channels[idx]
reply = float(self.communicate('FETCH?'))
if abs(reply) > 1000:
print('BAD', reply)
self.log.warning('bad reply: %s', reply)
return
channel.value = float(reply)
except IndexError:
idx = -1
now = time.time()
if now < self._last_change + 5 or (idx >= 0 and len(self._channels) == 1):
return idx
return
self._last_change = now
self._channel_index = idx = (idx + 1) % len(self._channels)
self.channel = self._channels[idx].channel
result = self.communicate(';SENS:CHAN %i;:SENS:CHAN?' % self.channel)
self.communicate(';SENS:CHAN %i;:SENS:CHAN?' % self.channel)
class Volt(HasIO, Readable):