Author Topic: Pulling waveform data from a Rigol scope  (Read 3822 times)

0 Members and 1 Guest are viewing this topic.

Offline DrMagTopic starter

  • Regular Contributor
  • *
  • Posts: 61
Pulling waveform data from a Rigol scope
« on: April 02, 2017, 04:15:27 pm »
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?
 

Offline DrMagTopic starter

  • Regular Contributor
  • *
  • Posts: 61
Re: Pulling waveform data from a Rigol scope
« Reply #1 on: April 02, 2017, 04:17:24 pm »
These are the commands I was trying:

:WAV:MODE:NORMAL
:WAV:FORMAT:ASCII
:WAV:SOURCE CHAN1
:WAV:BEGIN
:WAV:START
:WAV:DATA?
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
Re: Pulling waveform data from a Rigol scope
« Reply #2 on: April 02, 2017, 04:48:33 pm »
Could someone familiar enough with the Rigol programming explain the right series of commands to get a full waveform in ascii?

Using ascii encoding for the waveform data is slow and amateurish.

Have a look at the sourcecode of DSRemote:

https://github.com/Teuniz/DSRemote

edit:

First start reading the programming guide:

http://int.rigol.com/File/TechDoc/20151218/MSO1000Z&DS1000Z_ProgrammingGuide_EN.pdf


« Last Edit: April 02, 2017, 04:51:34 pm by Karel »
 

Offline DrMagTopic starter

  • Regular Contributor
  • *
  • Posts: 61
Re: Pulling waveform data from a Rigol scope
« Reply #3 on: April 02, 2017, 07:04:32 pm »
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?
 



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf