From 81447d92c4d29aac9271c5f8ffce3aab68e765b5 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 24 Jul 2024 10:16:21 -0400 Subject: bug fix: first change scale then offset apparently on Rigol scope offset stored in units of volts per division (or something similar). So order of operations is important. --- qolab/hardware/scope/_basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qolab/hardware/scope') diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index 7cabf3b..751026d 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -212,10 +212,10 @@ class Scope(BasicInstrument): vPerDiv = signal_range / (self.vertDivOnScreen * (1 - margin * 1.2)) if vPerDiv < self.minVoltsPerDiv: vPerDiv = self.minVoltsPerDiv - logger.debug(f"Auto Scaler Requesting {offset=} for {chNum=}.") - self.setChanVoltageOffset(chNum, offset) logger.debug(f"Auto Scaler Requesting {vPerDiv=} for {chNum=}.") self.setChanVoltsPerDiv(chNum, vPerDiv) + logger.debug(f"Auto Scaler Requesting {offset=} for {chNum=}.") + self.setChanVoltageOffset(chNum, offset) relOffsetChange = abs(old_offset - offset) / old_vPerDiv relVperDivChange = abs(old_vPerDiv - vPerDiv) / old_vPerDiv if (relOffsetChange < 0.5) and (relVperDivChange < 0.05): -- cgit v1.2.3