Google-Apps
Hauptmenü

Post a Comment On: Ken Shirriff's blog

"Four Rigol oscilloscope hacks with Python"

20 Comments -

1 – 20 of 20
Anonymous Anonymous said...

I really enjoyed this post. You always expose new and awesome information. Thank you for sharing your work so much!

July 20, 2013 at 1:25 PM

Blogger Unknown said...

Ken

I also have a Rigol and would like to try this out on Windows. Do you know of any tool to interface with it on windows?. Is it a custom USB i/F or serial?

If you have a moment have a look at our AnalysIR project on Indiegogo. (see below for details). We would be happy to offer you a copy if the project is successful. We would also appreciate any suggestions for features & new protocols to support. We should have 20 protocols supported by the time it is released.

BTW: Thanks for all of the work on IR over the years, it has been truly inspirational.

As Part of our project we also plan to release a method for recording IR signals & modulation frequency on Arduino (simultaneously). We will be exhibiting this method at the Dublin Mini Maker Faire on July 27th

========
For anyone interested in IR protocols – we have just launched a project on IndieGoGo for AnalysIR – IR Decoder & Analyzer (Arduino & Raspberry Pi). Currently we support 17 IR protocols and are looking for more to add as part of the campaign. Suggestions Welcome!

You can find out more about the Project on http://bit.ly/1b7oZXH or Screenshot via www.AnalysIR.com

July 21, 2013 at 4:55 PM

Blogger Unknown said...

Sorry
I assumed when I saw Python it was running on linux. After clicking the link I see it supports windows. We will have lots of fun with this after Maker Faire :) tnx again.

July 21, 2013 at 5:04 PM

Anonymous Norse said...

Thanks for the great article with the helpful code. I was wondering what you might suggest for fixing the 'Bad instrument list' error. Could it be because I'm running Python 3.x? Thanks!

September 4, 2013 at 6:38 PM

Blogger Ken Shirriff said...

Hi Norse! The most likely problem is incompatibility between Python 3 and PyVISA; according to the github page, PyVISA doesn't support Python 3 yet. Also, try printing the raw instrument list to see what you're getting. Finally, make sure you have the NI-VISA I specify above.

September 4, 2013 at 11:07 PM

Anonymous Norse said...

Thanks Ken, 2.7 worked! Also, In case anyone runs into this problem, NI-VISA 5.2 wound up giving me errors on Python 2.7. I updated to NI-VISA 5.3, installed Enthought (free version) for numpy and matplotlib, and installed the linked version of PyVISA and everything worked well together. Thanks again for the great article and help!

September 5, 2013 at 6:34 PM

Anonymous Anonymous said...

Ken, looks like the code assoiciated with the "create .wav" section is for the spectagraph rather than for creating .wav files.

October 15, 2013 at 7:33 PM

Blogger Mike said...

Ken,
Any chance of giving me a pointer to a solution?

I have just bought a Rigol DS1102E scope from Amazon and would like to access it with Python on OSX 10.9 Maverick.
The problem is that when I plug in the USB cable, OSX does not recognise the USB port: i.e.
ls /dev/tty.* does not show anything.

I have no trouble seeing when another USB cable is plugged in - say an Arduino.

On the Riogol, selecting computer or Pictbridge under Utilities does not make a difference.

I guess I could use RS232 but would lim ego get the USB working.

Any ideas?

Thanks,

Mike Alport

November 25, 2013 at 11:12 PM

Blogger Erik Andrén Zachrisson said...

I just got this to work on Mac Os X Mavericks.

Mike,
Follow the instructions on
http://www.rau-deaver.org/Mac-PyVISA.html

I grabbed the NI-VISA-Runtime-5.4.0 from Labviews web page.

Download and install the PyVisa according to the instructions.

Modify Kens script with adding
from pyvisa.vpp43 import visa_library
visa_library.load_library("/Library/Frameworks/Visa.framework/VISA")

before
import visa

