Skip to main content
Glama
MHO98 MCP Server

MHO98 MCP Server

by andy-qingcai

MHO98 MCP Server

Rigol MHO98 示波器的 Model Context Protocol (MCP) 服务器。 基于官方《MHO98 Programming Guide》(PGA45102-1110) 做全量参数化封装, 通过 PyVISA (raw TCP socket 5555 / USBTMC) 控制仪器。

  • 手册摘要:docs/NOTES.md;功能规划:docs/PLAN.md;手册原文:docs/MHO98_ProgrammingGuide_EN.pdf

  • 默认暴露 18 个工具(动作/配置三层结构)(MHO98_TOOL_PROFILE=full 可全量暴露 142 个);手册全部 28 个命令子系统逐命令核对覆盖——改状态走 configure(scope, target, params),查状态走 get_config(subsystem, target, full),其余是动词(run/autoscale/measure/capture/screenshot/save/navigate)

  • 波形数据只落盘(CSV/NPY),绝不在 MCP 返回值中内联采样数组,防止撑爆大模型上下文;返回值为统计摘要 + 文件路径,供后续脚本按协议解析

快速开始

cd /Users/andylos/mcp_gen/rigol/mho98
python3 -m venv .venv
.venv/bin/pip install -e .          # 或 pip install mcp'>=1.2,<2' pyvisa pyvisa-py numpy
.venv/bin/python -m pytest tests/   # 离线单元测试(mock 仪器)
.venv/bin/python scripts/probe_device.py   # 真机全功能自检

Related MCP server: pyMSO5000 MCP Server

配置(环境变量)

变量

默认

说明

MHO98_RESOURCE

TCPIP0::169.254.112.67::5555::SOCKET

VISA 资源串;USB 形如 USB0::0x1AB3::0x****::***::INSTR

MHO98_SOURCE_IP

自动检测

macOS 直连 link-local 网段时绑定本机源地址(en 口 169.254.*)

MHO98_DATA_DIR

./data

波形 CSV/NPZ、截图、设置文件的保存目录

MHO98_TOOL_PROFILE

lean

工具暴露面:lean(18 个三层结构,省上下文)/ full(142 个全量);旧值 core 为弃用别名

macOS 直连网线注意:仪器使用 link-local 地址(169.254.x.x)时,系统默认把流量 路由到主网卡导致连不上。本服务会自动发现本机 169.254.* 地址并绑定;若仍有问题, 可 sudo route -host add 169.254.112.67 -interface en7 持久修复。

接入 MCP 客户端

ZCode(.zcode/settings.json)或 Claude Desktop(claude_desktop_config.json):

{
  "mcpServers": {
    "mho98": {
      "command": "/Users/andylos/mcp_gen/rigol/mho98/.venv/bin/python",
      "args": ["-m", "mho98_mcp.server"],
      "cwd": "/Users/andylos/mcp_gen/rigol/mho98",
      "env": {
        "MHO98_RESOURCE": "TCPIP0::169.254.112.67::5555::SOCKET",
        "MHO98_DATA_DIR": "/Users/andylos/mcp_gen/rigol/mho98/data",
        "MHO98_TOOL_PROFILE": "lean"
      }
    }
  }
}

工具暴露面:lean(默认,18 个)/ full(142 个)

142 个工具的全量 schema 对大模型上下文负担太重。默认 lean profile 按 「动作 / 配置」结构轴切分,规则一句话:改状态走 configure,查状态走 get_config,其余是动词(MHO98_TOOL_PROFILE=full 切回全量暴露,功能等价)。

① 配置写(1 个)

configure(scope, target=None, params=None, extra=None)

scope 覆盖全部 32 个配置域:channel / timebase / acquire / autoset / display / trigger / trigger_common / bus / math / reference / awg / awg_modulation / awg_output / bode / thresholds / statistics / cursor / counter / dvm / measure / histogram / mask / search / navigate / record / la / system / lan / save / smb / ieee4888 / datetime。target 是二级选择器(触发类型、"1/CAN" 式总线+协议、 通道/槽位号、measure 小节名)。示例:

configure("channel", "1", {"scale": 0.05, "coupling": "AC", "probe": 10})
configure("trigger", "CAN",  {"baud": 500000, "when": "ID"})
configure("bus", "1/SPI",    {"sclk": "CH1", "miso": "CH2"})
configure("awg", "1",        {"function": "SINusoid", "frequency": 10e3})
configure("awg_output", "1", {"state": True, "sync_phase": True})

params 的键按底层包装函数的签名校验:拼错键名报 ValueError 并列出全部 合法键——错误信息即完整参数文档。

② 配置读(1 个)

get_config(subsystem, target, full) ——32 个子系统读回合一(通道/时基/任意 触发类型/总线/数学/AWG/录制/LA/LAN/SMB/IEEE488.2/选件等;选件查询带挂死守卫, 默认跳过)。

③ 动作(16 个)

类别

工具

会话/状态

connect disconnect list_resources get_idn get_status reset wait_complete scpi(任意 SCPI 逃生舱)

采集动作

run(RUN/STOP/SINGLE/FORCE/CLEAR) autoscale capture(波形落盘 CSV/NPY+统计,绝不内联) measure(44 项,单项/批量/统计值) screenshot

存储/导航

save_on_instrument(kind, path) load_on_instrument(kind, path) navigate_to_event

长尾/组合参数仍可通过 configure(..., extra={"KEYWORD": value}) 白名单透传到 :子系统:KEYWORD value(白名单按手册逐命令核对,非法关键字报 ValueError)。

已验证固件特性(00.01.00,实机 MHO9A274501356)

  • :SYSTem:OPTion:STATus? / :OPTion:VALid? 会挂死(不响应),get_system_info 已跳过;get_option_status 默认跳过,仅 opt_in=True 才真正查询

  • :DVM:CURRent? 在 DVM 关闭时挂死,read_dvm 已做使能守卫

  • :CURSor:MANual:TYPE 合法值为 TIME|AMPLitude(非 X/Y)

  • :TRIGger:PATTern:PATTern 需要 H,H,L,L 逗号分隔(工具自动转换 HHLL)

  • :DISPlay:GRADing:TIME 只接受 MIN|数值秒|INFinite(不接受 1S/1.0)

  • :NAVigate:MODE 需要 STOP 状态(configure_navigate(stop_first=True))

  • SCPI 错误入队有延迟,写后错误检查带 50 ms 稳定期防止误归属

手册逐条核对带来的修正(v0.1 → v0.2)

  • :CHANnel<n>:POSition 是偏置电压(V)而非垂直格数

  • 测量阈值命令为 :MEASure:SETup:MAX/MID/MIN(非 :MEASure:THReshold:*);统计查询必带类型参数 :MEASure:STATistic:ITEM? <type>,<item>

  • PATTern/DURation 触发的 LEVel 需 <源>,<电平> 二元形式;holdoff 下限 8 ns

  • 此型号无 :MATH<n>:DATA?,数学波形经 :WAVeform:SOURce MATH<n> 读取;REF 插槽为 1–10;FFT 窗函数集为 {RECTangle|BLACkman|HANNing|HAMMing|FLATtop|TRIangle}

  • AWG 调制仅支持 AM/FM/PM(无 SWP/Burst);AM 深度 0–120%;频率 2 mHz–100 MHz

  • Bode:sweep_type 合法值 LOG|LINE;:BODeplot:VOLTage 需 <量程>,<幅值> 双参数

  • LA 阈值按 POD 组设置(POD1=D0–D7,POD2=D8–D15),非逐通道

  • 录制帧间隔命令为 :RECord:WRECord:FINTerval(非 INTerval);搜索类型仅 EDGE|PULSe

  • power_on 合法值 LATest;语言设置用 13 种长格式

  • :SAVE:IMAGe:DATA? 截图与 :SAVE:*/:LOAD:* U 盘路径、SMB 共享均已封装

数据文件格式

  • 波形 CSV:两行 # 注释头(含 preamble 换算参数)+ t_s,v_V 两列

  • 波形 NPY:np.load(f)["t_s"] / ["v_V"](npz,RAW 大采集推荐)

  • 电压换算:v = (code - yorigin - yreference) × yincrement

Available Tools

142 tools
autoscaleB

Autoset with options, then execute :AUToset.

enable_channels: True = only test the currently enabled channels; False = scan CH1..CH4 in sequence and enable the ones carrying signals view_overlap: True = stack channel waveforms; False = tile them top-to-bottom on the screen peak_search: peak-peak priority (best for signals with a large DC shift) keep_coupling: keep the channel coupling (else DC is applied) lock_timebase: lock the AUTO key, i.e. disable the AUTO function (manual 3.2.6; :AUToset:ENAble False is the equivalent master switch)

