## Andy Fletcher Homebrew

### Rigol Data and Screen Capture

Although Rigol provide software to control the DS1104Z scope, I’ve always found it quite clunky and annoying to use. It seems to be more a marketing tool than something you would want to use, what with its tiny fonts and black-on-black windows. It is only available on Microsoft Windows too and is not written well enough to be run successfully under WINE.

I used to use a very good program written by Peter Dreisiebner called Rigol Bildschirmkopie. The program allows you to copy the screen of the scope to your Mac and save it as a PNG graphics file. You can get it at his web site. Thanks Peter! MacOS High Sierra keeps nagging that Peter’s program ‘needs optimised’ although it still works well. I think the nag is to get to get it compiled for 64-bit.

I’ve now written my own racket program mostly as an exercise, but it works well for the single task of capturing the screen. Peter’s program does more, but I only need simple capture of one scope so my program suffices for me. The source for my program is here.

Peter’s program doesn’t allow you to control the scope, but I have found out you can control the scope via a simple telnet interface, as long as the scope is connected to your LAN. This means you can use ‘telnet’ itself to control the scope, and capture waveform data or whatever to your Mac/PC. This allows all sorts of data manipulation to be done either using homebrew scripts or your favourite spreadsheet program.

Even better, you can write programs or scripts to capture the scope data and do stuff with it. This chart was created using a Racket program to capture the data directly from my Rigol scope. Then an Octave script was used to create the chart. This is a much less laborious way to create such graphs than copying values manually from the scope screen.

The Racket program just issues Rigol scope commands as specified in the Rigol Programming Guide for the DS1000Z Series Digital Oscilloscope which you got with your scope, or no doubt can be downloaded. So after the program has connected to the scope it selects channel 1 data, selects channel 1 for the frequency counter, and then iterates getting the frequency and $$V_{p-p}\;$$ every second. The commands are:

:MEASure:SOURce CHANnel1
:MEASure:COUNter:SOURce CHANnel1
:MEASure:COUNter:VALue?
:MEASure:ITEM? VPP


The board under test has been set up to change frequency every $$2\frac{1}{2}$$ seconds so the capture program won’t miss any of the frequency changes.

Now the data has been captured you can cut’n’paste it into a spreadsheet and produce a chart. I prefer to use GNU Octave as the process can be repeated much more easily than point and clicking in a spreadsheet program. Octave allows you to manipulate the data on the fly. For instance, in the script above I divide the frequency values by 1,000,000 on the fly thus getting MHz instead of the Hz as output by the scope. Also Octave has powerful commands which allows e.g. FFTs to be made from waveform data. I’ll write up how to do that when I can.