From fbd5d3b71cdc120c75c0f60737c4faf8d10ac4f2 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 23 Jul 2024 13:31:22 -0400 Subject: added sleep time to let scope settle after settings change --- qolab/hardware/scope/_basic.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qolab/hardware/scope/_basic.py') diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index f86c3b3..b9020f1 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -172,6 +172,7 @@ class Scope(BasicInstrument): starttime = time.time() deadline = starttime + timeout + timespan = self.getTimePerDiv()*self.horizDivOnScreen scaled_corectly = False # maximally zoom out to get full signal self.setChanVoltageOffset(chNum, 0) @@ -179,6 +180,7 @@ class Scope(BasicInstrument): self.setRun(True) while (not scaled_corectly) and (time.time() < deadline): + time.sleep(timespan + 0.5) # give enough time to acquire a trace and switch to Run tr = self.getTrace(chNum) vPerDiv = self.getChanVoltsPerDiv(chNum) offset = self.getChanVoltageOffset(chNum) @@ -197,9 +199,9 @@ class Scope(BasicInstrument): break offset = -(tr_max + tr_min) / 2 vPerDiv = (tr_max - tr_min) / (self.vertDivOnScreen * (1 - margin * 1.2)) - logger.info(f"Requesting {offset=} for {chNum=}.") + logger.debug(f"Auto Scaler Requesting {offset=} for {chNum=}.") self.setChanVoltageOffset(chNum, offset) - logger.info(f"Requesting {vPerDiv=} for {chNum=}.") + logger.debug(f"Auto Scaler Requesting {vPerDiv=} for {chNum=}.") self.setChanVoltsPerDiv(chNum, vPerDiv) scaled_corectly = False if time.time() > deadline: -- cgit v1.2.3