Inputs: peak_search, view_overlap, keep_coupling, lock_timebase, +1 more. Returns: result

clear_statusB

Send *CLS: clear event registers and error queue.

Inputs: no named parameters. Returns: result

configure_awgA

Configure generator channel GI/GII (SOURce1/2).

function: SINusoid|SQUare|RAMP|NOISe|DC|ARB|EXPRise|EXPFall|ECG1|GAUSsian| LORentz|HAVersine|SINC (manual 3.25.2; abbreviations allowed). frequency in Hz, 2 mHz to 100 MHz (per-waveform limits: square/ramp/arb and built-in waveforms top out at 20 MHz, ramp at 2 MHz; DC/Noise ignore it). period in s, 10 ns to 500 s — reciprocal of frequency; when both are given the period is written last and therefore wins. amplitude in Vpp, 1 mV to 20 V (50-ohm load tops out at 10 Vpp, and above 50 MHz the limits halve). offset in V, |offset| <= 10 V (actual limit depends on amplitude/impedance). high/low absolute levels in V within +/-10 V; when both are given high must stay above low. phase in degrees, 0 to 360. duty_percent for SQUare, 1 to 99. ramp_symmetry_percent for RAMP, 0 to 100. impedance: OMEG (HighZ, 1 Mohm) | FIFTy (50-ohm load); HIGHZ/50/LOAD also OK. load_arbitrary: path of a stored arbitrary waveform file, e.g. "D:/123.csv" (local storage "C:/", external "D:/"); use together with function="ARB". Use sync_awg_phase() for the align-phase operation and get_awg_full_config() to read every setting back.

Inputs: channel (required), low, high, phase, +9 more. Returns: result

configure_awg_modulationB

Generator modulation AM|FM|PM (per manual :SOURce:MOD, 3.25.15-3.25.25).

This model's manual defines the modulation types AM, FM and PM only (no SWP/ARB/BURSt). type: AM|FM|PM. am_depth_percent: 0-120%. fm_deviation_hz: 2 mHz up to the current carrier frequency. pm_deviation_deg: 0-360. Internal modulation frequency in Hz: 2 mHz-1 MHz. Internal waveform shape: SINusoid|SQUare|TRIangle|UPRamp|DNRamp|NOISe. extra: only MOD subsystem keywords documented in section 3.25 are allowed, e.g. {"MOD:FM:DEViation": 200} (case-insensitive, canonicalized).

Inputs: channel (required), type, extra, enable, +9 more. Returns: result

configure_bodeA

Bode plot configuration (requires generator option; manual 3.5.1-3.5.11).

sweep_type: LOG|LINE (DECade/LINear spellings are accepted as aliases). ref_in/ref_out: DUT input/output channel, CH1..CH4 (CHAN/CHANnel forms OK). start_hz: 10 Hz-3 MHz; stop_hz: 100 Hz-30 MHz; when both are given the manual constraint start*10 <= stop is enforced. points: sweep points per decade, 10-100. voltage: sweep amplitude in V, 20 mV-10 V, applied to the frequency range given by voltage_range (default ALL, i.e. a unified amplitude); voltage_range: ALL|10|100|1K|10K|100K|1M|10M|25M (numeric forms like 1000 or 2.5e7 also accepted); only used together with voltage. gain_curve/phase_curve: display the amplitude/phase frequency curve (settable only while the instrument is stopped).

Inputs: run, enable, points, ref_in, +8 more. Returns: result

configure_busA

Configure decoding bus BUS1..BUS4 (common + protocol settings).

protocol: PARallel|RS232|SPI|IIC|LIN|CAN|IIS|FLEXray|M1553 (:BUS:MODE).

Common settings (manual 3.4.1-3.4.9), every None argument is left unchanged: display: bus decoding display on/off format: event-table numeral system HEX|ASCii|DEC|BIN event: event-table display on/off (enable before :EEXPort/:DATA?) label: bus label display on/off - a bool per manual 3.4.5, not text position: bus vertical position, integer -250..250 threshold / threshold_type: per-source threshold in V, sent as ":BUS:THReshold ,", e.g. threshold=1.65, threshold_type="TX". Legal types: PAL|PALCLK|TX|RX|SCL|SDA|CS|CLK| MISO|MOSI|LIN|CAN|CANSub1|FLEX|1553|I2SClk|DATA|WS|CH1..CH4. Legal voltage range: +/-5 vertical divisions around the channel offset.

Typed protocol parameters, routed to the active protocol (if protocol= is omitted, the current bus mode is queried first): source: single line source, CAN|LIN|FLEXray|M1553 only baud: RS232 (1 bps..20 Mbps) | CAN (10 kbps..5 Mbps) | LIN (2.4 kbps..20 Mbps) | FLEXray (2.5/5/10 Mbps, discrete) dbits: RS232 (5..9) | SPI (4..32) parity: RS232 NONE|ODD|EVEN | LIN bool (include parity bit) polarity: POSitive|NEGative for RS232/PARallel/IIS, HIGH|LOW for SPI (cross-spellings are mapped) endian: MSB|LSB for RS232/SPI/IIS

Any other keyword goes through extra as {"": value}; KEY is the SCPI sub-path validated against a whitelist from the manual, e.g. RS232: {"RS232:TX": "CH1", "RS232:BAUD": 115200, "RS232:DBITs": 8} IIC: {"IIC:SCLK:SOURce": "CH1", "IIC:SDA:SOURce": "CH2"} SPI: {"SPI:SCLK:SOURce": "CH1", "SPI:MOSI:SOURce": "CH2"} CAN: {"CAN:SOURce": "CH1", "CAN:BAUD": 500000} Legal keywords per protocol (manual 3.4.10-3.4.18): PARallel: BUS CLK SLOPe WIDTh BITX SOURce ENDian POLarity RS232: TX RX POLarity PARity ENDian BAUD DBITs SBITs IIC: SCLK:SOURce SDA:SOURce EXCHange ADDBits SPI: SCLK:SOURce SCLK:SLOPe MISO:SOURce MOSI:SOURce POLarity MISO:POLarity MOSI:POLarity DBITs ENDian MODE TIMeout:TIME SS:SOURce SS:POLarity CAN: SOURce STYPe BAUD FDBaud SPOint FDSPoint LIN: SOURce STANdard BAUD PARity FLEXray: SOURce BAUD SPOint STYPe CHANnel IIS: SOURce:CLOCk SOURce:DATA SOURce:WSELect ALIGnment CLOCk:SLOPe RWIDth RECewidth WSLow ENDian POLarity M1553: SOURce Protocol prefixes match case-insensitively (I2C->IIC, FLEX->FLEXray, 1553->M1553) and keywords accept unambiguous SCPI short forms.

Inputs: bus (required), baud, dbits, event, +12 more. Returns: result

configure_bus_canA

Set Bus to CAN/CAN-FD decoding and configure it (manual 3.4.14).

source: CAN line source CH1..CH4 or D0..D15 signal_type: TX|RX|CANH|CANL|DIFFerential (probe type, default CANH) baud: arbitration baud rate 10 kbps..5 Mbps in bps (default 1 Mbps) fd_baud: CAN-FD data-phase baud rate 1 Mbps..10 Mbps in bps sample_point: bit sample position 10..90 in % (default 80) fd_sample_point: CAN-FD data-phase sample position 10..90 in % display: enable the decoding bus

Inputs: bus (required), baud, source, display, +4 more. Returns: result

configure_bus_flexrayA

Set Bus to FlexRay decoding and configure it (manual 3.4.16).

source: FlexRay line source CH1..CH4 or D0..D15 baud: 2500000|5000000|10000000 bps (default 10000000) sample_point: bit sample position 10..90 in % (default 50) signal_type: BP|BM|RT probed signal (default BP) channel: FlexRay channel A|B (default A) display: enable the decoding bus

Inputs: bus (required), baud, source, channel, +3 more. Returns: result

configure_bus_iicA

Set Bus to I2C decoding and configure it (manual 3.4.12).

sclk / sda: clock (SCL) and data (SDA) line sources, CH1..CH4 or D0..D15 exchange: swap the clock and data channel sources addr_bits: slave address width 7|8|10 bits (default 7) display: enable the decoding bus

Inputs: bus (required), sda, sclk, display, +2 more. Returns: result

configure_bus_iisA

Set Bus to I2S decoding and configure it (manual 3.4.17).

