scope_get_waveform
Capture time-domain waveform data from a selected channel, arm the scope if stopped, and save as .npz file for offline analysis. Returns file path and metadata; load with numpy for plotting or export.
Instructions
Capture waveform data from a channel and save it as a .npz file.
Use this when you need the time-domain signal (plotting, export, detailed analysis). For scalar results like peak voltage, frequency, or RMS, prefer scope_measure — it is faster and uses all scope points without any transfer.
If the scope is already stopped (e.g. from a previous capture), arms it first and waits for a fresh acquisition before reading. Always leaves the scope stopped after capture so the on-screen waveform matches the file.
Saves to a 'waveforms/' subfolder with an auto-generated filename, e.g.: waveforms/C1_20260329_153042.npz
Returns JSON with the file path and metadata — the raw voltage values are not embedded in the result. Load the file in Python with: import numpy as np d = np.load('/path/to/file.npz') time_s, voltage_v = d['time_s'], d['voltage_v']
Args: channel: Channel number 1–4 max_points: Maximum samples to capture (default 10000, evenly downsampled).
Transport: SCPI (binary WF? DAT1 transfer + INSPECT? WAVEDESC scaling)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| max_points | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |