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.
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
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?
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!
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:
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.)
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.
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
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>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
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
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.
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.
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.
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?