clock / data / ws_select: serial clock, data and word-select (audio channel) line sources, each CH1..CH4 or D0..D15 alignment: IIS|RJ|LJ data alignment (default IIS) clk_slope: POSitive|NEGative clock edge sampled on word_width: word size 4..32 bits receive_width: receive width 4..32 bits ws_low: LEFT|RIGHt audio channel indicated by WS low endian: MSB|LSB bit order (default MSB) polarity: POSitive|NEGative data polarity display: enable the decoding bus

Inputs: bus (required), data, clock, endian, +8 more. Returns: result

configure_bus_linA

Set Bus to LIN decoding and configure it (manual 3.4.15).

source: LIN line source CH1..CH4 or D0..D15 standard: LIN bus version V1X|V2X|MIXed (default MIXed) baud: 2.4 kbps..20 Mbps in bps (default 9600) parity: include the parity bit in the decoded frames display: enable the decoding bus

Inputs: bus (required), baud, parity, source, +2 more. Returns: result

configure_bus_m1553A

Set Bus to MIL-STD-1553B decoding and configure it (manual 3.4.18).

source: 1553 bus line source CH1..CH4 or D0..D15 display: enable the decoding bus (Set the differential threshold via configure_bus(threshold=..., threshold_type='1553').)

Inputs: bus (required), source, display. Returns: result

configure_bus_parallelA

Set Bus to PARallel decoding and configure it (manual 3.4.10).

bus_source: data source D7D0|D15D8|D15D0|D0D7|D8D15|D0D15|CH1..CH4|USER (USER enables the per-bit sources below) clk: clock source CH1..CH4 or D0..D15, or OFF to sample on data change clk_slope: POSitive|NEGative|BOTH clock edge sampled on width: data width 1..16 (analog sources are limited to 1..4) bit / bit_source: select data bit 0..width-1, then its line source (BUS_source must be USER) endian: NEGative|POSitive (NEGative = inverted, manual default) polarity: NEGative|POSitive data polarity display: enable the decoding bus

Inputs: bus (required), bit, clk, width, +6 more. Returns: result

configure_bus_rs232A

Set Bus to RS232/UART decoding and configure it (manual 3.4.11).

tx / rx: line sources CH1..CH4 or D0..D15; rx also OFF (tx and rx cannot both be OFF) polarity: POSitive|NEGative logic sense (default NEGative idle-low) parity: NONE|ODD|EVEN endian: MSB|LSB bit order (default LSB) baud: 1 bps to 20 Mbps in bps (default 9600) dbits: 5|6|7|8|9 data bits (default 8) sbits: 1|1.5|2 stop bits (default 1) display: enable the decoding bus

Inputs: bus (required), rx, tx, baud, +6 more. Returns: result

configure_bus_spiA

Set Bus to SPI decoding and configure it (manual 3.4.13).

sclk: clock source CH1..CH4 or D0..D15 clk_slope: POSitive|NEGative clock edge sampled on miso / mosi: data line sources; each may be OFF but not both at once polarity: HIGH|LOW data polarity (high=1 / low=1) dbits: data width 4..32 bits (default 8) endian: MSB|LSB bit order (default MSB) mode: CS|TIMeout frame synchronization (default TIMeout) timeout_s: timeout frame gap in s, 8 ns..10 s (TIMeout mode only, must exceed the max clock pulse width) ss: chip-select line source CH1..CH4 or D0..D15 (CS mode only) ss_polarity: HIGH|LOW chip-select active level (CS mode only) display: enable the decoding bus

Inputs: bus (required), ss, miso, mode, +9 more. Returns: result

configure_laB

Logic analyzer digital channels D0..D15.

digital_channel like 'D3' plus channel_enable to turn one channel on/off and label to set its name; threshold: logic threshold voltage, -15 V .. +15 V, applied to the channel group selected by pod (1: D0-D7, 2: D8-D15); with a digital_channel the group is derived from it; without either, both groups are set (global threshold); active: currently selected digital channel D0..D15 (must be enabled); autosort: D0D15|D15D0 display order; size: SMALl|MEDium|LARGe waveform size (LARGe needs <= 8 channels on); pod + pod_display: enable/disable an entire channel group.

Inputs: pod, size, label, active, +6 more. Returns: result

configure_maskB

Pass/fail mask test.

source: CHANnel1..CHANnel4 (a disabled channel is enabled automatically); operate: RUN|STOP (enable the test before running it); x_adjust: horizontal mask tolerance, 0.01..2 div; y_adjust: vertical mask tolerance, 0.04..2 div; create_from_source: create the mask from the current source waveform (test must be enabled and stopped); reset: reset the passed/failed/total frame counters; output_enable: pulse the rear-panel AUX OUT connector on mask events; output_event: FAIL|PASS event that triggers the AUX OUT pulse; output_pulse_s: AUX OUT pulse width, 100 ns .. 10 ms.

Inputs: reset, enable, source, operate, +6 more. Returns: result

configure_mathA

Configure math channel MATH1..MATH4 (manual 3.16). Only given parameters are changed; all validation happens before anything is sent.

operator: ADD|SUBTract|MULTiply|DIVision|AND|OR|XOR|NOT|FFT|INTG|DIFF| SQRT|LG|LN|EXP|ABS|LPASs|HPASs|BPASs|BSTop|AXB source1/source2: arithmetic/function/filter sources — CH1..CH4, REF1..REF10 or a lower-numbered MATH channel (MATH1..MATH) scale/offset: vertical scale/offset of the math result (unit follows the operator; invalid for logic and FFT operators) invert: invert the math waveform (not for FFT/logic) lsource1/lsource2: logic operation sources — D0..D15 or CH1..CH4 grid: FULL|HALF|NONE math window grid; expand: GND|CENTer vertical expansion reference; wavetype: MAIN|ZOOM (ZOOM needs zoom enabled) fft_source: CH1..CH4 or MATH1..MATH3 fft_window: RECTangle|BLACkman|HANNing|HAMMing|FLATtop|TRIangle fft_unit: VRMS|DB; fft_mode: NORMal|AVERage|MAXHold fft_avg_count: FFT average count 2..1000 (AVERage mode) fft_scale/fft_offset: spectrum vertical scale/offset (2.0 dB / 1 mVrms steps default; range depends on fft_unit) fft_hscale_hz: frequency span 10 Hz..2 GHz; fft_hcenter_hz: center frequency 5 Hz..2 GHz (span and center influence each other) fft_start_hz/fft_end_hz: 0..2 GHz; end must exceed start by >10 Hz fft_search_enable: FFT peak search on/off; fft_search_num: 1..15 peaks; fft_search_threshold/fft_search_excursion: peak detection levels (excursion >= 0, in dB); fft_search_order: AMPorder|FREQorder filter_type: LPASs|HPASs|BPASs|BSTop; filter_w1/filter_w2: cutoff frequencies in Hz (band types need both, W1 < W2; range depends on the screen sample rate) sensitivity: logic operation sensitivity in div (0.1..1.0) distance: differentiation smoothing window 5..10000 points threshold1..threshold4: logic thresholds of CH1..CH4 in V label_show: show the math waveform label; dismode: True = show the math waveform in the main view instead of the math window reset: auto-fit the result's vertical scale (:MATH:RESet) extra: {"KEYWORD": value} passthrough for :MATH keywords documented in section 3.16 (e.g. {"FFT:SEARch:NUM": 10}); unknown keywords are rejected; RESet takes no value (pass None).

Inputs: grid, extra, index, reset, +38 more. Returns: result

configure_measure_amplitudeB

Amplitude measurement method (:MEASure:AMP tree).

type: overall measurement type, THReshold | RANGe | AMPMethod (AMPMethod enables this tree); method: AUTO | MANual amplitude method; top/base: top/base value type for the manual method, HISTogram | MAXMin.

Inputs: top, base, type, method. Returns: result

configure_measure_regionA

Measurement range (gating region) configuration.

area: MAIN | ZOOM (needs delayed sweep) | CURSor (custom region); type: measurement type THReshold | RANGe | AMPMethod; cursor_ax/cursor_bx: cursor-region boundaries in s (for area=CURSor); link_cursors: tie region cursor A and B together (:MEASure:CREGion:CABX).

Inputs: area, type, cursor_ax, cursor_bx, +1 more. Returns: result

configure_measure_setupB

General measurement configuration.

source: default measurement source (CH1..CH4 / MATH1..4 / D0..D15); all_measure_source: All-Measure source (CH1..CH4, or OFF to disable); indicator: measurement auto-cursor on/off; category: measure menu category, 0=vertical, 1=horizontal, 2=other; delete_items: clear all enabled measurement items (:MEASure:DELete).

Inputs: source, category, indicator, delete_items, +1 more. Returns: result

configure_navigateA

Navigation (time or search navigation) for waveform review.

mode: TIME|SEARch per the manual (FRAMe is kept as an undocumented alias observed on firmware 00.01.00); time_speed: HIGH|NORMal|LOW (a raw number is still passed through for compatibility); frame_speed: playback speed for the undocumented FRAMe mode; time_play: start/stop playing in time navigation mode; goto: TIME|SEARch combined with STARt|END|NEXT|BACK, e.g. 'TIME:STARt', 'time_next' or 'search_end', to jump within the navigation mode. The instrument rejects mode changes while running; set stop_first=True to send :STOP first (FRAMe mode additionally requires recorded frames).

Inputs: goto, mode, enable, time_play, +3 more. Returns: result

configure_quickA

Configure the QUICK button operation (not the quick measurement readout -- use measure_quick for that).

operation: SIMage (save screen image) | SWAVe (save waveform) | SSETup (save setup) | AMEasure (all measure) | SRESet (statistics reset) | RECord (waveform record) | SSAVe (save group). Short forms (SIM, SWAV, SSET, AME, SRES, REC, SSAV) are accepted.

Inputs: operation. Returns: result

configure_recordA

Waveform recorder and playback.

Recording: operate RUN|STOP; frames: number of frames to record (>= 1, frames_max=True records the maximum); interval_s: frame interval 10 ns .. 1 s; prompt: beep when recording completes. Playback: playback_operate RUN|STOP; playback_current / playback_start / playback_end: frame numbers (>= 1); playback_interval_s: 1 ms .. 1 s; playback_mode REPeat|SINGle; playback_direction FORWard|BACKward; playback_step BACK|NEXT steps one frame manually; play_from FFIRst|FEND restarts manual playback from an end. The documented legacy duplicates (:RECord:STARt, :RECord:FRAMes, :RECord:CURRent, :RECord:PLAY) stay reachable via extra, e.g. {"STARt": 1}; unknown keywords raise ValueError.

Inputs: extra, enable, frames, prompt, +12 more. Returns: result

configure_referenceA

Reference waveform REF1..REF10 (manual 3.20).

source: D0..D15, CH1..CH4 or MATH1..MATH4 (must currently be enabled). vscale/voffset: vertical scale/offset of the reference trace in V (only available once a waveform has been saved into the slot; the scale range depends on the probe ratio and input impedance). color: GRAY|GREen|BLUE|RED|ORANge. label: per-slot label text; label_enable: label display for ALL reference slots (global flag). save_current captures the source channel's current waveform into the reference slot (:REFerence:CURRent + :REFerence:SAVE, source must be given); reset restores the default scale/offset. There is no reference save-to-file / load-from-file command in the :REFerence subsystem — exporting a trace to disk goes through get_waveform.

Inputs: ref (required), color, label, reset, +5 more. Returns: result

configure_saveA

Image/file saving options.

invert: invert colors when saving images; color: COLor|GRAY; image_format: PNG|BMP|JPG; header: print model + date banner on images; overlap: overwrite same-name files; prefix: default filename prefix (max 16 chars, no extension); pathname: default save directory on the instrument, e.g. "C:/new".

extra: only documented :SAVE option keywords, e.g. {"PREFix": "Rigol"}.

Inputs: color, extra, header, invert, +4 more. Returns: result

configure_smbB

Configure SMB (Windows share) file saving.

server_path: "\192.168.1.5\Share" (IP address + English-letters share name); username/password: printable ASCII, no Chinese characters; autoconnect: reconnect the share at boot.

Inputs: password, username, autoconnect, server_path. Returns: result

connectC

Connect to the oscilloscope.

resource defaults to MHO98_RESOURCE env or the built-in default (TCPIP0::169.254.112.67::5555::SOCKET). USB example: USB0::0x1AB3::0x****::DSN********::INSTR

Inputs: resource.

disconnectB

Close the current instrument connection.

Inputs: no named parameters.

export_bus_on_instrumentC

Export the event table to a CSV on the INSTRUMENT's own storage (USB stick), e.g. path='C:/123.csv' or 'E:/decode.csv'.

Inputs: bus (required), path (required). Returns: result

export_waveform_csvC

Convenience wrapper: full-memory CSV export (stops the instrument).

Inputs: mode, stop, start, source, +1 more. Returns: result

get_acquireA

Read back acquisition settings incl. current sample rate.

Inputs: no named parameters. Returns: result

get_autoset_optionsA

Read back the AUTO (autoset) option states (all return 0 or 1).

Inputs: no named parameters. Returns: result

get_awg_configA

Read back the core generator channel configuration (raw SCPI strings).

Covers output state, function, frequency, amplitude, offset, phase and impedance; use get_awg_full_config() for every :SOURce readback including period, high/low levels, duty, symmetry, arb path and modulation.

Inputs: channel (required). Returns: result

get_awg_full_configB

Read back every generator channel setting (manual 3.25.1 - 3.25.25).

Returns engineered values: booleans for states, floats (Hz, s, V, degrees, percent) for numerics and short-form strings for enums (e.g. function "SQU", modulation waveform "TRI"). Includes the loaded arbitrary waveform path and the complete AM/FM/PM modulation configuration.

Inputs: channel (required). Returns: result

get_bode_configA

Read back the full Bode plot configuration (manual 3.5.1 - 3.5.11).

voltage_range selects which frequency range's amplitude is queried by :BODeplot:VOLTage? (ALL|10|100|1K|10K|100K|1M|10M|25M or numeric forms). Returns engineered values: booleans for enables/run state, floats in Hz/V, int points per decade; ref_in/ref_out come back in short form (CHAN1..4).

Inputs: voltage_range. Returns: result

get_bus_configA

Read back the decoding bus configuration.

Default (no extra arguments): queries :BUS:MODE?, DISPlay? and LABel? only. Any of full=True / protocol= / thresholds= additionally reads FORMat/EVENt/POSition; full=True or protocol= also queries every per-protocol keyword the manual defines for the decoding type (returned under 'protocol_config', keyed by the SCPI keyword, e.g. 'RS232:BAUD'); thresholds= adds per-source threshold voltages.

protocol: explicitly select which protocol keyword set to query; by default the set follows the bus mode reported by the instrument. thresholds: threshold source types to query, e.g. ["TX","RX"] or ["SCL","SDA"] (manual 3.4.9) -> {type: volts string}.

Inputs: bus (required), full, protocol, thresholds. Returns: result

get_channelC

Read back the configuration of an analog channel.

Inputs: channel (required). Returns: result

get_channel_fullA

Read back the complete configuration of an analog channel.

Adds the vernier (fine adjustment), delay calibration (TCALibrate, in s) and label visibility queries to get_channel().

Inputs: channel (required). Returns: result

get_cursor_valuesA

Read cursor positions and deltas for the active cursor mode.

Manual-mode readings (ax, bx, ay, by, x_delta, 1/x_delta in Hz, y_delta) are always returned; track=True additionally reads the track-mode readings (track_* keys) and the track axis. Readings unavailable in the current mode come back as "<error ...>" strings.

Inputs: track. Returns: result

get_cursor_xy_valuesA

Read XY-mode cursor positions and deltas (all values in V).

Only meaningful with :CURSor:MODE XY and the timebase in XY mode; unavailable readings come back as "<error ...>" strings.

Inputs: no named parameters. Returns: result

get_datetimeA

Read the instrument clock (:SYSTem:DATE? and :SYSTem:TIME?), returned as date 'YYYY-MM-DD', time 'HH:MM:SS' and a combined string.

Inputs: no named parameters. Returns: result

get_displayA

Read back the display settings.

type (VECT), persistence (MIN..10 or INF), waveform/grid/cursor brightness in percent, grid (FULL|HALF|NONE), and the ruler/color-grade/waveform-freeze states (0 or 1).

Inputs: no named parameters. Returns: result

get_errorsB

Read the instrument error queue (:SYSTem:ERRor?). Returns up to 20 entries.

Inputs: clear. Returns: result

get_histogram_configB

Read back the histogram configuration (manual 3.11.1-3.11.8).

Inputs: no named parameters. Returns: result

get_idnA

Query instrument identity (*IDN?): manufacturer, model, serial, firmware.

Inputs: no named parameters. Returns: result

get_ieee488_statusA

Read the IEEE488.2 status registers (*ESR?, *STB?) and their enable masks (*ESE?, *SRE?), with named-bit decoding.

*ESR? reads-and-clears the standard event register; *STB? clears the status byte. Bits follow manual tables 3.153/3.154.

