pklaus / ds1054z Goto Github PK
View Code? Open in Web Editor NEWPython package for the Rigol DS1054Z Oscilloscope
Home Page: https://ds1054z.readthedocs.org/
Python package for the Rigol DS1054Z Oscilloscope
Home Page: https://ds1054z.readthedocs.org/
hello. this tool is great. just what i need.
my problem is i dont have ethernet in my computer.
does your app can work with usb ?
thanks!
Discovery depends on the zeroconf Python package which is missing. After running pip install zeroconf i then get the following message.
FutureWarning: <ds1054z.discovery.Listener object at 0x0000024D925F71C0> has no update_service method. Provide one (it can be empty if you don't care about the updates), it'll become mandatory.
warnings.warn(
and no other outputs. the oscilloscope is connected to the laptop. I am not sure that it is connected to the wifi
The ds1054z
CLI tool should enable users to backup and restore settings related to the scope with a simple command. Having a backup of the settings would allow operators of the scope to play around with all the knobs and settings while being able to quickly going back to the old settings if needed. The backup should be written to a (human and machine friendly) local file and should contain the following information:
When it comes to the global scope status (running, stopped, single) I think it should not be restored. It would make more sense to stop the scope during the restore operation and leave it up to the user to press the start/single/whatever button (or send the corresponding command) after restoring.
Proposed CLI signature:
ds1054z settings --backup somefile
ds1054z settings --restore somefile
ds1054z settings --backup newfile --restore oldfile # first back up, then restore
When I do save-screen
and there's a whole lot of stuff on the oscilloscope screen (i.e. high frequency oscillations), it dies with IOError. This seems to happen repeatably for dense screen contents, but save-screen works fine most of the time.
$ ds1054z save-screen 192.168.4.3
Traceback (most recent call last):
File "/usr/local/bin/ds1054z", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/ds1054z/cli.py", line 291, in main
im.putalpha(255)
File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1398, in putalpha
self.load()
File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 211, in load
raise IOError("image file is truncated")
IOError: image file is truncated
The similar issue occurred on my DS1104Z too.
RoGeorge/DS1054Z_screen_capture#6
The DS1054z will not be discovered via zeroconf. Adding the proper ip address solve the issue.
I'm using this model acc. info from ds1054z info <ip_addr>
Vendor: RIGOL TECHNOLOGIES
Product: DS1054Z
Serial: DS1ZA204820248
Firmware: 00.04.04.SP3
Hi,
I'm pretty sure the file ds1054z/ds1054z/resources/overlay.png was made by me (https://github.com/gnbl/DS1000Z/blob/master/overlay100.png) and you seem to be using/re-publishing it without any attribution (and strictly speaking, nor explicit permission, since I haven't licensed it)!
That's not very nice.
When trying to use the class with a Rigol MSO1074Z, i got this error:
raise NameError(msg)
NameError: Unknown device identification:
RIGOL TECHNOLOGIES,MSO1074Z,DS1ZC182100884,00.04.04.SP3
If you believe this device should be supported by this package, feel free to contact the maintainer with this information.
I commented the following lines in __init__.py
"""
if not match:
msg = "Unknown device identification:\n%s\n" \
"If you believe this device should be supported " \
"by this package, feel free to contact " \
"the maintainer with this information." % idn
raise NameError(msg)
"""
I'm workig in a new branch in order to add to the class the capability of properly detect the MSO1074Z model.
Would be cool if networked scopes could be autodetected.
I just tried import ds1054z.discovery
and found it failed to import. Got confused by the main page instructions pip install ds1054z[savescreen,discovery]
which don't make sense to me because of the square brackets (I haven't seen that in pip syntax documentation before). Finally I checked the github directory tree and saw the comment at the top of discovery.py saying I needed zeroconf
if I got the import error. So why not print an additional message for less skilled users than myself?
I've just noticed that get_waveform_samples("CHAN1", "RAW") always returns 1200 samples,
from my DS1054z, regardless of the state of the scope or the configured memory depth.
After enabling logging reading through the debug output I realized that the points field in the waveform preamble is always set to 1200 for me,
whereas memory_depth_curr_waveform returns the correct memory depth for all scenarios I've tested so far.
Here is a small piece of code to reproduce this:
#!/usr/bin/env python3
import logging
from ds1054z import DS1054Z
def main():
logging.basicConfig(level=logging.DEBUG)
scope = DS1054Z('192.168.0.23')
print("Connected to: ", scope.idn)
samples = scope.get_waveform_samples("CHAN1", "RAW")
print(len(samples))
print(scope.memory_depth_curr_waveform)
if __name__ == '__main__':
main()
The output while the scope is stopped, with only one channel active and the memory depth set to 12M manually is:
DEBUG:pyds1054z.ds1054z:sending: b'*IDN?'
DEBUG:pyds1054z.ds1054z:received: b'RIGOL TECHNOLOGIES,DS1054Z,XXXXXXXXXXXXXXX,00.04.02.SP4\n'
DEBUG:pyds1054z.ds1054z:sending: b'*IDN?'
DEBUG:pyds1054z.ds1054z:received: b'RIGOL TECHNOLOGIES,DS1054Z,XXXXXXXXXXXXXXX,00.04.02.SP4\n'
Connected to: RIGOL TECHNOLOGIES,DS1054Z,XXXXXXXXXXXXXXX,00.04.02.SP4
DEBUG:pyds1054z.ds1054z:sending: b':TRIGger:STATus?'
DEBUG:pyds1054z.ds1054z:received: b'STOP\n'
DEBUG:pyds1054z.ds1054z:sending: b':TRIGger:STATus?'
DEBUG:pyds1054z.ds1054z:received: b'STOP\n'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:SOURce CHAN1'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:FORMat BYTE'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:MODE RAW'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:PREamble?'
DEBUG:pyds1054z.ds1054z:received: b'0,2,1200,1,1.000000e-09,-6.000000e-03,0,2.074219e-01,-78,122\n'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:STARt 1'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:STOP 1200'
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:DATA?'
DEBUG:pyds1054z.ds1054z:received a long answer: 23 39 30 30 30 30 30 31 32 30 ... 70 71 71 71 71 71 70 70 71 0A
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:PREamble?'
DEBUG:pyds1054z.ds1054z:received: b'0,2,1200,1,1.000000e-09,-6.000000e-03,0,2.074219e-01,-78,122\n'
1200
DEBUG:pyds1054z.ds1054z:sending: b':WAVeform:MODE?'
DEBUG:pyds1054z.ds1054z:received: b'RAW\n'
DEBUG:pyds1054z.ds1054z:sending: b':TRIGger:STATus?'
DEBUG:pyds1054z.ds1054z:received: b'STOP\n'
DEBUG:pyds1054z.ds1054z:sending: b':ACQuire:MDEPth?'
DEBUG:pyds1054z.ds1054z:received: b'12000000\n'
12000000
(I've removed the output for info as it contained only timing information.)
I'd like to know if anybody can reproduce this, or if this is a problem specific to my setup.
If I can find the time next week, I'll try to reproduce it on my other DS1054z.
Meanwhile I've been able to get get_waveform_samples working for me,
by using the memory_depth_curr_waveform instead of the points value from the waveform preamble to determine how many sample should be fetched from the scope.
In theory this should not break anything else, as the modified line is in _get_waveform_bytes_internal.
I can also provide a pull request with my fix.
Hello. Since this lib is useful for the oscilloscopes other than ds1054z, I guess it's a bit strange to keep this name. Should it be renamed? (I have almost implemented some abstractions I hope useful to add support of more oscilloscopes).
First off all great job in developing the API for this scope. I'm very happy to be able to automate my measurements now using it.
One feature however is missing (at least for me): setting the trigger level.
Is there a way to set the trigger level in any way (maybe using using the vxi11 write(.) method) ?
Kind regards, keep up the good work!
I'd like to wrap a context manager around DS1054Z class.
So that the TCP/IP connection resource could be released after usage.
Now the close operation is only implemented in del in vxi11 which could only be triggered by Python auto garbage collection.
This module lacks a close method on purpose.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.