A modern, cross-platform Python/Qt6 control suite that replaces 19 legacy Excel VBA/ActiveX macros with 14 standalone GUI applications for the Keysight E5063A ENA Series Network Analyzer.
All instrument communication uses PyVISA over GPIB, LAN (TCPIP), or USB (USBTMC) with standard SCPI commands.
The suite provides a unified tabbed launcher with all 14 tools:
┌──────────────────────────────────────────────────────┐
│ Main Launcher (main.py) │
│ QTabWidget — 14 tool tabs │
├──────────┬───────────┬───────────┬───────────────────┤
│ Setup │ Calibrate │ Data/Test │ File Ops │
│ 4 apps │ 3 apps │ 4 apps │ 3 apps │
├──────────┴───────────┴───────────┴───────────────────┤
│ ENAConnection (PyVISA) → GPIB / LAN / USB │
├──────────────────────────────────────────────────────┤
│ Keysight E5063A ENA Network Analyzer │
└──────────────────────────────────────────────────────┘
# Install dependencies
pip install PySide6 pyvisa pyvisa-py
# Run the suite
cd ena_qt6_suite
python main.py| # | App | Description | Original Source |
|---|---|---|---|
| 1 | ⚙ Analyzer Setup | Multi-channel segment/linear sweep, trace configuration | AnalyzerSetup.xlsm |
| 2 | 📊 Bandwidth Search | Automated -3 dB bandwidth measurement | Bandwidth_Search.xlsm |
| 3 | 🔍 Peak Search | Marker peak, all-peak, multi-peak (9 markers) | Peak_Search.xlsm |
| 4 | 📌 Marker Tools | Interactive marker control — activate, max, min, readout | echoMarker.vbs, form.hta, userMenu.vbs |
| 5 | 🔧 Calibration | Full SOLT wizard — Open/Short/Load/Thru guided steps | Calibration.xlsm |
| 6 | ⚡ ECal | Electronic calibration — 1-port and 2-port | ECal.xlsm |
| 7 | 📐 Error Coefficients | Read/write calibration error terms with segment table | ReadWrite_ErrCoef.xlsm |
| 8 | 📈 Read/Write Data | Trace data transfer — ASCII & IEEE binary, CSV export | ReadingWritingData.xlsm, readingData.vbs |
| 9 | ✅ Limit Test | Pass/fail limit testing with configurable limit tables | LimitTest.xlsm |
| 10 | ⏱ SRQ Measurement | Triggered measurement with status register SRQ wait | WaitingForMeasEndSRQ.xlsm |
| 11 | ⚠ Error Detection | SRQ-based SCPI error detection and reporting | Error_Detection_SRQ.xlsm |
| 12 | 💾 Save Files | State/calibration/trace/screen image saving | Saving_Files.xlsm |
| 13 | 📁 Transfer Files | Bidirectional PC ↔ Analyzer file transfer | Transferring_Files.xlsm |
| 14 | 📷 Screen Capture | Instrument display capture with preview | ScreenCapture.xlsm |
The E5063A supports three interfaces. Enter the appropriate VISA resource string in any app's connection bar:
| Interface | VISA Resource String | Notes |
|---|---|---|
| GPIB | GPIB0::17::INSTR |
Default address 17, requires GPIB adapter |
| LAN | TCPIP::192.168.1.100::INSTR |
Configure IP on analyzer front panel |
| USB | USB0::0x0957::0x1309::MY###::INSTR |
Auto-detected, USBTMC class |
from core.visa_connection import ENAConnection
with ENAConnection("GPIB0::17::INSTR") as ena:
ena.preset()
print(ena.query("*IDN?"))
data = ena.query_values(":CALC1:DATA:FDAT?")See DEVELOPER_GUIDE.md for complete connection documentation, SCPI reference, and new-app tutorial.
ena_qt6_suite/
├── main.py # Unified tabbed launcher
├── requirements.txt # pip dependencies
├── DEVELOPER_GUIDE.md # Full developer documentation
├── presentation_part1.html # Project presentation (slides 1-6)
├── presentation_part2.html # Project presentation (slides 7-12)
├── core/
│ ├── visa_connection.py # ENAConnection — PyVISA wrapper
│ ├── base_widget.py # ENABaseWidget — shared Qt6 connection UI
│ └── scpi_commands.py # SCPI command constants & formatters
└── apps/
├── analyzer_setup.py # ... through ...
└── marker_tools.py # 14 application modules
| Legacy (Before) | Modern (After) |
|---|---|
| Excel VBA macros (.xlsm) | Python 3.10+ modules |
| ActiveX/COM (VisaComLib) | PyVISA (pyvisa-py) |
| Windows-only | Cross-platform (Win/Linux/macOS) |
| Excel UserForms + CommandButtons | PySide6 (Qt6) widgets |
| SICL DLL (32-bit) | VISA resource strings over TCPIP |
| No version control | Git-managed source code |
| Hard-coded GPIB addresses | Configurable connection UI |
This entire project was architected, coded, and documented by Amp — Sourcegraph's AI coding agent.
-
Reverse-Engineered the Legacy Code — Amp extracted VBA macros from all 15 Excel
.xlsmworkbooks usingoletools, read the 4 VBScript/HTA files, and analyzed the 400+ page E5063A operation manual PDF to understand the SCPI command protocol, VISA connection interfaces, and measurement workflows. -
Designed the Architecture — Amp designed a clean 3-layer architecture:
- Core layer (
visa_connection.py,base_widget.py,scpi_commands.py) — shared VISA connection management, Qt6 base widget with connection UI, and typed SCPI command constants - Application layer (14 independent app modules) — each converting one or more original macros into a standalone Qt6 GUI widget
- Launcher (
main.py) — unified tabbed interface bringing all tools together
- Core layer (
-
Converted All 19 Source Files — Every Excel VBA macro, VBScript, and HTA file was faithfully converted to Python/Qt6, preserving the original SCPI command sequences, calibration workflows, data transfer modes (ASCII and IEEE 488.2 binary), SRQ status register handling, and user interaction patterns (guided calibration dialogs, pass/fail indicators, data tables).
-
Mapped Legacy APIs to Modern Equivalents — Amp translated the entire COM/ActiveX automation stack:
VisaComLib.ResourceManager→pyvisa.ResourceManager()VisaComLib.FormattedIO488→ PyVISA resource withwrite()/query()- SICL
iopen("lan[IP]:hpib9,17")→"TCPIP::IP::hpib9,17::INSTR" E5070.ApplicationCOM object → direct SCPI commands over VISA- Excel
Cells(row,col)→QTableWidget/QLineEdit - VBA
UserForm+CommandButton→QWidget+QPushButton
-
Created Documentation — Amp wrote the comprehensive Developer Guide (focusing on device connection details for future development) and a 12-slide HTML presentation covering the project background, architecture, conversion mapping, and achievements.
This project required simultaneously understanding RF test & measurement instrumentation (SCPI protocol, S-parameters, calibration standards, network analyzer operation), legacy Windows COM/ActiveX automation (VisaComLib, SICL DLL, VBA macro extraction), and modern Python GUI development (PySide6, PyVISA, cross-platform design). Amp handled all three domains in a single session, producing 20 Python source files, 2 HTML presentations, and 1 developer guide — a complete, working migration from a deprecated platform to a modern one.
MIT License — see LICENSE for details.