That is all.

December 26, 2013 at 12:12 PM

Blogger Unknown said...

Hello
from my PC running windows 7 I want to control my function generator DG1022 RIGOL with its USB HOST interface as I am not a developer this are 2 questions:
1) After installing python, visa, pyvisa is it necessary to install other usb interfaces as openusb, libusb, USBTMC? .. )
2) Has anyone ever done this driving of a 1000 Series RIGOL?
Thank you for your information
Daniel de Paris in France
dcau93@gmail.com

December 31, 2013 at 8:43 AM

Blogger Unknown said...

Just looking at the first example and I couldn't change it to read channel 2. It needs:-
scope.write(":WAV:SOUR CHAN2")
scope.write(":WAV:POIN:MODE RAW")
rawdata = scope.ask(":WAV:DATA? CHAN2")[10:]

April 15, 2014 at 12:32 PM

Anonymous Anonymous said...

On Windows: C:/Windows/System32/visa32.dll

April 22, 2014 at 11:19 AM

Blogger Maxamust said...

Ken,

I am trying to pull voltage / any information from a tattoo needle machine as the tattoo is being done, so I can generate a nice spectrogram and other images from the data. Do you think this would be a good setup to do that?

Thank,
Maxwell

June 25, 2014 at 3:19 PM

Blogger Ken Shirriff said...

Maxamust: your tattoo application sounds interesting. One thing to keep in mind is the oscilloscope captures the data and then transfers it to the computer, so you're getting blocks of data rather than "real time" data. That's probably okay for your application - I don't know exactly what you're doing - but I wanted to mention it. Let me know how it works out, since it sounds like an interesting project.

July 5, 2014 at 2:29 PM

Blogger Martin said...

Ken really good post. I did not even think of using Rigol scope for generating spectrogram ;-D For those who are interested in controlling Rigol instruments from C have look at this tutorial Rigol oscilloscope remote control with NI-Visa

August 17, 2014 at 5:56 AM

Blogger Kaei Hämeenaho said...

You could maybe use Ethernet transport like I do here: http://luhasoft.github.io/scopeio/
At least it seems easier than the USB problems reported in this page.
And your computer can be wireless then if you have wireless and wired networks connected. But for such big data you may need to increase vxi11 buffer even more than I do in the small patch and binary data needs special handling in the C program part.

June 10, 2015 at 11:16 PM

Blogger Unknown said...

Ken,

Does your code control the amount of data that is taken? Basically I am writing a code that needs to be able to run for x amount of triggers over whatever duration of time... Does your code do that, or is there a simple way to program that type of function with your code?

Thanks so much,
Zak

July 10, 2015 at 9:20 AM

Blogger Muhammad said...

I am interfacing RIGOL DS1052 with computer using USB cable. I am acquiring data of two channels in normal mode (600 data points). I have constructed wave forms, but what I am interested in is measuring the phase difference between two waveforms, this is possible only if RIGOL provides me data of channel1 and channel2 at same time intant i.e first sample of ch1 is at t=t0 and first sample value of ch2 is also at t=t0. Kindly tell me in what format is RIGOL transfers data. I am acquiring databy sending WAV:DATA:CHAN1 command, after getting the result I ask for data of channel2.

January 17, 2016 at 7:32 AM

Anonymous Anonymous said...

Hello.

I have used your example code and made a fork to work with my MSO1104 and Python35 + PyVISA1.8.

It can be found here:
https://gist.github.com/StevanxDK/3d1001eb817fdf4cc7384d388b989c99

June 30, 2017 at 12:34 PM

Anonymous Sawyer McLane said...

Hi! Thanks for the great tutorial. Some of the code was a little out of date, so I updated it here: https://gist.github.com/samclane/c0fb90219214361cb963674b3bc82848

I'm using:

RIGOL DS1052E
Python 3.6.2
PyVisa 1.9.1
numpy 1.14.2

February 28, 2019 at 12:15 PM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot