Skip to main content
The oscilloscope module provides Python interfaces for waveform capture, triggering, and measurements.

Overview

Use the scope module to control oscilloscopes for analog signal capture, triggering on specific events, and automated measurements.

Import

Usage

Methods

Channel Control

enable()

Enable the oscilloscope channel.

disable()

Disable the oscilloscope channel.

Capture Control

start_capture()

Start continuous waveform capture.

start_single_capture()

Start single-shot capture (captures one triggered event).

stop_capture()

Stop waveform capture.

Measurements

Access comprehensive measurements through the measurement attribute:

Voltage Measurements

Timing Measurements

Counting Measurements

Area Measurements

Statistical Measurements

Delay and Phase Measurements

Measurement Options

Most measurements accept optional parameters:

Streaming (PicoScope)

For PicoScope devices, streaming capabilities are available:

stream_start(channel, volts_per_div, time_per_div, trigger_level, trigger_slope, capture_mode, coupling)

Start streaming acquisition. Parameters:
  • channel (str): Channel to enable - "A", "B", "1", "2"
  • volts_per_div (float): Vertical scale
  • time_per_div (float): Horizontal scale in seconds
  • trigger_level (float): Trigger level in volts
  • trigger_slope (str): "rising", "falling", "either"
  • capture_mode (str): "auto", "normal", "single"
  • coupling (str): "dc", "ac"

stream_stop()

Stop streaming acquisition.

stream_capture(output, duration, samples)

Capture data to file. Parameters:
  • output (str): Output file path
  • duration (float): Capture duration in seconds
  • samples (int): Number of samples (optional)

Complete Example

Trace Settings

Configure vertical and horizontal scale through trace_settings:

Advanced Trigger Settings

Access advanced trigger configuration through trigger_settings:

Cursor Control

Access cursor functions through the cursor attribute:

Supported Hardware

Notes

  • Use NetType.Analog for oscilloscope channels (1-4)
  • Use NetType.Logic for digital channels (D0-D15) on MSO scopes
  • Streaming features are only available on PicoScope devices
  • Configure trigger before starting capture for reliable measurements
  • Measurement methods return float on success, or None if the measurement is invalid (e.g., no signal, no trigger, wrong channel). On Rigol hardware, the instrument returns 9.9E+37 for invalid measurements, which is automatically converted to None.
  • For protocol triggering (UART, I2C, SPI, CAN), see the Logic Analyzer documentation