visa-debug
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVISA 仪器调试
VISA Instrument Debugging
适用场景
Application Scenarios
- 需要识别和探测连接的 VISA 仪器(示波器、万用表、信号源等)。
- 需要发送 SCPI 命令查询或控制仪器。
- 需要从示波器捕获波形数据并保存为 CSV。
- 需要捕获仪器屏幕截图。
- 需要持续监控某个测量值的变化。
- Need to identify and detect connected VISA instruments (oscilloscopes, multimeters, signal sources, etc.).
- Need to send SCPI commands to query or control instruments.
- Need to capture waveform data from oscilloscopes and save it as CSV.
- Need to capture instrument screen screenshots.
- Need to continuously monitor changes in a certain measurement value.
必要输入
Required Inputs
- VISA 资源字符串(如 、
TCPIP::192.168.1.100::INSTR)。USB0::0x1AB1::0x04CE::DS1ZA1234::INSTR - SCPI 命令(查询/写入/监控模式需要)。
- VISA resource string (e.g., ,
TCPIP::192.168.1.100::INSTR).USB0::0x1AB1::0x04CE::DS1ZA1234::INSTR - SCPI commands (required for query/write/monitor modes).
依赖
Dependencies
- (pip install pyvisa)
pyvisa - (纯 Python 后端,pip install pyvisa-py)或 NI-VISA 驱动
pyvisa-py
- (pip install pyvisa)
pyvisa - (pure Python backend, pip install pyvisa-py) or NI-VISA driver
pyvisa-py
执行步骤
Execution Steps
- 先阅读 references/usage.md,确认操作参数。
- 探测环境:
bash
python scripts/visa_tool.py --detect - 根据需求执行操作:
bash
# 查询仪器标识 python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --idn # 发送 SCPI 查询 python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --query ":MEAS:VOLT?" # 捕获波形 python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --waveform --output wave.csv
- First read references/usage.md to confirm operation parameters.
- Detect the environment:
bash
python scripts/visa_tool.py --detect - Perform operations according to requirements:
bash
# Query instrument identification python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --idn # Send SCPI query python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --query ":MEAS:VOLT?" # Capture waveform python scripts/visa_tool.py --resource "TCPIP::192.168.1.100::INSTR" --waveform --output wave.csv
失败分流
Failure Diversion
- :VISA 资源未找到或无法打开连接。
connection-failure - :仪器未响应。
timeout - :SCPI 命令被仪器拒绝。
command-error - :波形或截图数据传输失败。
data-error
- : VISA resource not found or connection cannot be opened.
connection-failure - : Instrument does not respond.
timeout - : SCPI command rejected by the instrument.
command-error - : Waveform or screenshot data transmission failed.
data-error
输出约定
Output Convention
示例输出格式:
结果: ✅ Rigol Technologies,DS1054Z,DS1ZA1234,00.04.04.SP4
资源: TCPIP::192.168.1.100::INSTRExample output format:
Result: ✅ Rigol Technologies,DS1054Z,DS1ZA1234,00.04.04.SP4
Resource: TCPIP::192.168.1.100::INSTR交接关系
Handover Relationship
- 从 /
build-keil烧录固件后,用此 skill 验证硬件输出信号。build-platformio - 与 互补:serial-monitor 查看串口调试输出,visa-debug 进行仪器级测量验证。
serial-monitor - 与 /
modbus-debug互补:协议调试配合仪器测量。can-debug
- After firmware is burned via /
build-keil, use this skill to verify hardware output signals.build-platformio - Complementary to : serial-monitor views serial port debugging output, visa-debug performs instrument-level measurement verification.
serial-monitor - Complementary to /
modbus-debug: protocol debugging combined with instrument measurement.can-debug