scope_capture_channels
Capture multiple oscilloscope channels atomically from a single snapshot and save synchronized time-domain waveforms to a .npz file for cross-channel analysis and plotting.
Instructions
Capture multiple channels atomically and save to a single .npz file.
Use this when you need time-domain signals from multiple channels (plotting, cross-channel analysis, export). For scalar results like peak voltage or frequency, prefer scope_measure — no waveform transfer needed.
If the scope is already stopped (e.g. from a previous capture), arms it first and waits for a fresh acquisition before reading. All channels are read within a single VISA lock hold so the waveforms come from the same snapshot. Always leaves the scope stopped after capture.
Saves to 'waveforms/' with an auto-generated filename, e.g.: waveforms/C3F1_20260329_153042.npz
The .npz file contains arrays: time_s, c3, f1, ... (one per channel). Analog channels use keys like c1, c2; math channels use f1, f2, etc.
Load in Python with: import numpy as np d = np.load('/path/to/file.npz') time_s, c3, f1 = d['time_s'], d['c3'], d['f1']
Args: channels: List of analog channel numbers (e.g. [1, 2]) and/or math channel strings (e.g. ["F1", "F2"]). Mixed lists are supported, e.g. [3, "F1"] captures C3 and the F1 math trace together. max_points: Maximum samples per channel (default 10000, evenly downsampled).
Transport: SCPI (binary WF? DAT1 transfer + INSPECT? WAVEDESC scaling)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channels | Yes | ||
| max_points | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |