Rigol Oscilloscope

v0.1.2
io.github.K-Dense-AI/labmcp-rigol-scope Checked 1 day ago Published 2 months ago

MCP server for Rigol oscilloscopes (DS1000Z, MSO5000, DHO series): measurements and waveforms.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_connection_info Get Connection Info

Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.

get_command_log Get Command Log

Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.

ParameterTypeDescription
limitinteger

reconnect Reconnect

Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).

get_device_info Get Device Info

Identify the oscilloscope (model, serial, firmware), the command family used for it, the number of analog channels, and the current sample rate and memory depth.

get_settings Get Settings

Read the current vertical settings of every channel (on/off, V/div, offset, coupling, probe ratio, bandwidth limit), the timebase, the trigger (type, sweep, status, edge source/level/slope) and the acquisition sample rate / memory depth.

autoscale Autoscale

Run the scope's automatic setup (AUTO key): it picks vertical scales, timebase and trigger for the connected signals. This overwrites the user's current setup - only use it when asked. Needs signals of roughly >20 mVpp and >40 Hz.

run Run

Start continuous acquisition (RUN).

stop Stop

Stop acquisition (STOP) and freeze the current waveforms, e.g. before reading deep memory.

single Single

Arm a single acquisition (SINGLE key): the scope triggers once, then stops. With wait_s > 0 it waits until the acquisition is complete (status STOP). If the trigger condition is never met the status stays WAIT - check the trigger level/source or use `force_trigger`.

ParameterTypeDescription
wait_snumberSeconds to wait for the trigger; 0 = just arm

force_trigger Force Trigger

Force one trigger (FORCE key). Only has an effect in NORMal or SINGle sweep while waiting.

set_channel Set Channel

Change a channel's vertical settings; unspecified settings are left alone. The probe ratio is applied first because it changes the valid scale range. Returns the settings the scope actually applied (the scale snaps to 1-2-5 steps). Rejected values are reported from the scope's error queue.

ParameterTypeDescription
channel *integerAnalog channel number
bandwidth_limit_20mhz20 MHz bandwidth limit on/off
coupling
enabledShow (acquire) the channel
offset_vVertical offset in V
probe_ratioProbe attenuation, e.g. 1 or 10 - must match the probe
scale_v_per_divVertical scale in V/div (1-2-5 steps)

set_timebase Set Timebase

Set the main timebase scale and/or offset. Returns the applied values.

ParameterTypeDescription
offset_sHorizontal (trigger) offset in s
scale_s_per_divHorizontal scale in s/div (1-2-5 steps)

set_trigger Set Trigger

Configure an edge trigger (source, level, slope) and the sweep mode. Sets the trigger type to EDGE. The level must lie within the source channel's screen range.

ParameterTypeDescription
level_vTrigger level in V (displayed units)
slope
source_channelAnalog channel to trigger on
sweepauto = free-run when not triggered; normal = only on trigger; single = once

measure Measure

Read the scope's automatic measurements for one channel: voltages (Vpp, Vmax, Vmin, Vtop, Vbase, Vamp, Vavg, Vrms, overshoot, preshoot) and timing (period, frequency, rise/fall time, +/- width, +/- duty). Values the scope cannot determine are null.

ParameterTypeDescription
channel *integer
itemsarrayParameters to measure

capture_waveform Capture Waveform

Capture a channel's waveform, scaled to volts and seconds with the scope's waveform preamble, and return statistics plus a downsampled trace; optionally save all points to CSV. 'memory' mode reads the whole record (bounded by the `max_memory_points` limit) in batches and requires the scope to be stopped; 'screen' works while running.

ParameterTypeDescription
channel *integer
max_pointsintegerMax points returned (the data is downsampled)
modestring'screen' = the displayed points (1000-1200); 'memory' = full acquisition memory (scope must be stopped)
save_pathWrite every point (time_s, volts) to this new .csv file (never overwritten)

screenshot Screenshot

Save a screenshot of the oscilloscope display (PNG; BMP on the MSO5000) and return its path. For PNG screenshots the image is also returned so the model can look at the screen.

ParameterTypeDescription
include_imagebooleanAlso return the image to the client (PNG only)
save_pathNew image file to write (.png; .bmp on the MSO5000; never overwritten); default: a timestamped file in the system temp folder