Pulling waveform data from a Rigol scope - Page 1
Forum section: electronics / beginners

author: DrMag
author_rank: Regular Contributor
timestamp: April 02, 2017, 04:15:27 pm
content: For my current project, I want to be able to automate a number of tests and measurements. I'm using a Rigol DS2072 and a Rigol DG4062 to start. Just getting set up, I figured I'd do something simple like profile an RC low-pass filter. I'm working in Python with PyVISA and the NI-VISA backend. The test equipment is connected through ethernet.Here's what I've been able to do: connecting to the equipment is easy, and changing the configurations works without a problem. I was able to make the profile by changing the signal generator output, allowing for some settling time, and querying the amplitude of the oscilloscope input. Adding some automatic gain control to keep the measured sine wave in an accurate measurement region, and I found a response curve that very closely matches the predicted.Here's the problem: doing the measurement this way is **slow**. Mostly due to needing a significant amount of time to let the generator make the change and settle. I've also noticed spurious outputs from the scope, and so I have it taking a number of readings and averaging the IQR.What I would like to do is just have the generator sweep over the frequency range and remove the setelling time issue entirely. But to do this, I need to be able to read the waveform from the scope to make the calculation. But every time I read the waveform data, I get only an array of zeros.I installed marmad's Rigol UltraVision Utilities software, and was somehow able to get it to send me a series of frames, the first being all zeroes and the rest having real data that matched the input signal. So clearly I am doing something wrong.Could someone familiar enough with the Rigol programming explain the right series of commands to get a full waveform in ascii?

author: DrMag
author_rank: Regular Contributor
timestamp: April 02, 2017, 04:17:24 pm
content: These are the commands I was trying::WAV:MODE:NORMAL:WAV:FORMAT:ASCII:WAV:SOURCE CHAN1:WAV:BEGIN:WAV:START:WAV:DATA?

author: Karel
author_rank: Super Contributor
timestamp: April 02, 2017, 04:48:33 pm
content: Quote from: DrMag on April 02, 2017, 04:15:27 pmUsing ascii encoding for the waveform data is slow and amateurish.Have a look at the sourcecode of DSRemote:https://github.com/Teuniz/DSRemoteedit:First start reading the programming guide:http://int.rigol.com/File/TechDoc/20151218/MSO1000Z&DS1000Z_ProgrammingGuide_EN.pdf

author: DrMag
author_rank: Regular Contributor
timestamp: April 02, 2017, 07:04:32 pm
content: Yes, ASCII isn't the best route, but I'd like to get it working anyway. I tried using the word format, but PyVISA doesn't seem to know how to deal with it (at least with default settings--there's probably some buried document that shows how to get it to work). In any case, the format isn't so much the issue as getting any actual data at all. I do have the programming guides for all of my Rigol equipment, but if there's something in this one that helps I suspect it isn't too different than for the DS2000 series, if at all.My C isn't great, but thanks for the source code link--I'll browse through it to see if it helps identify what I'm doing wrong.Does anyone else have suggestions that may help?

author: Karel
author_rank: Super Contributor
timestamp: April 02, 2017, 07:38:55 pm
content: Have a look here:https://www.eevblog.com/forum/testgear/rigol-ds1000z-series-(ds1054z-ds1074z-ds1104z-and-s-models)-bugswish-list/msg1048706/#msg1048706