Hackaday.io Hackaday.io
Projects
Discover Contests Courses Stack
More
Courses Tutorials Events Hackerspaces Hackaday.com Tindie Marketplace
Sign up Log in
Close
0%
0%

ds1054z Python Package

Control your DS1000Z series oscilloscope from Python: screenshots, settings, deep memory, and more.

philipp-klausPhilipp Klaus
Following Follow project
Liked Like project

Become a Hackaday.io member

Not a member? You should Sign up.

Already have an account? Log in.

Sign up with Github
Sign up with Twitter
OR
Forgot your password?

Just one more thing

To make the experience fit your profile, pick a username and tell us what interests you.

Pick an awesome username
hackaday.io/
Your profile's URL: hackaday.io/username. Max 25 alphanumeric characters.
Pick a few interests
Projects that share your interests
People that share your interests

We found and based on your interests.

Choose more interests.

OK, I'm done! Skip
Join this project
Similar projects worth following
2.9k views
6 comments
966 followers
9 likes
  • Description
  • Details
  • Files 0
  • Components 0
  • Logs 1
    • View all
  • Instructions 0
  • Discussion 6
View Gallery
2.9k
6
966
9

Team (1)

  • philipp-klausPhilipp Klaus

Join this project's team
  • pklaus/ds1054z
  • PyPI: ds1054z
Software
ongoing project
oscilloscope python LXI DS1054Z DS1000Z scpi VXI-11 Rigol Instrument

This project was created on 09/17/2015 and last updated 9 months ago.

Description

I wrote a Python package to let you access all the nice features of your DS1054Z oscilloscope with Python. It's published on Github: https://github.com/pklaus/ds1054z

This package allows you to connect to your Rigol DS1054Z oscilloscope via Ethernet. It comes with a versatile command line tool. But off course, you can also use it to control the scope with your own script by using the API this package has to offer.

While this software is named after the entry level oscilloscope DS1054Z, I believe there is no reason it wouldn't work with just any scope of the DS1000Z and MSO1000Z series by Rigol.

Project Logs
Collapse

  • New release v0.4.0

    Philipp Klaus • 08/15/2017 at 21:30 • 0 comments

    Hi everyone, Just want to let you now that I just published v0.4.0 of this software (on Github and on PyPI). The major change is that downloading screenshots is now *much* faster. (Using PNG download now instead of BMP24.) Please check that you're running the latest firmware, though. The changelog is to be found here: https://github.com/pklaus/ds1054z/releases/tag/v0.4.0

View project log

Enjoy this project?

Share

Discussions

Log In/Sign up to comment

Become a Hackaday.io Member

Create an account to leave a comment. Already have an account? Log In.

Sign up with Github
Sign up with Twitter
OR
Christoph wrote 12/18/2018 at 18:58 • point

I have the python zeroconf package, but the cli complains:
"Please specify a device to connect to. Auto-discovery doesn't work because the zeroconf Python package is missing."
I then tried to just open python and import zeroconf, and it failed:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/zeroconf.py", line 175
    def current_time_millis() -> float:
                              ^
SyntaxError: invalid syntax

So something's wrong with zeroconf. I looked further and it seems that zeroconf is not supporting python 2 any more.

Should the cli work with python 3, and how would I start it with python 3?

  Are you sure? yes | no

alexwhittemore wrote 04/23/2018 at 15:08 • point

Just wanted to let you know that a while back, I came across your project while trying to write some semi-automated tests for hardware I was working on, and found it extremely useful. Thanks for all the work!

  Are you sure? yes | no

Philipp Klaus wrote 09/18/2015 at 12:33 • point

Hi RoGeorge, thanks for your comment. And thanks for your prior work on the subject. That was helpful! The problem you're seeing should be fixed now with commit f785ef6. A small wrapper named ds1054z.exe should be placed in your PATH on windows when reinstalling the package. You can directly use the github zip download path in the pip installation command:

   pip install https://github.com/pklaus/ds1054z/archive/master.zip

