ethercat-linux/uia_edits.py
Tony Cao 3a26aea082 2kHz spin-lock mode: RTT halved to 2ms, per-byte XOR proof at 500us cycle
- ticker: --spin mode polls FPRD until payload changes (phase-locks
  processing to TwinCAT frame arrival instead of free-running ticker),
  timeout at 1.5 periods keeps loop alive on master stop
- verified: 238k cycles, 0 errors, exec=245us (FPWR-bound),
  TwinCAT PLC task confirmed at 2000.8 Hz (all three tasks 0.5ms;
  base tick was already 50us - no base-time change needed)
- docs: 500us latency plan; scripts: task-rate ADS probe, 2kHz deploy,
  UI automation experiments (pywinauto) for task cycle inspection
2026-07-28 00:11:34 +08:00

20 lines
631 B
Python

import sys, time
sys.stdout.reconfigure(encoding='utf-8', errors='replace')
from pywinauto import Application
app = Application(backend='uia').connect(process=1456, timeout=10)
win = app.window(title_re='.*TcXaeShell.*')
win.set_focus()
for e in win.descendants(control_type='Edit'):
try:
r = e.rectangle()
aid = e.automation_id()
txt = e.window_text()
try:
val = e.get_value()
except Exception:
val = None
print(f"aid='{aid}' text='{txt}' value='{val}' rect=({r.left},{r.top},{r.right},{r.bottom})")
except Exception as ex:
print('err', ex)