Inputs: no named parameters. Returns: result

get_keyboard_checkA

Front-panel key/knob self-test results (:SYSTem:KEYBoard:CHECk?).

Only meaningful after running the key test on the instrument (Utility > Self Check > Key Test); untested keys report false. Returns the parsed result map plus the raw string.

Inputs: no named parameters. Returns: result

get_la_configB

Read back the logic analyzer configuration (manual 3.13): enable, active channel, autosort, size, per-group display state and threshold. With digital_channel (D0..D15), also reads that channel's on/off state and label.

Inputs: digital_channel. Returns: result

get_lan_configA

Read the full LAN configuration.

Returns IP address, subnet mask, gateway, DNS, DHCP server, MAC, the DHCP/Auto-IP/Static(mANual)/mDNS mode switches (as booleans), hostname, description, link status and the VISA resource string.

visa_type: USB|LXI|SOCKet — address type for :LAN:VISA? (default LXI). Link status values: UNLINK, CONNECTED, INIT, IPCONFLICT, BUSY, CONFIGURED, DHCPFAILED, INVALIDIP, IPLOSE.

Inputs: visa_type. Returns: result

get_mask_configB

Read back the pass/fail test configuration (manual 3.15).

Inputs: no named parameters. Returns: result

get_mask_resultB

Mask test counters: failed, passed and total frame counts.

Inputs: no named parameters. Returns: result

get_math_configC

Read back the configuration of a math channel.

Inputs: index. Returns: result

get_math_config_fullA

Read back the complete configuration of a math channel.

get_math_config() plus every other queryable :MATH parameter: invert, grid/expand/wavetype, logic sources, the whole FFT block (source, window, unit, mode, average count, scale/offset, frequency span/center, peak search settings), filter type and cutoffs, logic sensitivity/distance/ thresholds, label display, display mode and the math window title. Numeric replies are converted (ints/floats).

Inputs: index. Returns: result

get_math_fft_peaksA

Query the FFT peak search results table (:MATH:FFT:SEARch:RES?, manual 3.16.30). Requires the peak search to be enabled first (configure_math fft_search_enable=True).

Returns up to 15 rows — rank, frequency (Hz when the unit is recognized) and amplitude with its unit as displayed by the instrument — plus the raw reply. The table is small enough to return inline (not sample data).

Inputs: index. Returns: result

get_math_waveformA

Acquire the computed waveform of math channel MATH1..MATH4 to a file.

There is no :MATH:DATA? command on this model — math data is read through :WAVeform:SOURce MATH + :WAVeform:DATA? (manual 3.28.1). Firmware quirk (verified on 00.01.00): MATH sources are only readable in NORMal waveform mode, so this wrapper always uses NORMal. Samples go to disk exactly like get_waveform; only statistics come back inline.

Inputs: fmt, index, filename, save_format. Returns: result

get_navigate_configB

Read back the navigation configuration (manual 3.23.1-3.23.4).

Inputs: no named parameters. Returns: result

get_option_statusA

Query software-option installation (:SYSTem:OPTion:STATus? or, with valid=True, :SYSTem:OPTion:VALid?).

WARNING: on firmware 00.01.00 BOTH queries never answer and hang the connection. The tool therefore does nothing unless opt_in=True is passed explicitly; the default call returns a skipped marker without touching the instrument.

option_type: BND|AFG100|AFG50|AUDio|CAN-FD|FLEX|AERO|RLU-05|BWU03T05| BWU03T08|BWU05T08. Option install/uninstall commands exist but are deliberately not exposed (licensed, destructive).

Inputs: option_type (required), valid, opt_in. Returns: result

get_record_statusA

Read back waveform record/playback state (manual 3.19): enables, operate states, frame counts and limits, intervals, playback settings and the current frame number and its timestamp.

Inputs: no named parameters. Returns: result

get_reference_configA

Read back the configuration of reference channel REF1..REF10 (manual 3.20): source, vertical scale/offset (V), color, label, plus the global reference label-display flag.

Inputs: ref (required). Returns: result

get_save_configA

Read back all :SAVE options (image invert/color/format/header, overwrite mode, filename prefix, storage path, storage status).

Inputs: no named parameters. Returns: result

get_save_statusA

Query the storage state (:SAVE:STATus?). Returns done=True when the previous saving operation has completed (firmware returns 1).

Inputs: no named parameters. Returns: result

get_screenshotB

Capture the oscilloscope screen and save it to a local file.

image_format: PNG|BMP|JPG. Returns the file path and size; the image itself is not inlined.

Inputs: filename, image_format. Returns: result

get_screenshot_dataA

