Grab An Image From Your O-scope The Easy Way

The Rigol DS1054Zed is the oscilloscope you want. If you don’t have an oscilloscope, this is the scope that has the power and features you need, it’s cheap, and the people who do hardware hacks already have one. That means there’s a wealth of hardware hacks for this oscilloscope. One small problem with the ‘Zed is the fact that capturing an image from the screen is overly complicated, and the official documentation requires dedicated software and a lot of rigolmarole. Now there’s a simple python script that grabs a screen cap from a Rigol scope.

The usage of this python script is as simple as plugging the DS1054Z into your USB port and running the script. A PNG of whatever is on the screen then appears on your drive. Testing has been done on OS X, and it probably works on Linux and Windows. It’s a simple tool that does one job, glory and hallelujah, people are still designing tools this way.

This work was inspired by the efforts of [cibomahto], who spent some time controlling the Rigol with Linux and Python. This work will plot whatever is being captured by the scope in a window, in Linux, but sometimes you just need a screencap of whatever is on the scope; that’s why there were weird Polaroid adapters for HP scopes in the day.

Yes, it’s a simple tool that does one job, but if you need that tool, you really need that tool. [rdpoor] is looking for a few people to test it out, and of course pull requests are accepted.

33 thoughts on “Grab An Image From Your O-scope The Easy Way

  1. Stupid question, I know, but why wouldn’t you just put a USB flash drive in the socket and press ‘Print’? My Rigol is a different model but I’ll agree they make nice scopes for the money. Being able to screen capture to a USB drive is a cool feature.

    1. You can plug a USB stick in, but if you’re taking a series of screen shots and annotating them or filing them away with reasonable names then moving the usb stick back and forth between scope and latptop becomes old really quick. Plus it takes 4-5 button presses to get a screen shot taken…

      1. On the 1054z you just need to press the ‘print’ button, which will store a sequentially numbered image on the thumb drive. Just jot down the number if the image in your notes and carry on. It is somewhat slow (~5 seconds) but manageable.

        The real issue with rigol scopes is capturing the actual trace data. You can write a .csv to the thumbdrive but it takes ages (literally upwards of an hour). The proprietary .wfm format is faster, bus still takes about 20 minutes to write a full memory depth capture to a thumbdrive. Worse yet, for reasons I do not understand, there is a high probability that the scope will refuse to write either .csv or .wfm files with a useless error ‘not support’ which can only be cleared by resetting the scope and loosing whatever data you were trying to capture. What I would really like to see is a python script to grab the trace data over usb/ethernet which are supposed to be a lot faster and are hopefully more reliable.

        1. Fastest way to get the captured data is through ethernet using the national instruments framework. I’ve used c#.
          It takes about 30 seconds to get 9MB worth of data. So a full copy of the 20MB buffer should take a little over a minute.
          There’s also a utility for windows that can control the scope, grab screenshots very quickly and get the data.

      2. There’s literally a big green button on the front of the scope to take a picture. If you would rather control the scope over the network or pull the image through Python, that’s fine. But I don’t understand the need to pretend it’s more complicated than it actually is to use a flash drive.

        1. Because using the flashdrive is slow. Sure you can save a screenshot, even dump all sample memory in a CSV (although that can take upwards of an hour to do). But then you have to eject the flashdrive, insert and mount and navigate to the right file.
          This tool and its predecessor are both handy for me a teacher, as I can show the scope display in semi-realtime on a projector. Why didn’t my school just buy a scope with a VGA port? Because of money, I had trouble getting the MSO upgrade through approval, so also getting VGA was impossible.

          1. The new DSO5000 ($850 for base model, hardware identical to the top of the line 4channel/350mhz + logic analyzer + signal generator, unlockable using free tools) has an integrated hdmi port at no extra cost

  2. I’ve connected to the Rigol DS1052E using the serial port directly to send Rigol commands, which has GPIB-like syntax. You can download the samples directly and then format the data in any shape you want.
    So to prevent confusion: you can use the built-in USB port on the back to remotely control your scope from your computer. I did this in Labview but you could do it in whatever can talk to the serial port.

  3. “One small problem with the ‘Zed is the fact that capturing an image from the screen is overly complicated, and the official documentation requires dedicated software and a lot of rigolmarole.”

    I think this is one of those cases where something was lost in translation between the original project and the HaD writeup. There’s a green “Print” button on the DS1054Z that dumps the whole screen to a flash drive plugged into it. It couldn’t be any easier.

    That being said, I can see how doing it through software directly connected to the scope could be easier if you’ve got the scope permanently setup/wired on the bench anyway.

  4. LOL. The title here brought me back. Somewhere I have an issue of an electronics magazine from my childhood where there is an article about attaching a camera to an analog oscilloscope. Actually, I’m not quite sure, was it a camera or was it actually just a box that you stick a big piece of photographic paper in and expose it that way? Either way, we sure have come far.

    So as long as I am in old-fart reminiscing mode, I also remember an issue where there was an article about building a 3d adapter for an oscilloscope. It was a circuit that performed some sort of phase-shift on it’s input. You would hook the input to one channel along with an input source and the output to the other channel. Then there was a viewer thing that you had to build to go over the screen. It looked like Google Cardboard’s great grand-daddy. Then you would have to put your face right up to it to get to see 3d images of whatever waveform you were looking at. Did it have a purpose? Well, no more or less than some of the other more esoteric hacks we see here today anyway.

  5. I must necessarily share a store from an old company. Happened in 2013. We had a neat Keysight oscilloscope (with an USB port, yes). We went to an external lab to do surge current tests. Team lead was handling the oscilloscope, I was with a thermal camera.
    When we came back he send me an e-mail with photos taken with his smartphone of the oscilloscope screen and told me that he needs numerical data.
    Isn’t that hard to get those back with some accuracy, though facepalm earned.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.