Grabbing data from a Rigol 'scope with Python

While a fancy Rigol 1052E oscilloscope is a great tool and a wonderful portable oscilloscope we heartily recommend, sometimes you just need to use the more ‘advanced’ functions of an oscilloscope. Luckily, [cibomahto] figured out how to use a Rigol scope with Python, allowing for easy remote viewing and control of a Rigol 1052E ‘scope on any desktop computer.

[cibomahto]’s Python script grabs the screen and can send commands to the oscilloscope, effectively obviating the need for the slightly-terrible Rigol Ultrascope software. Not only that, controlling the 1052E is possible under OS X and Linux because of the portable Python nature of [cibomahto]’s work.

The Rigol DS1052E has become the de facto standard oscilloscope to grace the workbenches of makers and hackers around the globe. With a small price tag, the ability to double the bandwidth, and an active homebrew development scene, we doubt [cibomahto]’s work of grabbing data over USB will be the last hack we’ll see for this fine machine.

Thanks to [Markus] for sending this one in.

Comments

  1. Chewie says:

    Good information to publicize, but hardly a hack. The documentation is provided with the scope on how to interface with it via USB commands. I have the DS1102E.

  2. gzaloprgm says:

    I agree, it’s not “a hack”, but its really nice that he shows how to do it in python.
    I wonder if its possible to capture analog video data (PAL/NTSC) using the oscope and decode it in realtime on a pc.

    • KJ6MSG says:

      Sure, reading an API (VISA) and implementing it in your language of choice is always nice to show others how to do it, I just took issue with whoever called it a “hack”. I wrote a GTK+ application in C by reading the API… did I “hack” that as well?

      Well, I think the scope display is an LCD, so there is no PAL/NTSC video signal to decode. What I can’t figure out is how to save a screen shot of the screen. You can do it via the pushbuttons, but I couldn’t implement it with VISA.

    • Chewie RFC says:

      I just take issue with the overuse of the term “hack”. Reading an API (VISA) and implementing it in your language of choice is not a “hack”. That’s like saying you read the GTK+ API and wrote an application in C, therefore you did a “hack”. That being said, the post has value, like you said, showing how to do it in Python.

      Well, the display is an LCD, so there is no NTSC/PAL signal to be had. I just wish you could save a screenshot via VISA.

      • gzaloprgm says:

        By “capturing a video signal”, I meant connecting the oscope probes to some analog video source, and doing the decoding (hsync, vsync, chroma/luma) in the pc itself.

  3. Addidis says:

    I don’t think we would be short selling the awesome rigol scopes to say that their Ultrascope software is not slightly terrible but wholly terrible.

    This is great. Installing that ultrascope (bs) took like 3 hours of downloading some huge driver package which turned out to be the wrong one and cause my pc to bsod repeatedly. (I emailed rigol to change their readme instructions it directed me to what I found)

    ty cibomahto

  4. Ben R says:

    It’s not every day that a coworker’s hack gets posted to the front page of a website I visit!

  5. DeKay says:

    I have found that PyVISA is the One True Way to do Python based instrument control. Very simple and easy to use, and works with pretty much any interface you throw at it (including GPIB!).

    http://pyvisa.sourceforge.net/

  6. Kevka says:

    I do not know much about these scopes. But does anybody think there will every be a way to get the raw data – i.e. time vs. voltage datapoints – from them?
    Because that would be really useful for simulating FPGA designs that need to analyze an analog signal. You could save the data in an appropriate text file and then have it read by your test bench.
    If it is not possible to get raw data directly, has anyone ever tried getting datapoints out of the screenshots?

  7. qwerty says:

    About unlocking the double bandwidth feature: until a few months ago it was reported all hacks would no longer works due to firmware upgrades by Rigol on all newer 1052E scopes. Can anyone confirm that?

Speak Your Mind

*

Related Hacks in tool hacks

  • Designing a self-replicating milling machine
  • USB connectivity that is so very very small
  • Going from idea to schematic to printed PCB
  • Flying microscope build seems way too nice for a home lab
  • Upgrading a digital multimeter to tell the temperature