Fetch the current screen bitmap via :SAVE:IMAGe:DATA? and write it to a LOCAL file under MHO98_DATA_DIR (alternative to the display subsystem's :DISPlay:DATA? screenshot). Only path + size are returned, never the blob.

The image honors the :SAVE:IMAGe:* options (color/invert/header/format, see configure_save). Format is sniffed from the magic bytes.

Inputs: filename. Returns: result

get_search_configB

Read back the search configuration and event counters (manual 3.22).

Inputs: no named parameters. Returns: result

get_search_event_timeB

Time value of a line in the search mark table (:SEARch:VALue?).

line: 1-based line number of the mark table; returns the event time.

Inputs: line (required). Returns: result

get_smb_configA

Read back the SMB share configuration: server path, user name, password, auto-connect-at-boot flag and the live connection state.

Inputs: no named parameters. Returns: result

get_smb_statusA

SMB share connection state (:SAVe:SMB:CONState?). connected=True when 1.

Inputs: no named parameters. Returns: result

get_statusA

One-stop instrument snapshot: identity, run state, trigger status, sample rate, memory depth, acquisition settings, enabled channels, LAN status and pending errors.

Inputs: no named parameters. Returns: result

get_system_configB

Read back every writable :SYSTem setting (section 3.24): beeper, language, power-on recall mode, front-panel lock, low-power mode, on-screen clock, AUX OUT type, power status and AUTO-key enable.

Inputs: no named parameters. Returns: result

get_system_infoA

System info: firmware, installed modules/options, hardware layout, LAN parameters.

Note: :SYSTem:OPTion:STATus? / :OPTion:VALid? hang on firmware 00.01.00 and are therefore skipped (see get_option_status for an opt-in probe).

Inputs: no named parameters. Returns: result

get_timebaseC

Read back the horizontal system configuration.

Inputs: no named parameters. Returns: result

get_timebase_fullA

Read back the complete horizontal system configuration.

Adds the horizontal reference mode/position, vernier and XY-mode (enable, X/Y sources, grid) queries to get_timebase().

Inputs: no named parameters. Returns: result

get_trigger_commonD

Inputs: no named parameters. Returns: result

get_trigger_configA

Read back the full configuration of one trigger type (all its queries).

trigger_type: any :TRIGger:MODE value (EDGE, PULSe, SLOPe, VIDeo, PATTern, DURation, TIMeout, RUNT, WINDow, DELay, SETup, NEDGe, RS232, IIC, SPI, CAN, LIN, FLEXray, IIS, M1553) or COMMON for the trigger-wide settings (mode/sweep/holdoff/coupling/nreject/status/position). level_source: channel used for the PATTern/DURation per-channel level query (':LEVel? ' per the manual), e.g. 'CH2'.

Inputs: level_source, trigger_type. Returns: result

get_trigger_positionA

Trigger position in the internal memory (:TRIGger:POSition?, query-only).

Inputs: no named parameters. Returns: result

get_trigger_statusB

Trigger status: TD = triggered, WAIT = waiting, AUTO = auto.

Inputs: no named parameters. Returns: result

get_waveformA

Acquire waveform data and SAVE it to a local file.

Returns metadata (preamble + statistics) and the file path only — sample arrays are never inlined, to protect the caller's context window.

source: CH1..CH4 or MATH1..MATH4 (MATH only in NORMal mode). mode: NORMal (screen, 1000 pts) | MAXimum | RAW (full memory; the instrument is stopped first). fmt: BYTE|WORD|ASCII. start/stop: 1-based inclusive point range (RAW/MAX). points: alternative window selector — number of points to read (:WAVeform:POINts, manual 3.28.4); when given, the RAW full-memory start/stop default is skipped and start/stop are only sent if explicitly provided. save_format: csv | npy (npy recommended for RAW ≥ 1M points; CSV is refused above max_csv_points=2M unless force_csv=True — a 50M-point CSV would be ~2 GB of text). Parse the file afterwards with your own protocol scripts.

Inputs: fmt, mode, stop, start, +7 more. Returns: result

get_waveform_preambleA

Query the 10 waveform preamble parameters of a source.

Returns format, type, points, count, xincrement, xorigin, xreference, yincrement, yorigin, yreference (with engineering interpretation). apply=False only queries without touching source/mode settings. source (when given): CH1..CH4 or MATH1..MATH4; mode: NORMal|MAXimum|RAW (MATH sources only support NORMal mode).

Inputs: mode, apply, source. Returns: result

get_waveform_setupA

Read back the current :WAVeform read-out configuration (manual 3.28).

Queries :WAVeform:SOURce?/:MODE?/:FORMat?/:POINts?/:STARt?/:STOP? and the six per-axis scaling queries (:XINCrement?/:XORigin?/:XREFerence?/ :YINCrement?/:YORigin?/:YREFerence?) as engineered values (ints/floats). The preamble (get_waveform_preamble) returns the same axis data in a single query.

Inputs: no named parameters. Returns: result

list_resourcesA

List VISA resources visible on this host.

Note: raw-socket instruments are not discoverable; the MHO98 must be addressed by its resource string (see connect).

Inputs: no named parameters.

load_mask_on_instrumentA

Load a .pf mask file from the instrument's own storage (:LOAD:MASK ).

Inputs: path (required). Returns: result

load_setupB

Load a setup file previously written by save_setup into the instrument.

Inputs: filename (required). Returns: result

load_setup_on_instrumentB

Load a .stp setup file from the instrument's own storage (:LOAD:SETup ).

Inputs: path (required). Returns: result

measure_batchC

Measure multiple items on one source, returned as a dict.

Inputs: items (required), source, source2. Returns: result

measure_itemA

Measure one of the 44 items and return its current value.

Delay/phase items (RRDelay..FFPHase) need source and source2. source: CH1..CH4 / MATH1..4 / D0..D15. show_on_screen=True additionally puts the item on the scope display. Items: VMAX, VMIN, VPP, VTOP, VBASe, VAMP, VAVG, VRMS, OVERshoot, PREShoot, MARea, MPARea, PERiod, FREQuency, RTIMe, FTIMe, PWIDth, NWIDth, PDUTy, NDUTy, TVMAX, TVMIN, PSLewrate, NSLewrate, VUPPer, VMID, VLOWer, PVRMs, PPULses, NPULses, PEDGes, NEDGes, RRDelay, RFDelay, FRDelay, FFDelay, RRPHase, RFPHase, FRPHase, FFPHase, ACRMs.

Inputs: item (required), source, source2, show_on_screen. Returns: result

measure_quickC

Read the common quick set on one channel: VPP VMAX VMIN VAVG VRMS PERiod FREQuency RTIMe FTIMe PWIDth PDUTy.

Inputs: source. Returns: result

measure_statistics_itemB

Read one statistic of a measurement item, or enable item statistics.

statistic: MAXimum|MINimum|CURRent|AVERages|DEViation|CNT (short forms ok). source/source2: CH1..CH4 / MATH1..4 / D0..D15 (source2 only for the delay/phase items). enable=True first sends the write form (:MEASure:STATistic:ITEM) to turn on statistics for the item.

Inputs: item (required), enable, source, source2, +1 more. Returns: result

read_bus_dataA

Read the decoding event table (:BUS:DATA?).

The full table is saved to a CSV file (ready for protocol-analysis scripts); only a short preview and row count are returned inline. Requires the bus to be enabled with a decodable signal on its sources.

Inputs: bus (required), save_csv, preview_chars. Returns: result

read_counterB

Hardware frequency counter state.

Returns the current value, enable, source, mode (FREQ/PER/TOT) and resolution (digits 3-6). totalize=True additionally reads the counter statistics switch (:COUNter:TOTalize:ENABle?).

Inputs: totalize. Returns: result

read_dvmA

Digital multimeter current reading (DVM option).

:DVM:CURRent? hangs on the instrument while the DVM is disabled, so the reading is only requested when the DVM is on.

Inputs: no named parameters. Returns: result

read_histogram_statsB

Histogram analysis statistics (Sum, Peaks, Max, Min, Pk_Pk, Mean, Median, Mode, Bin width, Sigma, meanPlusSigma/2/3 ...).

Queries :HISTogram:STATistics:RESult? (manual 3.11.9) and falls back to the measurement-histogram variant :MEASure:HISTogram:STATistics:RESult? (manual 3.17.32). Values are parsed into a dict; 'raw' keeps the reply.

Inputs: no named parameters. Returns: result

reboot_systemA

Reset the instrument to power-on state (:SYSTem:RESet).

This restarts the scope operating system: the current configuration is lost and the LXI/USB connection may drop for ~30 s. Not the same as reset (*RST), which only restores default settings.

Inputs: no named parameters. Returns: result

resetA

Send *RST: restore default instrument settings.

Inputs: no named parameters. Returns: result

save_image_on_instrumentA

Store the current screen image on the instrument's own storage (:SAVE:IMAGe ).

path: e.g. "C:/shot.png" (internal disk) or "D:/shot.bmp" (USB storage). Suffix must be .png, .bmp or .jpg; filename max 26 characters.

Inputs: path (required). Returns: result

save_mask_on_instrumentA

Store the pass/fail mask as a .pf file on the instrument's own storage (:SAVE:MASK ). Reload it with load_mask_on_instrument.

Inputs: path (required). Returns: result

save_memory_waveform_on_instrumentB

Store the full-memory waveform on the instrument's own storage (:SAVE:MEMory:WAVeform ). Suffix .bin, .csv or .wfm; filename max 26 characters.

Inputs: path (required). Returns: result

save_setupB

Save the complete instrument setup (:SYSTem:SETup?) to a local file.

Inputs: filename. Returns: result

save_setup_on_instrumentA

Store the current setup as a .stp file on the instrument's own storage (:SAVE:SETup ). Filename max 26 characters.

Inputs: path (required). Returns: result

save_waveform_on_instrumentA

Store the screen waveform on the instrument's own storage (:SAVE:WAVeform ). Suffix .bin or .csv; filename max 26 characters.

Inputs: path (required). Returns: result

scpiA

Escape hatch: send any SCPI command to the instrument.

Commands containing '?' are queried and the text/binary answer returned. Binary answers are saved to a file (never inlined into the response).

Inputs: command (required), expect_binary. Returns: result

self_testA

Run instrument self-test (*TST?). 0 = pass, 1 = failure (check errors).

Inputs: no named parameters. Returns: result

set_acquireA

Acquisition system.

type: NORMal|PEAK|AVERages|HRESolution memory_depth: AUTO|1k|10k|100k|1M|10M|25M|50M|100M|125M|200M|250M|500M (numeric equivalents like 1e6 or 25000000 are normalized to the mnemonic; max 500 Mpts single-channel, 250 Mpts half, 125 Mpts full) averages: 2..65536, power of two (AVERages type only; the instrument rounds non-power-of-two values down, this wrapper rejects them) bits: 12|14|16 (14|16 in HRESolution mode, 12 in the other modes)

Inputs: bits, type, averages, memory_depth. Returns: result

set_autoset_optionsA

Configure the AUTO (autoset) options WITHOUT executing an autoset.

Same parameters as autoscale(), plus: enable: master on/off of the AUTO function (:AUToset:ENAble, 3.2.7); False disables :AUToset just like lock_timebase=True

Inputs: enable, peak_search, view_overlap, keep_coupling, +2 more. Returns: result

set_awg_outputC

Turn generator channel output ON/OFF.

Inputs: state (required), channel (required). Returns: result

set_channelA

Configure an analog channel (CH1..CH4). Only given parameters are changed.

scale: V/div (1 mV..10 V/div at 1 MΩ/1X, 200 µV..1 V/div at 50 Ω/1X; range scales with the probe ratio) offset: vertical offset in V (range depends on scale and impedance) coupling: AC|DC|GND probe: attenuation ratio 0.001..50000 (discrete 1-2-5 steps plus 15-series values; custom ratios allowed) bw_limit: OFF|ON|20M|250M impedance: OMEG (1 MΩ) | FIFTy (50 Ω); accepts 1M/50 aliases position: vertical position (bias voltage) in V, per manual 3.6.14 label: channel label text; show_label: display the label vernier: fine adjustment of the vertical scale units: WATT|AMPere|VOLTage|UNKNown tcal: delay calibration time in s, -100 ns..100 ns

Inputs: channel (required), tcal, label, probe, +11 more. Returns: result

set_counterA

Configure the hardware counter.

mode: FREQuency|PERiod|TOTalize (short forms FREQ/PER/TOT ok); digits: resolution, integer 3 to 6 (Period/Frequency modes only); source: CH1..CH4 or D0..D15; totalize_enable: counter statistics switch (Period/Frequency only); totalize_clear: clear the totalize count (Totalize mode only).

Inputs: mode, digits, enable, source, +2 more. Returns: result

set_cursorB

Configure cursors.

mode: OFF|MANual|TRACk|XY (XY requires timebase mode XY); cursor_type (manual mode): TIME (X cursor) | AMPLitude (Y cursor); source/source2: manual source and track source 1/2 (CH1..CH4 / MATH1..4 / NONE); ax/bx: cursor A/B horizontal positions in s; ay/by: vertical in V (applied to both the manual and the track cursors); indicator: cursor measurement indicator on/off; tunit: manual horizontal unit SECond; vunit: manual vertical unit SOURce; track_mode: track axis X|Y; xy_ax/xy_bx/xy_ay/xy_by: XY-mode cursor positions in V.

Inputs: ax, ay, bx, by, +12 more. Returns: result

set_datetimeA

Set the instrument clock and read it back (:SYSTem:DATE / :SYSTem:TIME).

datetime: 'YYYY-MM-DD hh:mm:ss' (24-hour). Raises ValueError on bad format or out-of-range fields (year 1900..2100).

Inputs: datetime (required). Returns: result

set_displayA

Display settings.

type: DOTS|VECTors (the manual documents VECTors for this model) persistence: MIN|0.1|0.2|0.5|1|2|5|10|INFinite seconds ('1S'/'1.0' are normalized to plain seconds — the firmware rejects suffixed forms) waveform_brightness: 1..100 (percent) grid_brightness: 0..100; cursor_brightness: 0..100 grid: FULL|HALF|NONE ('OFF' accepted as an alias of NONE) clear: clear all waveforms from the screen rulers: show the scale rulers track_ruler: move the scale ruler to track the waveform coordinate color_grade: color grade display (acquisition-probability coloring) waveform_hold: freeze the displayed waveform

Inputs: grid, type, clear, rulers, +7 more. Returns: result

set_dvmB

Configure DVM. source: CH1..CH4; mode: ACRMs|DC|DCRMs (volts).

The AC and DCRM spellings are accepted as aliases of ACRMs/DCRMs.

Inputs: mode, enable, source. Returns: result

set_histogramB

Histogram analysis display and statistics.

type: HORIzontal|VERTical; source: CHANnel1..CHANnel4; height: histogram height, 1..4 divisions; range_left/right: horizontal display limits in s (left < right); range_top/bottom: vertical display limits in V (bottom < top); reset: clear the histogram statistics; save_csv: save the histogram data to a file on the instrument (e.g. 'C:/hist.csv'); boundary: sigma boundary shown (u1S|u2S|u3S) - not documented in the current Programming Guide, kept for backward compatibility.

Inputs: type, reset, enable, height, +7 more. Returns: result

set_ieee488_enableA

Set IEEE488.2 enable registers (*ESE, *SRE) and optionally arm *OPC.

event_enable: bit sum (0..255) for the standard event register (OPC=1, QYE=4, DDE=8, EXE=16, CME=32, PON=128 — table 3.153). service_enable: bit sum (0..255) for the status byte register (ERR queue=4, QSD=8, MAV=16, SES=32, MSS=64, OSR=128 — table 3.154). signal_operation_complete: send *OPC so bit 0 of *ESR latches when all pending operations finish (poll with get_ieee488_status).

Inputs: event_enable, service_enable, signal_operation_complete. Returns: result

set_lanA

Configure the LAN interface (section 3.14).

ip/gateway/dns: dotted-quad, first octet 0..223 (not 127), others 0..255; mask: dotted-quad with every octet 0..255. Static addresses only apply when DHCP and Auto IP are off and manual (static) mode is on. The three IP modes cannot all be off at once (firmware rule). dhcp/auto_ip/manual/mdns: booleans; hostname/description: printable ASCII. apply: send :LAN:APPLy afterwards to activate all pending LAN settings.

extra: only documented :LAN keywords are accepted, e.g. {"HOST:NAME": "scope1"} → :LAN:HOST:NAME scope1.

Inputs: ip, dns, dhcp, mask, +8 more. Returns: result

set_measure_counterA

Frequency counter addressed through the :MEASure command tree.

Same counter as set_counter, but via :MEASure:COUNter. enable: counter on/off; source: CH1..CH4 or D0..D15. The counter value is read back via :MEASure:COUNter:VALue? when the counter is enabled.

Inputs: enable, source. Returns: result

set_measure_histogramA

Measurement histogram enable (statistics of measurement items).

Distinct from the waveform histogram (:HISTogram, analysis module). The statistics themselves are read with read_histogram_stats, which queries :MEASure:HISTogram:STATistics:RESult?.

Inputs: enable. Returns: result

set_measure_sources_abA

Set Source A / Source B used by phase and delay measurements.

Source A is written to both :MEASure:SETup:PSA and :MEASure:SETup:DSA (identical functions per the manual); Source B likewise to PSB/DSB. Sources: CH1..CH4 / MATH1..4 / D0..D15. Returns the read-back of all four.

Inputs: source_a, source_b. Returns: result

set_measure_statisticsC

Control measurement statistics (mean/min/max/... over N acquisitions).

count: statistics count, integer 2 to 100000; reset: clear history data.

Inputs: count, reset, enable. Returns: result

set_measure_thresholdsA

Measurement thresholds (used for rise time, delay, phase, ...).

source: threshold source CH1..CH4 / MATH1..4 (selected via :MEASure:THReshold:SOURce); threshold_type: PERCent (10-90 etc.) | ABSolute; upper/middle/lower: threshold upper/middle/lower level — percent when the type is PERCent, volts when ABSolute (sent as :MEASure:SETup:MAX/MID/MIN); reset_defaults=True restores the default threshold levels (:MEASure:THReshold:DEFault).

Inputs: source (required), lower, upper, middle, +2 more. Returns: result

set_run_stateA

Run control.

state: RUN | STOP | SINGLE (single acquisition, arm) | FORCE (force trigger now) | CLEAR (clear screen) hotkeys: True routes RUN|STOP|SINGLE through :TIMebase:HOTKeys, the front-panel hotkey variant of the same commands (3.26.10); FORCE and CLEAR have no hotkey equivalent.

Inputs: state (required), hotkeys. Returns: result

set_systemA

Misc system settings (:SYSTem section 3.24).

language: SCHinese|TCHinese|KORean|JAPanese|ENGLish|GERMan|PORTuguese| POLish|FRENch|RUSSian|SPAN|THAI|INDonesian (short readback codes like ENGL or SCH are accepted as aliases) power_on: LATest|DEFault (config recalled at power-on) key_lock: lock front panel; low_power: 1 W standby datetime: 'YYYY-MM-DD hh:mm:ss' sets scope clock show_time: display the system time on screen (:SYSTem:STIMe) aux_output: TOUT|PFAil — signal on the rear [AUX OUT] connector power_status: DEFault|OPEN — OPEN boots directly after power application auto_key: enable/disable the front-panel AUTO key (:SYSTem:AUToscale)

Inputs: beeper, auto_key, datetime, key_lock, +6 more. Returns: result

set_timebaseB

Horizontal system. scale: s/div of MAIN timebase; offset: trigger position shift in s; mode: MAIN|XY|ROLL; delayed timebase via delay_* parameters.

roll: auto-ROLL mode (enter ROLL automatically at >= 50 ms/div) horizontal_reference_mode: CENTer|LB|RB|TRIG|USER (expansion reference used when the timebase changes) horizontal_reference_position: user-defined reference position, integer -500 (left edge) .. 500 (right edge) vernier: fine adjustment of the horizontal scale xy_enable: XY mode on/off (alternative to mode="XY") xy_x/xy_y: XY source channels, 1..4 (accepts 3, 'CH3' or 'CHANnel3') xy_grid: FULL|HALF|NONE grid of the XY display

Inputs: mode, roll, xy_x, xy_y, +10 more. Returns: result

set_trigger_commonA

Trigger-wide settings (apply to the current trigger type).

mode: EDGE|PULSe|SLOPe|VIDeo|PATTern|DURation|TIMeout|RUNT|WINDow|DELay| SETup|NEDGe|RS232|IIC|SPI|CAN|LIN|FLEXray|IIS|M1553 (SETup = the setup&hold trigger) sweep: AUTO|NORMal|SINGle coupling: AC|DC|LFReject|HFReject (edge trigger, analog source only) holdoff: 8 ns .. 10 s (unavailable for VIDeo/TIMeout/NEDGe/serial types) noise_reject: analog-channel trigger sources only

Inputs: mode, sweep, holdoff, coupling, +1 more. Returns: result

set_trigger_delayC

Delay trigger between two edges (event A -> event B).

slope_a/slope_b: POSitive|NEGative; delay_type: GREater|LESS|GLESs|GOUT ('<' lower, '>' upper, inside, outside).

Inputs: extra, level_a, level_b, slope_a, +6 more. Returns: result

set_trigger_durationC

Duration (time-qualified logic-state) trigger.

pattern: per-channel states for CH1..CH4, e.g. 'HLXL' (H=high, L=low, X=don't care) -> ':TRIGger:DURation:TYPE H,L,X,L' ('HLXL' is auto-expanded to the comma form); when: GREater|LESS|GLESs|UNGLess; level: per-channel threshold in volts, requires level_source (e.g. 'CH2') -> ':TRIGger:DURation:LEVel ,'.

Inputs: when, extra, level, source, +4 more. Returns: result

set_trigger_edgeB

Edge trigger (most common). Switches TRIGger:MODE to EDGE.

source: CH1..CH4 / D0..D15; slope: POSitive|NEGative|RFALl; level: volts (analog: ±4.5×scale−offset; digital: ±15 V)

Inputs: extra, level, slope, source. Returns: result

set_trigger_nth_edgeB

Nth-edge burst trigger (fires on the Nth edge after a quiet period).

slope: POSitive|NEGative; idle_time: 16 ns .. 10 s; edge: which edge to trigger on, 1 .. 65535; level: volts (analog: ±4.5×scale−offset; digital: ±15 V).

Inputs: edge, extra, level, slope, +2 more. Returns: result

set_trigger_patternB

Pattern trigger.

pattern: per-channel state string for CH1..CH4, e.g. 'HHLL' or 'H,H,L,L' (H=high, L=low, X=don't care, R=rising, F=falling; at most one edge; 'HHLL' is auto-expanded to the comma form the firmware requires); level: per-channel threshold in volts, requires level_source (e.g. 'CH2') -> ':TRIGger:PATTern:LEVel ,'.

Inputs: extra, level, source, pattern, +1 more. Returns: result

set_trigger_pulse_widthC

Pulse width trigger. polarity: POSitive|NEGative; when: GREater|LESS|GLESs (greater/less/within range of the two widths). Widths in seconds (lower 1 ns .. upper; upper .. 10 s).

Inputs: when, extra, level, source, +3 more. Returns: result

set_trigger_runtC

Runt pulse trigger.

polarity: POSitive|NEGative; when: NONE|GREater|LESS|GLESs (width qualification).

Inputs: when, extra, source, level_a, +4 more. Returns: result

set_trigger_serialA

Serial-bus trigger: RS232 | IIC | SPI | CAN | LIN | FLEXray | IIS | M1553.

Typed params map to the documented keywords of the selected protocol (sent as :TRIGger:: ; booleans are sent as 1/0, everything else verbatim): RS232: source level polarity when data baud width stop parity buser IIC: scl sda clevel dlevel when awidth address direction dbytes data currbit code SPI: clk scl miso sda cs clevel dlevel slevel slope when mode timeout width data currbit code CAN: source stype when baud spoint extended define dwidth data currbit code level LIN: source level standard baud samplepoint when error id data currbit code FLEXray: source when level baud pos error symbol frame define idcmp cyccomp maxcy mincy maxid minid ch IIS: clock data_source ws_select clock_slope clevel slevel dlevel alignment uwidth width dmin dmax when audio data code M1553: source when polarity window sync error datcomp datvalue dmin dmax drta dbit code alevel blevel Anything else: pass extra={"KEYWORD": value} (KEYWORD must be documented for that protocol in manual section 3.27).

Inputs: params (required), protocol (required), extra. Returns: result

set_trigger_setup_holdA

Setup & Hold trigger (:TRIGger:MODE SETup, subsystem :TRIGger:SHOLd).

data_source/clock_source: CH1..CH4 or D0..D15 (data and clock lines); slope: POSitive|NEGative (clock edge); pattern: H|L (level the data must hold stable across the clock edge); condition: SETup|HOLD|SETHold; setup_time/hold_time: 1 ns .. 10 s; data_level/clock_level: volts (analog: ±4.5×scale−offset; digital: ±15 V).

Inputs: extra, slope, pattern, condition, +6 more. Returns: result

set_trigger_slopeC

Slope (rise/fall time) trigger.

polarity: POSitive|NEGative; when: GREater|LESS|GLESs; window: TA|TB|TAB (which level limit(s) the knobs adjust).

Inputs: when, extra, source, window, +5 more. Returns: result

set_trigger_timeoutB

Timeout trigger: fires when the signal stays on one side of the level.

slope: POSitive|NEGative|RFALl; time: 1 ns .. 10 s.

Inputs: time, extra, level, slope, +1 more. Returns: result

set_trigger_videoC

Video trigger.

mode: ODDField|EVENfield|LINE|ALINes; polarity: POSitive|NEGative; line: 1 .. 1125 (limit depends on the standard); level: volts; standard: PALSecam|NTSC|480P|576P|720P60|720P50|720P30|720P25|720P24| 1080P60|1080P50|1080P30|1080P25|1080P24|1080I60|1080I50

Inputs: line, mode, extra, level, +3 more. Returns: result

set_trigger_windowB

Window trigger (enter/exit/timeout within a voltage window).

slope: POSitive|NEGative|RFALl; position: EXIT|ENTer|TIME; time: 1 ns .. 10 s (only for position=TIME).

Inputs: time, extra, slope, source, +3 more. Returns: result

smb_connectA

Connect the configured SMB share (:SAVe:SMB:CONNect). Check the result with get_smb_status.

Inputs: no named parameters. Returns: result

smb_disconnectB

Disconnect the SMB share (:SAVe:SMB:DISConnect).

Inputs: no named parameters. Returns: result

sync_awg_phaseB

Perform the "align phase" operation (manual 3.25.7).

Sends :SOURce:PHASe:SYNChronize: both generator channels are re-configured to output at their preset frequency and phase; signals whose frequencies are identical (or integer multiples) come out phase-aligned.

Inputs: channel (required). Returns: result

wait_completeB

Block until all pending operations finish (*OPC?).

use_wai: also send *WAI first — the IEEE488.2 wait-to-continue command. On this firmware *WAI is a compatibility no-op, kept for completeness.

Inputs: timeout, use_wai. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 142 tools

    Disambiguation2/5

    There are many overlapping families: get_channel vs get_channel_full, get_timebase vs get_timebase_full, get_math_config vs get_math_config_full, configure_bus vs configure_bus_rs232/iic/spi/etc., set_counter vs set_measure_counter, and multiple screenshot/save-image tools. Descriptions often clarify differences, but the set has several tool pairs whose boundaries an agent could easily misselect among.

    Naming Consistency4/5

    Mostly consistent snake_case verb_noun naming (get_, set_, configure_, measure_, save_, load_, read_) is used throughout. Minor deviations exist, such as bare verbs reset/autoscale, noun-like scpi, and get_screenshot vs get_screenshot_data, but the overall convention is readable and predictable.

    Tool Count1/5

    142 tools is an extreme mismatch for an MCP server, far beyond the typical 3-15 range. The surface is effectively a full SCPI wrapper, creating excessive cognitive load and making tool selection impractical for an agent despite the exhaustive coverage.

    Completeness5/5

    The server covers nearly every major oscilloscope subsystem: system, LAN, save/load, triggers, channels, timebase, acquisition, measurements, cursors, counter/DVM, waveform, math, reference, bus decode, AWG, Bode, display, histogram, mask, search, record, logic analyzer, and connection management. The scpi escape hatch also prevents dead ends for undocumented or unexposed operations.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables control and querying of Rigol DHO824 oscilloscopes, allowing users to capture waveforms, take screenshots, and interact with oscilloscope settings through natural language.
      54 PyPI
      7
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to control Rigol MSO5000 oscilloscopes through VISA, including acquisition, channels, trigger, timebase, waveform generator, display, and front-panel controls, with risk-based permission gating for direct SCPI operations.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLMs to control RIGOL oscilloscopes over SCPI via LAN or USB, including configuring channels/timebase/trigger, taking measurements, capturing waveforms and screenshots, decoding serial protocols, running FFT analysis, and controlling the built-in AFG.
      38
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP-compatible AI clients to operate a RIGOL MHO98 oscilloscope over USB, including configuration, waveform and measurement acquisition, FFT analysis, and protocol decoding.
      16
      MIT