Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing with DS2xxx/DS2xxxA #9

Open
KC22C2 opened this issue May 15, 2017 · 5 comments
Open

Testing with DS2xxx/DS2xxxA #9

KC22C2 opened this issue May 15, 2017 · 5 comments

Comments

@KC22C2
Copy link

KC22C2 commented May 15, 2017

For info only - I know this hardware isn't officially supported.
I just tested this code with a Rigol DS2202, firmware 00.03.04.SP2.
Code identifies it as:
Found instrument model 'DS2202' from 'RIGOL TECHNOLOGIES'

PNG capture works.
BMP capture works.
CSV capture seems to always fail after ~1minute, with the following trace:

Traceback (most recent call last):
  File "OscScreenGrabLAN.py", line 198, in <module>
    response = command(tn, ":" + channel + ":DISP?")
  File "DS1054Z_screen_capture-master/Rigol_functions.py", line 23, in command
    response = tn.read_until("\n", 1)  # wait max 1s for an answer
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 297, in read_until
    return self._read_until_with_poll(match, timeout)
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 332, in _read_until_with_poll
    self.fill_rawq()
  File "DS1054Z_screen_capture-master/telnetlib_receive_all.py", line 579, in fill_rawq
    buf = self.sock.recv(50)
socket.error: [Errno 104] Connection reset by peer

I'm personally very happy with just the screen capture functionality, and I hope the word will spread that this is available.

Thanks for your work.

@RoGeorge
Copy link
Owner

Please attach here the log file, "OscScreenGrabLAN.py.log".
The log file can be found in the same location as "OscScreenGrabLAN.py".

@KC22C2
Copy link
Author

KC22C2 commented May 15, 2017

Two more observations (or two mistakes on my end):

  • before capturing the traceback in the initial bug report, I had added traces around the scope detection code. One line number was incorrect (201 instead of 198). I've edited the original report.
  • Tested on Debian Jessie, which currently provides Python 2.7.9

The log is attached (renamed to .txt to please github). I've zero'd the scope serial number - it was originally read correctly.
OscScreenGrabLAN.py.log.txt

@RoGeorge
Copy link
Owner

RoGeorge commented May 16, 2017

Thanks for posting more details.

Seems to happen because the program requests the status for channel 3 and 4 of the oscilloscope. Channel 3 and 4 does not exist on a DS2000 oscilloscope.

To test by yourself if this is the case, you can edit line 197 in file 'OscScreenGrabLAN.py' from
for channel in ["CHAN1", "CHAN2", "CHAN3", "CHAN4", "MATH"]:
to
for channel in ["CHAN1", "CHAN2"]:

Even after doing that, you might still find other incompatibilities between DS2000 and DS1000. The script was made for DS1000 only, because I don't have access to other models.

If you decide to change that line, please share here the results and the log file.

@KC22C2
Copy link
Author

KC22C2 commented May 16, 2017

OK. First, I only removed CHAN3/CHAN4, but the issue persisted.
Then, I remove MATH, and it completed, but for some unknown reason, the scope screen was now empty, without trace (probably unrelated to your code). The log (.log.1.txt) and CSV (pretty much empty, renamed .csv.txt) follow.
OscScreenGrabLAN.py.log.1.txt
DS2202_DS2A000000000_2017-05-16_12.02.00.csv.txt

I re-triggered on a signal, relaunched OscScreenGrabLAN and this time, I got a different error:

Data from channel 'CHAN1', points 1-1200: Receiving...                                                                                                                                                                                       
Traceback (most recent call last):                                                                                                                                                                                                           
  File "OscScreenGrabLAN.py", line 245, in <module>                                                                                                                                                                                          
    buff += buffChunk[tmc_header_bytes(buffChunk):-1] + ","                                                                                                                                                                                  
  File "DS1054Z_screen_capture-master/Rigol_functions.py", line 39, in tmc_header_bytes                                                                                                                                                 
    return 2 + int(buff[1])                                                                                                                                                                                                                  
ValueError: invalid literal for int() with base 10: '.'

The log (.log.2.txt) is attached.
OscScreenGrabLAN.py.log.2.txt

Since the signal was still on the scope, I downloaded the PNG (also attached). Its log is also attached (.log.3.txt). Although it works, it ends with a warning.
OscScreenGrabLAN.py.log.3.txt
ds2202_ds2a000000000_2017-05-16_12 08 32

@RoGeorge
Copy link
Owner

Thank you for sharing the info.

I will review the code and the SCPI commands for RAW memory data extraction, and will try to add capabilities for DS2000 series, maybe this weekend, but please don't take it as a promise. Will post here if any progress.

Again, thank you very much for your testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants