changes, final for today
This commit is contained in:
27
mipi_test.py
27
mipi_test.py
@@ -176,23 +176,22 @@ def _set_timebase(scale, points):
|
||||
|
||||
def _arm_and_wait(timeout=20):
|
||||
"""
|
||||
Fire a single acquisition and block until the scope stops (trigger + capture done).
|
||||
Returns True on success, False on timeout.
|
||||
Fire a single acquisition using :DIGitize (blocking on Infiniium) and
|
||||
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")
|
||||
deadline = time.time() + timeout
|
||||
while time.time() < deadline:
|
||||
prev_timeout = scope.timeout
|
||||
try:
|
||||
# OPERegister bit 3 (mask 0x08) = instrument is running/armed.
|
||||
# When it clears the acquisition is complete.
|
||||
cond = int(scope.ask(":OPERegister:CONDition?").strip())
|
||||
if not (cond & 0x08):
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
time.sleep(0.25)
|
||||
print(" WARNING: ACQUISITION TIMEOUT — SCOPE MAY NOT HAVE TRIGGERED.")
|
||||
scope.timeout = timeout + 5 # headroom over the DIGitize wait
|
||||
scope.write(":DIGitize")
|
||||
resp = scope.ask("*OPC?").strip()
|
||||
return resp == "1"
|
||||
except Exception as e:
|
||||
print(f" ACQUIRE ERROR: {e}")
|
||||
return False
|
||||
finally:
|
||||
scope.timeout = prev_timeout
|
||||
|
||||
|
||||
def _save_pass(tag, iteration, ts):
|
||||
|
||||
Reference in New Issue
Block a user