Files
scanengine-3/pymso/test_simple_query.py
T
Thomas Ales [M S E] fc43fbe4b0 Initial commit: merge nuescan, pymso, pybbd202, and pypewpewhops into scanengine-3
- Merged four separate hardware control projects into unified platform
- Created unified requirements.txt with all dependencies
- Added comprehensive .gitignore
- Added project overview README

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 20:11:31 -06:00

57 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""
Simple test to debug query timeout issues.
"""
from tektronix_base import TektronixOscilloscopeBase
import time
def main():
"""Test simple queries with the oscilloscope"""
scope_ip = "192.168.10.105"
print(f"Connecting to oscilloscope at {scope_ip}...")
scope = TektronixOscilloscopeBase(resource_name=scope_ip, timeout=10.0)
try:
# Connect
scope.connect()
print("✓ Connected")
# Wait a moment to ensure connection is stable
time.sleep(0.5)
# Try a simple query
print("\nSending *IDN? query...")
idn = scope.query("*IDN?")
print(f"✓ Response: {idn}")
# Try acquisition mode query
print("\nSending ACQuire:MODe? query...")
mode = scope.query("ACQuire:MODe?")
print(f"✓ Current mode: {mode}")
# Set mode to sample using short form
print("\nSetting mode to SAM (short form)...")
scope.set_acquire_mode("SAM")
# Verify
mode = scope.get_acquire_mode()
print(f"✓ Mode is now: {mode}")
except Exception as e:
print(f"✗ Error: {type(e).__name__}: {e}")
import traceback
traceback.print_exc()
finally:
if scope.is_connected:
scope.disconnect()
print("\n✓ Disconnected")
if __name__ == "__main__":
main()