Saleae MSO API Documentation

Saleae MSO API Documentation#

Welcome to the documentation for the Saleae Mixed Signal Oscilloscope (MSO) API.

Saleae Logo

Overview#

This API provides programmatic access to Saleae Mixed Signal Oscilloscopes, allowing you to:

  • Configure and run analog, digital, or mixed-signal captures

  • Ingest the resulting binary data files into memory-mapped Numpy arrays, and

  • Some other things, like simple plotting of those captures

The MSO API runs on Windows and Linux computers currently (OSX support coming soon).

Installation#

See Installation for more detailed installation instructions.

We are currently hosting saleae-mso-api on our own private python package index so tools like uv, poetry or pip will retrieve it if given the URL:

With uv (which we recommend):

uv add saleae-mso-api --index https://downloads.saleae.com/pypi/

With pip:

pip install saleae-mso-api --extra-index-url https://downloads.saleae.com/pypi/

Quick Example#

The following demonstrates how to configure and execute a series of simple timed captures with the saleae-mso-api and a Logic MSO.

from pathlib import Path
import numpy as np
from saleae import mso_api

mso = mso_api.MSO()

capture_config = mso_api.CaptureConfig(
    enabled_channels=[mso_api.AnalogChannel(channel=0, name="clock")],
    analog_settings=mso_api.AnalogSettings(sample_rate=100e6),
    capture_settings=mso_api.TimedCapture(capture_length_seconds=0.1),
)

for n in range(3):
    save_dir = Path('my-captures') / f'{n:02d}'
    capture = mso.capture(capture_config, save_dir=save_dir)
    avg_voltage = np.mean(capture.analog_data["clock"].voltages)
    print(f"Capture {n:02d} in {save_dir} avg voltage: {avg_voltage:.3f} V")
Capture 00 in my-captures\00 avg voltage: 0.060 V
Capture 01 in my-captures\01 avg voltage: 0.061 V
Capture 02 in my-captures\02 avg voltage: 0.062 V

Learn more about how this example is structured by reading the following:

Warning

This is package is currently under heavy development, some significant features are missing and others may be evolving quickly. Things may change!

More#