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>
This commit is contained in:
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple test to verify basic waveform acquisition works.
|
||||
"""
|
||||
|
||||
from tektronix_base import TektronixOscilloscopeBase
|
||||
|
||||
|
||||
def main():
|
||||
"""Test single waveform acquisition from CH1"""
|
||||
|
||||
scope_ip = "192.168.10.105"
|
||||
print(f"Connecting to {scope_ip}...")
|
||||
|
||||
scope = TektronixOscilloscopeBase(resource_name=scope_ip, timeout=15.0)
|
||||
|
||||
try:
|
||||
scope.connect()
|
||||
print(f"✓ Connected to {scope.identify()}\n")
|
||||
|
||||
# Check current settings
|
||||
print("Current settings:")
|
||||
print(f" Data encoding: {scope.get_data_encoding()}")
|
||||
print(f" Data source: {scope.get_data_source()}")
|
||||
print(f" Record length: {scope.get_record_length()}")
|
||||
print(f" FastFrame state: {scope.get_fastframe_state()}\n")
|
||||
|
||||
# Ensure FastFrame is off
|
||||
if scope.get_fastframe_state():
|
||||
print("Disabling FastFrame...")
|
||||
scope.set_fastframe_state(False)
|
||||
|
||||
# Set data source to CH1
|
||||
print("Setting data source to CH1...")
|
||||
scope.set_data_source('CH1')
|
||||
|
||||
# Try to acquire a single waveform
|
||||
print("\nAttempting to acquire waveform from CH1...")
|
||||
print("(This will timeout if the scope isn't responding properly)\n")
|
||||
|
||||
waveform = scope.acquire_waveform('CH1')
|
||||
|
||||
print(f"✓ SUCCESS! Acquired {len(waveform)} samples")
|
||||
print(f" First 10 values: {waveform[:10]}")
|
||||
print(f" Min: {min(waveform)}, Max: {max(waveform)}")
|
||||
print(f" Average: {sum(waveform)/len(waveform):.2f}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"\n✗ Error: {type(e).__name__}: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
if scope.is_connected:
|
||||
scope.disconnect()
|
||||
print("\n✓ Disconnected")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user