Skip to main content

Rigol 800 control library (unofficial)

Project description

Rigol DHOxxx oscilloscope Python library (unofficial)

Based completely on https://github.com/tspspi/pymso5000/tree/master by tspspi

A Rigol DHO800 setup

A simple Python library and utility to control and query data from Rigol DHOxxx oscilloscopes. This library implements the Oscilloscope class from the pylabdevs package which exposes the public interface.

When retrieving sample point data from the scope, the number of points retrieved is set by the scope's memory depth.

The default memory depth of the scope is set to 10k points. This can be changed through the set_memory_depth() function

Alternatively this can be changed by accessing the following menus on the scope:

Click on any channel and click "Acquisition": Click on any Channel

Change the memory depth: Change the memory depth

Installing

There is a PyPi package that can be installed using

pip install pydho800

Simple example to fetch waveforms:

from pydho800.pydho800 import PYDHO800

with DHO800(address = "10.0.0.123") as dho:
    print(f"Identify: {dho.identify()}")

    dho.set_channel_enable(0, True)
    dho.set_channel_enable(1, True)

    dho.set_run_mode(OscilloscopeRunMode.RUN)
    dho.set_run_mode(OscilloscopeRunMode.STOP)

    data = dho.query_waveform((0, 1))
    print(data)

    import matplotlib.pyplot as plt
    plt.plot(data['x'], data['y0'], label = "Ch1")
    plt.plot(data['x'], data['y1'], label = "Ch2")

    # Note if only one channel were enabled, it would be accessed by:
    # plt.plot(data['x'], data['y'], label = "Ch1")

    plt.show()

Note that numpy usage is optional for this implementation. One can enable numpy support using useNumpy = True in the constructor.

Querying additional statistics

This module allows - via the pylabdevs base class to query additional statistics:

  • mean Calculates the mean values and standard deviations
    • A single value for each channels mean at ["means"]["yN_avg"] and a single value for each standard deviation at ["means"]["yN_std"] where N is the channel number
  • fft runs Fourier transform on all queried traces
    • The result is stored in ["fft"]["yN"] (complex values) and in ["fft"]["yN_real"] for the real valued Fourier transform. Again N is the channel number
  • ifft runs inverse Fourier transform on all queried traces
    • Works as fft but runs the inverse Fourier transform and stores its result in ifft instead of fft
  • correlate calculates the correlation between all queried waveform pairs.
    • The result of the correlations are stored in ["correlation"]["yNyM"] for the correlation between channels M and N
  • autocorrelate performs calculation of the autocorrelation of each queried channel.
    • The result of the autocorrelation is stored in ["autocorrelation"]["yN"] for channel N

To request calculation of statistics pass the string for the desired statistic or a list of statistics to the stats parameter of query_waveform:

with DHO800(address = "10.0.0.123") as dho:
	data = dho.query_waveform((1,2), stats = [ 'mean', 'fft' ])

Supported methods

More documentation in progress ...

  • identify()
  • Connection management (when not using with context management):
    • connect()
    • disconnect()
  • set_channel_enable(channel, enabled)
  • is_channel_enabled(channel)
  • set_sweep_mode(mode)
  • get_sweep_mode()
  • set_trigger_mode(mode)
  • get_trigger_mode()
  • force_trigger()
  • set_timebase_mode(mode)
  • get_timebase_mode()
  • set_run_mode(mode)
  • get_run_mode()
  • set_timebase_scale(secondsPerDivision)
  • get_timebase_scale()
  • set_channel_coupling(channel, couplingMode)
  • get_channel_coupling(channel)
  • set_channel_probe_ratio(channel, ratio)
  • get_channel_probe_ratio(channel)
  • set_channel_scale(channel, scale)
  • get_channel_scale(channel)
  • query_waveform(channel, stats = None)
  • off()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydho800-0.0.8.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydho800-0.0.8-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file pydho800-0.0.8.tar.gz.

File metadata

  • Download URL: pydho800-0.0.8.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pydho800-0.0.8.tar.gz
Algorithm Hash digest
SHA256 6e84b66a8b306927ca9ade4bcbdea2b880c7b0d1adb6c8dd5f0c9e8aa56f01a1
MD5 2f76a679ecba3271f1e85d53c3f2f374
BLAKE2b-256 e03a0f5ee01ef7ac752562c5f8a9e8b96c783cc872594dd939ecc9423c7416d4

See more details on using hashes here.

File details

Details for the file pydho800-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: pydho800-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pydho800-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ef70f6d439726398c73a369989c8a4dfbc70506c16440c431c5e8da3c6e38920
MD5 d5184ce7a40d4bb898cae833cd758428
BLAKE2b-256 c65d96e9805e12882675024ff3ee88369ab4f0951853aa516a5f51595e84911c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page