changes, final for today

This commit is contained in:
david rice
2026-04-02 16:17:47 +01:00
parent c61476e846
commit 37aef9e5f7

View File

@@ -176,23 +176,22 @@ def _set_timebase(scale, points):
def _arm_and_wait(timeout=20): def _arm_and_wait(timeout=20):
""" """
Fire a single acquisition and block until the scope stops (trigger + capture done). Fire a single acquisition using :DIGitize (blocking on Infiniium) and
Returns True on success, False on timeout. confirm completion with *OPC?. Temporarily extends scope.timeout to
cover the full wait period.
Returns True on success, False on error/timeout.
""" """
scope.write(":SINGle") prev_timeout = scope.timeout
deadline = time.time() + timeout
while time.time() < deadline:
try: try:
# OPERegister bit 3 (mask 0x08) = instrument is running/armed. scope.timeout = timeout + 5 # headroom over the DIGitize wait
# When it clears the acquisition is complete. scope.write(":DIGitize")
cond = int(scope.ask(":OPERegister:CONDition?").strip()) resp = scope.ask("*OPC?").strip()
if not (cond & 0x08): return resp == "1"
return True except Exception as e:
except Exception: print(f" ACQUIRE ERROR: {e}")
pass
time.sleep(0.25)
print(" WARNING: ACQUISITION TIMEOUT — SCOPE MAY NOT HAVE TRIGGERED.")
return False return False
finally:
scope.timeout = prev_timeout
def _save_pass(tag, iteration, ts): def _save_pass(tag, iteration, ts):