This will get you the latest revision including the fix. (Besides, please note that you downloaded the zip file from Github manually but then installed the ds1054z package from the Python Package Index "pypi", not from your local file/folder! To install the one you downloaded you would have had to specify a "local path" for pip, like: pip install ./ds1054z-master.)

If you need the Pillow package for Windows, you can get it from http://www.lfd.uci.edu/~gohlke/pythonlibs/.

Please let me know if that does the job.

  Are you sure? yes | no

RoGeorge wrote 09/19/2015 at 14:44 • point

Yeee, it's working! Thank you very much for your help!

I guess I still miss some Python packages, because not all commands are working for me, but the most important ones, does work. I was able to get the oscilloscope info and to capture a screen. In the help command, there are listed a lot of nice features that I would like to try.

I really like your program, very well done!

Is there any way for a Python installer to check for all it's required dependencies?

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\m>cd C:\Users\m\Desktop\ds_tst

C:\Users\m\Desktop\ds_tst>pip install https://github.com/pklaus/ds1054z/archi
ve/master.zip
Downloading/unpacking https://github.com/pklaus/ds1054z/archive/master.zip
  Running setup.py (path:c:\users\m\appdata\local\temp\pip-esseqr-build\setup
.py) egg_info for package from https://github.com/pklaus/ds1054z/archive/master.
zip

Requirement already satisfied (use --upgrade to upgrade): python-vxi11 in c:\pyt
hon27\lib\site-packages (from ds1054z==0.3-dev)
Installing collected packages: ds1054z
  Found existing installation: ds1054z 0.3.4
    Uninstalling ds1054z:
      Successfully uninstalled ds1054z
  Running setup.py install for ds1054z

    Installing ds1054z-script.py script to C:\Python27\Scripts
    Installing ds1054z.exe script to C:\Python27\Scripts
    Installing ds1054z.exe.manifest script to C:\Python27\Scripts
Successfully installed ds1054z
Cleaning up...

C:\Users\m\Desktop\ds_tst>ds1054z.exe
usage: ds1054z-script.py [-h] [-v] ...
ds1054z-script.py: error: too few arguments

C:\Users\m\Desktop\ds_tst>ds1054z.exe -h
usage: ds1054z-script.py [-h] [-v] ...

CLI for the DS1054Z scope by Rigol

This tool can be used in very versatile ways.
Ask it for --help on the individual actions
and it will tell you how to use them.

positional arguments:
        Action to perform on the scope:
    discover     Discover and list scopes on your network and exit
    info         Print information about your oscilloscope
    cmd          Send an SCPI command to the oscilloscope
    save-screen  Save an image of the screen
    save-data    Save the waveform data to a file
    properties   Query properties of the DS1054Z instance
    run          Start the oscilloscope data acquisition
    stop         Stop the oscilloscope data acquisition
    single       Set the oscilloscope to the single trigger mode.
    tforce       Generate a trigger signal forcefully.
    shell        Start an interactive shell to control your scope.

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  More verbose output

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v discover
Discovery depends on the zeroconf Python package which is missing.

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v info
Please specify a device to connect to. Auto-discovery doesn't work because the z
eroconf Python package is missing.

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v info 192.168.1.3

Vendor:   RIGOL TECHNOLOGIES
Product:  DS1104Z
Serial:   manually_removed
Firmware: 00.04.03


C:\Users\m\Desktop\ds_tst>ds1054z.exe -v discover 192.168.1.3
usage: ds1054z-script.py [-h] [-v] ...
ds1054z-script.py: error: unrecognized arguments: 192.168.1.3

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
  File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
    load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
  File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
    import readline
ImportError: No module named readline

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v save-screen 192.168.1.3
Traceback (most recent call last):
  File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
    load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
  File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 245, in main
    im = Image.alpha_composite(im, overlay)
AttributeError: 'module' object has no attribute 'alpha_composite'

