labmcp-rigol-scope 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- labmcp_rigol_scope-0.1.0/.gitignore +15 -0
- labmcp_rigol_scope-0.1.0/PKG-INFO +126 -0
- labmcp_rigol_scope-0.1.0/README.md +113 -0
- labmcp_rigol_scope-0.1.0/pyproject.toml +34 -0
- labmcp_rigol_scope-0.1.0/server.json +46 -0
- labmcp_rigol_scope-0.1.0/src/labmcp_rigol_scope/__init__.py +1 -0
- labmcp_rigol_scope-0.1.0/src/labmcp_rigol_scope/driver.py +424 -0
- labmcp_rigol_scope-0.1.0/src/labmcp_rigol_scope/server.py +419 -0
- labmcp_rigol_scope-0.1.0/src/labmcp_rigol_scope/simulator.py +544 -0
- labmcp_rigol_scope-0.1.0/tests/test_server.py +294 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: labmcp-rigol-scope
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Rigol digital oscilloscopes (DS1000Z/MSO1000Z, DS1000Z-E, MSO5000, DHO800/900/1000/4000): settings, triggering, measurements, waveform capture and screenshots over SCPI.
|
|
5
|
+
Project-URL: Homepage, https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/rigol-oscilloscope
|
|
6
|
+
Author: K-Dense and LabMCP contributors
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Keywords: dho800,ds1054z,lab-instrument,mcp,mso5000,oscilloscope,rigol,scpi,waveform
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: labmcp[visa]<0.2,>=0.1
|
|
11
|
+
Requires-Dist: pyusb>=1.2
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# Rigol Oscilloscope โ MCP Server
|
|
15
|
+
|
|
16
|
+
<!-- mcp-name: io.github.K-Dense-AI/labmcp-rigol-scope -->
|
|
17
|
+
|
|
18
|
+
Let an AI agent read the setup, adjust channels, timebase and trigger, run single acquisitions, take the scope's own measurements, capture calibrated waveforms and grab screenshots on **Rigol digital oscilloscopes** over SCPI.
|
|
19
|
+
|
|
20
|
+
| | |
|
|
21
|
+
|---|---|
|
|
22
|
+
| **Package** | `labmcp-rigol-scope` |
|
|
23
|
+
| **Instruments** | DS1000Z / MSO1000Z (DS1054Z, DS1074Z, DS1104Z, MSO1104Z, "Plus" models), DS1000Z-E (DS1102Z-E, DS1202Z-E), MSO5000 (MSO5072 โฆ MSO5354), DHO800 / DHO900 (DHO802, DHO804, DHO914, DHO924), DHO1000 / DHO4000 (DHO1072 โฆ DHO4804) |
|
|
24
|
+
| **Interfaces** | USB (USB-TMC), LAN (VXI-11/LXI, raw socket) |
|
|
25
|
+
| **Protocol** | SCPI per Rigol's programming guides: [MSO1000Z/DS1000Z PGA19109-1110](https://www.bitsavers.org/test_equipment/rigol/DS1000Z/PGA19109-1110_MSO1000Z_DS1000Z_Series_Digital_Oscilloscope_Programming_Guide_201807.pdf), [DS1000Z-E PGA27100-1110](https://www.batronix.com/files/Rigol/Oszilloskope/DS1000Z-E/DS1000Z-E-ProgrammingGuide.pdf), [MSO5000 PGA25104-1110](https://www.batronix.com/files/Rigol/Oszilloskope/MSO5000/MSO5000_ProgrammingGuide_EN-V2.0.pdf), [DHO800/DHO900](https://download.rigol.com/en/Manual/Digital%20Oscilloscope/DHO900/DHO800900_ProgrammingGuide_EN.pdf), [DHO1000/DHO4000 PGA34101-1110](https://www.batronix.com/files/Rigol/Oszilloskope/DHO1000/dho10004000_programmingguide_en.pdf) |
|
|
26
|
+
| **Status** | ๐งช **simulated**: tested against a wire-level SCPI simulator (including binary waveform and screenshot blocks), not yet verified on hardware. [Report a hardware test](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml) |
|
|
27
|
+
|
|
28
|
+
## Try it without hardware
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uvx labmcp-rigol-scope --simulate --check
|
|
32
|
+
uvx labmcp-rigol-scope --simulate --option sim_model=DHO804 --check # also DS1202Z-E, MSO5074, DHO1204 ...
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The simulated scope has a 1 kHz, 0-3 V square wave on CH1 and a 2 kHz, 1 V sine on CH2 (CH3/CH4 grounded). It answers `:WAVeform:DATA?` and `:DISPlay:DATA?` with real IEEE 488.2 binary blocks, keeps an SCPI error queue, and its trigger only fires when the level is inside the signal, so you can try `single` with a bad trigger level.
|
|
36
|
+
|
|
37
|
+
## Connect your oscilloscope
|
|
38
|
+
|
|
39
|
+
1. **USB:** plug in the USB device port. The server uses PyVISA with the pure-Python `pyvisa-py` backend, which needs `libusb` on the system (`brew install libusb`, `apt install libusb-1.0-0`; on Windows use NI-VISA with `?backend=@ivi`). Find the resource with `python -m pyvisa info` or `uvx labmcp ports`.
|
|
40
|
+
2. **LAN:** in the scope's *Utility* I/O / LAN settings enable DHCP or set a static IP, and note the address.
|
|
41
|
+
3. **Test the connection:**
|
|
42
|
+
```bash
|
|
43
|
+
uvx labmcp-rigol-scope --address USB0::0x1AB1::0x04CE::DS1ZA123456789::INSTR --check # USB-TMC
|
|
44
|
+
uvx labmcp-rigol-scope --address TCPIP0::192.168.1.50::INSTR --check # LAN (VXI-11)
|
|
45
|
+
uvx labmcp-rigol-scope --address tcp://192.168.1.50:5555 --check # LAN raw socket
|
|
46
|
+
```
|
|
47
|
+
`--check` prints the `*IDN?` identity and the detected command family.
|
|
48
|
+
|
|
49
|
+
## Add to your MCP client
|
|
50
|
+
|
|
51
|
+
**Claude Code**
|
|
52
|
+
```bash
|
|
53
|
+
claude mcp add scope -- uvx labmcp-rigol-scope --address TCPIP0::192.168.1.50::INSTR
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Claude Desktop / Cursor / Windsurf** (`claude_desktop_config.json`, `.cursor/mcp.json`, โฆ)
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"scope": {
|
|
61
|
+
"command": "uvx",
|
|
62
|
+
"args": ["labmcp-rigol-scope", "--address", "TCPIP0::192.168.1.50::INSTR"]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Add `--read-only` to allow reading settings, measurements, waveforms and screenshots while blocking every tool that changes the scope setup. For other clients, generate the snippet with `uvx labmcp config rigol-oscilloscope --address TCPIP0::192.168.1.50::INSTR --client vscode` (also `cursor`, `codex`, `claude-code`).
|
|
69
|
+
|
|
70
|
+
## Tools
|
|
71
|
+
|
|
72
|
+
<!-- TOOLS:START -->
|
|
73
|
+
| Tool | Kind | Description |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `autoscale` | ๐ control | 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. |
|
|
76
|
+
| `capture_waveform` | ๐ read | 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. |
|
|
77
|
+
| `force_trigger` | ๐ control | Force one trigger (FORCE key). Only has an effect in NORMal or SINGle sweep while waiting. |
|
|
78
|
+
| `get_command_log` | ๐ read | Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done. |
|
|
79
|
+
| `get_connection_info` | ๐ read | Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first. |
|
|
80
|
+
| `get_device_info` | ๐ read | 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. |
|
|
81
|
+
| `get_settings` | ๐ read | 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. |
|
|
82
|
+
| `measure` | ๐ read | 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. |
|
|
83
|
+
| `reconnect` | ๐ safety | Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged). |
|
|
84
|
+
| `run` | ๐ control | Start continuous acquisition (RUN). |
|
|
85
|
+
| `screenshot` | ๐ read | 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. |
|
|
86
|
+
| `set_channel` | ๐ control | 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. |
|
|
87
|
+
| `set_timebase` | ๐ control | Set the main timebase scale and/or offset. Returns the applied values. |
|
|
88
|
+
| `set_trigger` | ๐ control | 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. |
|
|
89
|
+
| `single` | ๐ control | 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`. |
|
|
90
|
+
| `stop` | ๐ control | Stop acquisition (STOP) and freeze the current waveforms, e.g. before reading deep memory. |
|
|
91
|
+
<!-- TOOLS:END -->
|
|
92
|
+
|
|
93
|
+
`get_connection_info`, `get_command_log` and `reconnect` are built into every LabMCP server. The command log shows every SCPI command sent.
|
|
94
|
+
|
|
95
|
+
## Safety limits
|
|
96
|
+
|
|
97
|
+
| Limit | Default | Meaning |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `max_memory_points` | 1 200 000 points | Most points read from acquisition memory in one capture (bounds transfer time) |
|
|
100
|
+
|
|
101
|
+
Override at launch, e.g. `--limit max_memory_points=24000000`. An oscilloscope does not source energy, so there are no hazard tools; this server does not control the built-in waveform generator some models have.
|
|
102
|
+
|
|
103
|
+
## Example prompts
|
|
104
|
+
|
|
105
|
+
- "What is on the scope right now? Give me the channel settings, timebase and trigger."
|
|
106
|
+
- "Measure the frequency, Vpp and rise time on CH1."
|
|
107
|
+
- "Set CH2 to 200 mV/div, AC coupling, trigger on CH2 falling edge at 0 V, then take a single shot and save the full memory record to ~/data/burst.csv."
|
|
108
|
+
- "Capture the CH1 waveform from the screen and tell me the duty cycle and whether the trace is clipped."
|
|
109
|
+
- "Take a screenshot of the scope so I can put it in my lab notebook."
|
|
110
|
+
|
|
111
|
+
## Notes
|
|
112
|
+
|
|
113
|
+
- **One driver, three command families.** Commands common to all guides are used as written (long forms, e.g. `:TRIGger:EDGE:LEVel`, `:MEASure:ITEM? VPP,CHANnel1`, `:WAVeform:PREamble?`). The differences are taken from each guide: autoscale is `:AUToscale` (DS1000Z, MSO5000) or `:AUToset` (DHO); screenshots are `:DISPlay:DATA? ON,OFF,PNG` (DS1000Z), `:DISPlay:DATA? PNG` (DHO) or `:DISPlay:DATA?` โ BMP (MSO5000); screen captures return 1200 points (DS1000Z, 12 divisions) or 1000 (MSO5000/DHO, 10 divisions). The family is detected from `*IDN?`; unknown Rigol models are refused unless you force `--option profile=DS1000Z|MSO5000|DHO`.
|
|
114
|
+
- **Waveform scaling** always uses `:WAVeform:PREamble?` and BYTE format: volts = (byte โ YORigin โ YREFerence) ร YINCrement. WORD format is not used because the DHO guides do not document its byte order. For the 12-bit DHO scopes this means 8-bit screen/memory data.
|
|
115
|
+
- **Deep memory** (`mode="memory"`) follows the documented RAW procedure: stop the scope, then read in batches of 250 000 points with `:WAVeform:STARt/STOP` (the DS1000Z maximum for BYTE). The MSO5000 and DHO guides document batched reads but not a maximum; the server checks every batch length and fails clearly if a batch comes back short. *Not yet verified on MSO5000/DHO hardware.*
|
|
116
|
+
- **Measurements** return `null` when the scope answers 9.9E37 (cannot measure). Duty cycle and overshoot are reported exactly as the scope returns them (the DS1000Z guide defines duty as a ratio).
|
|
117
|
+
- **Setting commands are checked** by reading `:SYSTem:ERRor?` afterwards, so an out-of-range scale, offset or trigger level is reported instead of silently ignored. The scale snaps to 1-2-5 steps unless fine adjustment (VERNier) is on.
|
|
118
|
+
- **LAN:** the programming guides describe LAN access through VISA (VXI-11/LXI, `TCPIP0::<ip>::INSTR`). Rigol scopes also accept raw SCPI on TCP port 5555 (`tcp://<ip>:5555`); that port is widely used but not stated in these guides.
|
|
119
|
+
- **USB** additionally needs `libusb` for `pyvisa-py`; `pyusb` is installed with this package.
|
|
120
|
+
- Screenshots are returned as MCP image content only for PNG; large BMP screenshots (MSO5000) are saved to disk and the path is returned.
|
|
121
|
+
|
|
122
|
+
## Hardware verification
|
|
123
|
+
|
|
124
|
+
| Model | Firmware | Interface | Verified by | Date |
|
|
125
|
+
|---|---|---|---|---|
|
|
126
|
+
| *none yet: [be the first](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml)* | | | | |
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Rigol Oscilloscope โ MCP Server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.K-Dense-AI/labmcp-rigol-scope -->
|
|
4
|
+
|
|
5
|
+
Let an AI agent read the setup, adjust channels, timebase and trigger, run single acquisitions, take the scope's own measurements, capture calibrated waveforms and grab screenshots on **Rigol digital oscilloscopes** over SCPI.
|
|
6
|
+
|
|
7
|
+
| | |
|
|
8
|
+
|---|---|
|
|
9
|
+
| **Package** | `labmcp-rigol-scope` |
|
|
10
|
+
| **Instruments** | DS1000Z / MSO1000Z (DS1054Z, DS1074Z, DS1104Z, MSO1104Z, "Plus" models), DS1000Z-E (DS1102Z-E, DS1202Z-E), MSO5000 (MSO5072 โฆ MSO5354), DHO800 / DHO900 (DHO802, DHO804, DHO914, DHO924), DHO1000 / DHO4000 (DHO1072 โฆ DHO4804) |
|
|
11
|
+
| **Interfaces** | USB (USB-TMC), LAN (VXI-11/LXI, raw socket) |
|
|
12
|
+
| **Protocol** | SCPI per Rigol's programming guides: [MSO1000Z/DS1000Z PGA19109-1110](https://www.bitsavers.org/test_equipment/rigol/DS1000Z/PGA19109-1110_MSO1000Z_DS1000Z_Series_Digital_Oscilloscope_Programming_Guide_201807.pdf), [DS1000Z-E PGA27100-1110](https://www.batronix.com/files/Rigol/Oszilloskope/DS1000Z-E/DS1000Z-E-ProgrammingGuide.pdf), [MSO5000 PGA25104-1110](https://www.batronix.com/files/Rigol/Oszilloskope/MSO5000/MSO5000_ProgrammingGuide_EN-V2.0.pdf), [DHO800/DHO900](https://download.rigol.com/en/Manual/Digital%20Oscilloscope/DHO900/DHO800900_ProgrammingGuide_EN.pdf), [DHO1000/DHO4000 PGA34101-1110](https://www.batronix.com/files/Rigol/Oszilloskope/DHO1000/dho10004000_programmingguide_en.pdf) |
|
|
13
|
+
| **Status** | ๐งช **simulated**: tested against a wire-level SCPI simulator (including binary waveform and screenshot blocks), not yet verified on hardware. [Report a hardware test](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml) |
|
|
14
|
+
|
|
15
|
+
## Try it without hardware
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uvx labmcp-rigol-scope --simulate --check
|
|
19
|
+
uvx labmcp-rigol-scope --simulate --option sim_model=DHO804 --check # also DS1202Z-E, MSO5074, DHO1204 ...
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The simulated scope has a 1 kHz, 0-3 V square wave on CH1 and a 2 kHz, 1 V sine on CH2 (CH3/CH4 grounded). It answers `:WAVeform:DATA?` and `:DISPlay:DATA?` with real IEEE 488.2 binary blocks, keeps an SCPI error queue, and its trigger only fires when the level is inside the signal, so you can try `single` with a bad trigger level.
|
|
23
|
+
|
|
24
|
+
## Connect your oscilloscope
|
|
25
|
+
|
|
26
|
+
1. **USB:** plug in the USB device port. The server uses PyVISA with the pure-Python `pyvisa-py` backend, which needs `libusb` on the system (`brew install libusb`, `apt install libusb-1.0-0`; on Windows use NI-VISA with `?backend=@ivi`). Find the resource with `python -m pyvisa info` or `uvx labmcp ports`.
|
|
27
|
+
2. **LAN:** in the scope's *Utility* I/O / LAN settings enable DHCP or set a static IP, and note the address.
|
|
28
|
+
3. **Test the connection:**
|
|
29
|
+
```bash
|
|
30
|
+
uvx labmcp-rigol-scope --address USB0::0x1AB1::0x04CE::DS1ZA123456789::INSTR --check # USB-TMC
|
|
31
|
+
uvx labmcp-rigol-scope --address TCPIP0::192.168.1.50::INSTR --check # LAN (VXI-11)
|
|
32
|
+
uvx labmcp-rigol-scope --address tcp://192.168.1.50:5555 --check # LAN raw socket
|
|
33
|
+
```
|
|
34
|
+
`--check` prints the `*IDN?` identity and the detected command family.
|
|
35
|
+
|
|
36
|
+
## Add to your MCP client
|
|
37
|
+
|
|
38
|
+
**Claude Code**
|
|
39
|
+
```bash
|
|
40
|
+
claude mcp add scope -- uvx labmcp-rigol-scope --address TCPIP0::192.168.1.50::INSTR
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Claude Desktop / Cursor / Windsurf** (`claude_desktop_config.json`, `.cursor/mcp.json`, โฆ)
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"scope": {
|
|
48
|
+
"command": "uvx",
|
|
49
|
+
"args": ["labmcp-rigol-scope", "--address", "TCPIP0::192.168.1.50::INSTR"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Add `--read-only` to allow reading settings, measurements, waveforms and screenshots while blocking every tool that changes the scope setup. For other clients, generate the snippet with `uvx labmcp config rigol-oscilloscope --address TCPIP0::192.168.1.50::INSTR --client vscode` (also `cursor`, `codex`, `claude-code`).
|
|
56
|
+
|
|
57
|
+
## Tools
|
|
58
|
+
|
|
59
|
+
<!-- TOOLS:START -->
|
|
60
|
+
| Tool | Kind | Description |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `autoscale` | ๐ control | 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. |
|
|
63
|
+
| `capture_waveform` | ๐ read | 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. |
|
|
64
|
+
| `force_trigger` | ๐ control | Force one trigger (FORCE key). Only has an effect in NORMal or SINGle sweep while waiting. |
|
|
65
|
+
| `get_command_log` | ๐ read | Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done. |
|
|
66
|
+
| `get_connection_info` | ๐ read | Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first. |
|
|
67
|
+
| `get_device_info` | ๐ read | 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. |
|
|
68
|
+
| `get_settings` | ๐ read | 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. |
|
|
69
|
+
| `measure` | ๐ read | 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. |
|
|
70
|
+
| `reconnect` | ๐ safety | Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged). |
|
|
71
|
+
| `run` | ๐ control | Start continuous acquisition (RUN). |
|
|
72
|
+
| `screenshot` | ๐ read | 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. |
|
|
73
|
+
| `set_channel` | ๐ control | 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. |
|
|
74
|
+
| `set_timebase` | ๐ control | Set the main timebase scale and/or offset. Returns the applied values. |
|
|
75
|
+
| `set_trigger` | ๐ control | 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. |
|
|
76
|
+
| `single` | ๐ control | 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`. |
|
|
77
|
+
| `stop` | ๐ control | Stop acquisition (STOP) and freeze the current waveforms, e.g. before reading deep memory. |
|
|
78
|
+
<!-- TOOLS:END -->
|
|
79
|
+
|
|
80
|
+
`get_connection_info`, `get_command_log` and `reconnect` are built into every LabMCP server. The command log shows every SCPI command sent.
|
|
81
|
+
|
|
82
|
+
## Safety limits
|
|
83
|
+
|
|
84
|
+
| Limit | Default | Meaning |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `max_memory_points` | 1 200 000 points | Most points read from acquisition memory in one capture (bounds transfer time) |
|
|
87
|
+
|
|
88
|
+
Override at launch, e.g. `--limit max_memory_points=24000000`. An oscilloscope does not source energy, so there are no hazard tools; this server does not control the built-in waveform generator some models have.
|
|
89
|
+
|
|
90
|
+
## Example prompts
|
|
91
|
+
|
|
92
|
+
- "What is on the scope right now? Give me the channel settings, timebase and trigger."
|
|
93
|
+
- "Measure the frequency, Vpp and rise time on CH1."
|
|
94
|
+
- "Set CH2 to 200 mV/div, AC coupling, trigger on CH2 falling edge at 0 V, then take a single shot and save the full memory record to ~/data/burst.csv."
|
|
95
|
+
- "Capture the CH1 waveform from the screen and tell me the duty cycle and whether the trace is clipped."
|
|
96
|
+
- "Take a screenshot of the scope so I can put it in my lab notebook."
|
|
97
|
+
|
|
98
|
+
## Notes
|
|
99
|
+
|
|
100
|
+
- **One driver, three command families.** Commands common to all guides are used as written (long forms, e.g. `:TRIGger:EDGE:LEVel`, `:MEASure:ITEM? VPP,CHANnel1`, `:WAVeform:PREamble?`). The differences are taken from each guide: autoscale is `:AUToscale` (DS1000Z, MSO5000) or `:AUToset` (DHO); screenshots are `:DISPlay:DATA? ON,OFF,PNG` (DS1000Z), `:DISPlay:DATA? PNG` (DHO) or `:DISPlay:DATA?` โ BMP (MSO5000); screen captures return 1200 points (DS1000Z, 12 divisions) or 1000 (MSO5000/DHO, 10 divisions). The family is detected from `*IDN?`; unknown Rigol models are refused unless you force `--option profile=DS1000Z|MSO5000|DHO`.
|
|
101
|
+
- **Waveform scaling** always uses `:WAVeform:PREamble?` and BYTE format: volts = (byte โ YORigin โ YREFerence) ร YINCrement. WORD format is not used because the DHO guides do not document its byte order. For the 12-bit DHO scopes this means 8-bit screen/memory data.
|
|
102
|
+
- **Deep memory** (`mode="memory"`) follows the documented RAW procedure: stop the scope, then read in batches of 250 000 points with `:WAVeform:STARt/STOP` (the DS1000Z maximum for BYTE). The MSO5000 and DHO guides document batched reads but not a maximum; the server checks every batch length and fails clearly if a batch comes back short. *Not yet verified on MSO5000/DHO hardware.*
|
|
103
|
+
- **Measurements** return `null` when the scope answers 9.9E37 (cannot measure). Duty cycle and overshoot are reported exactly as the scope returns them (the DS1000Z guide defines duty as a ratio).
|
|
104
|
+
- **Setting commands are checked** by reading `:SYSTem:ERRor?` afterwards, so an out-of-range scale, offset or trigger level is reported instead of silently ignored. The scale snaps to 1-2-5 steps unless fine adjustment (VERNier) is on.
|
|
105
|
+
- **LAN:** the programming guides describe LAN access through VISA (VXI-11/LXI, `TCPIP0::<ip>::INSTR`). Rigol scopes also accept raw SCPI on TCP port 5555 (`tcp://<ip>:5555`); that port is widely used but not stated in these guides.
|
|
106
|
+
- **USB** additionally needs `libusb` for `pyvisa-py`; `pyusb` is installed with this package.
|
|
107
|
+
- Screenshots are returned as MCP image content only for PNG; large BMP screenshots (MSO5000) are saved to disk and the path is returned.
|
|
108
|
+
|
|
109
|
+
## Hardware verification
|
|
110
|
+
|
|
111
|
+
| Model | Firmware | Interface | Verified by | Date |
|
|
112
|
+
|---|---|---|---|---|
|
|
113
|
+
| *none yet: [be the first](https://github.com/K-Dense-AI/lab-instrument-mcps/issues/new?template=hardware-verification.yml)* | | | | |
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "labmcp-rigol-scope"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server for Rigol digital oscilloscopes (DS1000Z/MSO1000Z, DS1000Z-E, MSO5000, DHO800/900/1000/4000): settings, triggering, measurements, waveform capture and screenshots over SCPI."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [{ name = "K-Dense and LabMCP contributors" }]
|
|
9
|
+
keywords = ["mcp", "lab-instrument", "oscilloscope", "rigol", "scpi", "ds1054z", "dho800", "mso5000", "waveform"]
|
|
10
|
+
dependencies = ["labmcp[visa]>=0.1,<0.2", "pyusb>=1.2"]
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
labmcp-rigol-scope = "labmcp_rigol_scope.server:main"
|
|
14
|
+
|
|
15
|
+
[project.urls]
|
|
16
|
+
Homepage = "https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/rigol-oscilloscope"
|
|
17
|
+
|
|
18
|
+
[tool.labmcp]
|
|
19
|
+
name = "Rigol Oscilloscope"
|
|
20
|
+
domain = "engineering"
|
|
21
|
+
category = "Oscilloscope"
|
|
22
|
+
vendor = "Rigol"
|
|
23
|
+
models = ["DS1000Z / MSO1000Z (DS1054Z, DS1104Z...)", "DS1000Z-E (DS1202Z-E)", "MSO5000", "DHO800 / DHO900", "DHO1000 / DHO4000"]
|
|
24
|
+
interfaces = ["USB (USB-TMC)", "LAN (VXI-11 / raw socket)"]
|
|
25
|
+
protocol = "SCPI (Rigol programming guides)"
|
|
26
|
+
summary = "Read settings, autoscale, run/stop/single, set channels, timebase and edge trigger, take measurements, capture scaled waveforms (screen or deep memory) and screenshots."
|
|
27
|
+
status = "simulated"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["hatchling"]
|
|
31
|
+
build-backend = "hatchling.build"
|
|
32
|
+
|
|
33
|
+
[tool.hatch.build.targets.wheel]
|
|
34
|
+
packages = ["src/labmcp_rigol_scope"]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.K-Dense-AI/labmcp-rigol-scope",
|
|
4
|
+
"title": "Rigol Oscilloscope",
|
|
5
|
+
"description": "MCP server for Rigol digital oscilloscopes (DS1000Z/MSO1000Z, DS1000Z-E, MSO5000, DHO800/900/1000/40",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "https://github.com/K-Dense-AI/lab-instrument-mcps",
|
|
9
|
+
"source": "github",
|
|
10
|
+
"subfolder": "servers/engineering/rigol-oscilloscope"
|
|
11
|
+
},
|
|
12
|
+
"websiteUrl": "https://github.com/K-Dense-AI/lab-instrument-mcps/tree/main/servers/engineering/rigol-oscilloscope",
|
|
13
|
+
"packages": [
|
|
14
|
+
{
|
|
15
|
+
"registryType": "pypi",
|
|
16
|
+
"registryBaseUrl": "https://pypi.org",
|
|
17
|
+
"identifier": "labmcp-rigol-scope",
|
|
18
|
+
"version": "0.1.0",
|
|
19
|
+
"transport": {
|
|
20
|
+
"type": "stdio"
|
|
21
|
+
},
|
|
22
|
+
"environmentVariables": [
|
|
23
|
+
{
|
|
24
|
+
"name": "LABMCP_ADDRESS",
|
|
25
|
+
"description": "Instrument address, e.g. serial:///dev/ttyUSB0 or tcp://192.168.1.50:5025",
|
|
26
|
+
"isRequired": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "LABMCP_SIMULATE",
|
|
30
|
+
"description": "Set to 1 to use the built-in simulator (no hardware)",
|
|
31
|
+
"isRequired": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "LABMCP_READ_ONLY",
|
|
35
|
+
"description": "Set to 1 to disable all state-changing tools",
|
|
36
|
+
"isRequired": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "LABMCP_LIMITS",
|
|
40
|
+
"description": "Safety limit overrides, e.g. max_temperature_c=80",
|
|
41
|
+
"isRequired": false
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""LabMCP server for Rigol digital oscilloscopes (SCPI)."""
|