C:\Users\m\Desktop\ds_tst>pip install Pillow
Downloading/unpacking Pillow
Installing collected packages: Pillow
Successfully installed Pillow
Cleaning up...

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v save-screen 192.168.1.3
Saved file: ds1054z-scope-display_2015-09-19_17-18-17.png

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
  File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
    load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
  File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
    import readline
ImportError: No module named readline

C:\Users\m\Desktop\ds_tst>pip install pyCLI
Downloading/unpacking pyCLI
  Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_muuu\pyCLI\s
etup.py) egg_info for package pyCLI

Installing collected packages: pyCLI
  Running setup.py install for pyCLI

Successfully installed pyCLI
Cleaning up...

C:\Users\m\Desktop\ds_tst>ds1054z.exe -v shell 192.168.1.3
Traceback (most recent call last):
  File "C:\Python27\Scripts\ds1054z-script.py", line 9, in
    load_entry_point('ds1054z==0.3-dev', 'console_scripts', 'ds1054z')()
  File "C:\Python27\lib\site-packages\ds1054z\cli.py", line 304, in main
    import readline
ImportError: No module named readline

C:\Users\m\Desktop\ds_tst>

Once again, I'm impressed, congrats!

  Are you sure? yes | no

Philipp Klaus wrote 09/20/2015 at 11:00 • point

The command

     pip install --upgrade ds1054z[savescreen,discovery]

should get you up and running. The statements in the square brackets behind the package name tell pip to also fetch and install the requirements for those 'extra' features. Unfortunately this doesn't work if you directly install from the Github URL. But never mind, just install the version from PyPI with the command above to get all requirements and later run  pip install --upgrade https://github.com/pklaus/ds1054z/archive/master.zip if your really need the bleading edge version from Github - the packages for the extra dependencies will remain.

  Are you sure? yes | no

RoGeorge wrote 09/18/2015 at 09:34 • point

I'm glad to see other implementations, thanks for github credits!

I am not familiar with Python, and for some reason the script didn't worked for me. I downloaded the zip from github, then followed the redme installation steps:

<code>

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\m>cd C:\Users\m\Desktop\ds1054z-master

C:\Users\m\Desktop\ds1054z-master>pip install ds1054z
Downloading/unpacking ds1054z
  Downloading ds1054z-0.3.4.tar.gz
  Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_m\ds1054z
\setup.py) egg_info for package ds1054z

Downloading/unpacking python-vxi11 (from ds1054z)
  Downloading python-vxi11-0.8.tar.gz
  In the tar file c:\users\m\appdata\local\temp\pip-ozyypi-unpack\python-vxi1
1-0.8.tar.gz the member python-vxi11-0.8/README is invalid: unable to resolve li
nk inside archive
  Running setup.py (path:c:\users\m\appdata\local\temp\pip_build_m\python-
vxi11\setup.py) egg_info for package python-vxi11

Installing collected packages: ds1054z, python-vxi11
  Running setup.py install for ds1054z

  Running setup.py install for python-vxi11

    Installing vxi11-cli-script.py script to C:\Python27\Scripts
    Installing vxi11-cli.exe script to C:\Python27\Scripts
    Installing vxi11-cli.exe.manifest script to C:\Python27\Scripts
Successfully installed ds1054z python-vxi11
Cleaning up...

C:\Users\m\Desktop\ds1054z-master>ds1054z save-screen
'ds1054z' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\m\Desktop\ds1054z-master>ds1054z save-screen --overlay 0.6 192.168.1
.3
'ds1054z' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\m\Desktop\ds1054z-master>

</code>

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates

Going up?

About Us Contact Hackaday.io Give Feedback Terms of Use Privacy Policy Hackaday API

© 2025 Hackaday

Yes, delete it Cancel

Report project as inappropriate

You are about to report the project "ds1054z Python Package", please tell us the reason.

Send message

Your application has been submitted.

Remove Member

Are you sure you want to remove yourself as a member for this project?

Project owner will be notified upon removal.