Author Topic: Beginner Oscilloscope that can be controlled via Python  (Read 521 times)

0 Members and 1 Guest are viewing this topic.

Offline mr_jjTopic starter

  • Newbie
  • Posts: 4
  • Country: ch
Beginner Oscilloscope that can be controlled via Python
« on: April 30, 2024, 09:47:14 am »
There are several brands of oscilloscope for around $1000 that are great for beginners. I'm looking for one that has an API that allows control via python. I'm looking to do things like getting the raw data, triggering, changing ranges/time scales and so on.
I've done this on a Lecroy in the past but for my current application, I just need a basic oscilloscope that is scriptable.
 

Online coromonadalix

  • Super Contributor
  • ***
  • Posts: 5980
  • Country: ca
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #1 on: April 30, 2024, 10:12:27 am »
i would  immediately go with Siglent  models,  because of their hack .. cough cough   and mostly all their scpi commands are documented, we did some automation with a scope and generator, the IT guy was drooling,  it was so easy

we do it by ethernet cable, each item has its own ip adress, the software check for their presence  and start after a keyboard press

over 80 freqencies are "outputted" and checked and stored as csv files ... we check some specially crafted frequency filter pcb's....

no drivers are needed,  you have python stuff here,  lxi tools here     just do some search,   you can find many examples on the web
 

Online Aldo22

  • Frequent Contributor
  • **
  • Posts: 740
  • Country: ch
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #2 on: April 30, 2024, 10:17:59 am »
There are several brands of oscilloscope for around $1000 that are great for beginners. I'm looking for one that has an API that allows control via python. I'm looking to do things like getting the raw data, triggering, changing ranges/time scales and so on.
I've done this on a Lecroy in the past but for my current application, I just need a basic oscilloscope that is scriptable.

I think if the scope has SCPI, you can control it via pyvisa, for example.
Even my $130 Hantek can do that, although not very fast, but it was enough for a bode plot script.
« Last Edit: April 30, 2024, 10:22:17 am by Aldo22 »
 
The following users thanked this post: pdenisowski, mr_jj

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19644
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #3 on: April 30, 2024, 10:21:13 am »
Have a look at the Digilent Analog Discovery. That has an API, so presumably it can be controlled by Python etc. I believe JavaScript is used internally, and is available for you to extend the basic functionality - e.g. spectrum analyser, etc etc

You also have an AWG and digital i/o, so you can synthesise your own test instrument.

Overall I like the underlying hardware, within its clearly stated limits.

You can download the GUI and play with it, to see what it can do.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline BennoG

  • Regular Contributor
  • *
  • Posts: 85
  • Country: nl
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #4 on: April 30, 2024, 02:19:53 pm »
you can also have a look at picoscope, they range from $100 to $16000 and can all be read out by python.
Only problem is you can not use the application and python at the same time.
With the SDK you can read the data faster out of the device than in the application.

I have done this in the SDK and let it stream continually at 5M Samples/sec for over a week. (I did only save the parts of interest, because the HD would be full in no time)
This was where a specific problem was only seen rarely and impossible to make a trigger for it, so the software I wrote tested realtime for the problem and saved the data from 5 seconds before it and 5 seconds afterwards (50M samples per channel)

Added Note: check specifications for SDK on the type of scope you want to use, there are a lot of differences between the $150 scopes and de $600 and up scopes.

Benno
« Last Edit: April 30, 2024, 03:27:25 pm by BennoG »
 

Offline Faranight

  • Supporter
  • ****
  • Posts: 212
  • Country: si
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #5 on: April 30, 2024, 07:51:33 pm »
I would definitely suggest you go with one with a LAN port. If you're gonna buy more instruments in the future, you're eventually going to run out of USB ports on your PC.
I have about 8 devices in my home lab, and they're all wired via a switch to my laptop, and I an use SCPI to control pretty much all of them. None of that USB cable replugging.

e-Mail? e-Fail.
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28512
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #6 on: April 30, 2024, 07:53:14 pm »
There are several brands of oscilloscope for around $1000 that are great for beginners. I'm looking for one that has an API that allows control via python. I'm looking to do things like getting the raw data, triggering, changing ranges/time scales and so on.
I've done this on a Lecroy in the past but for my current application, I just need a basic oscilloscope that is scriptable.
Please share for best advice.
Avid Rabid Hobbyist.   Come visit us at EMEX Stand #1001 https://www.emex.co.nz/
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline pdenisowski

  • Frequent Contributor
  • **
  • Posts: 695
  • Country: us
  • Product Management Engineer, Rohde & Schwarz
    • Test and Measurement Fundamentals Playlist on the R&S YouTube channel
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #7 on: May 01, 2024, 05:31:39 am »
I think if the scope has SCPI, you can control it via pyvisa, for example.

This.  As long as the scope implements SCPI, you should be able to control it using PyVISA.  Frankly, these days I would expect even a hobbyist level oscilloscope to implement SCPI.

Note that some vendors (like R&S) also provide their own Python modules and/or PyCharm plug-ins to make it easier to write scripts for their instruments, so this may be something you want to look into as well. 

Test and Measurement Fundamentals video series on the Rohde & Schwarz YouTube channel:  https://www.youtube.com/playlist?list=PLKxVoO5jUTlvsVtDcqrVn0ybqBVlLj2z8

Free online test and measurement fundamentals courses from Rohde & Schwarz:  https://tinyurl.com/mv7a4vb6
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3391
  • Country: nl
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #8 on: May 01, 2024, 07:35:14 am »
Any decent scope probably supports SCPI. Even my old Rigol 1052DS has it.
And of course, Every decent scope supports SCPI, if you make SCPI support part of the definition of a decent scope.  8)

Support is so common that they don't even bother to print it on the front panel for 10+ years.

But if you want to control your scope via SCPI, you can make extra good use of a 12 bit ADC in your scope. As long as you're viewing the LCD of the scope, 12-bit resolution is of limited use because it just does not fit on the display (but you can zoom, and use it for on screen measurements) (Except maybe with Rigol, which tend to do on screen measurements based on screen pixels instead of measurement data  |O
 
The following users thanked this post: pdenisowski

Online paulca

  • Super Contributor
  • ***
  • Posts: 4080
  • Country: gb
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #9 on: May 01, 2024, 10:04:26 am »
Alternatives....

Arduino Uno.  30 seconds.  Run the IDE.  Select the osciliscope script, flash it, run it, hook up your signal (<5V) to the analog pin.  The IDE will produce your waveform.
Raspberry PI with an ADC module scope can be directly implimented in Python.

Moving out of amateur DIY.  Almost all "pro" gear of any kind, be it scope, gen, PSU can be found with a basic UART console connection (Serial terminal port).  Even the basic TENMA PSU have this.  More modern equipment will usually just have "Serial over USB" and not even a serial port.

Yes, it's slightly more faff using a serial link or USB link and if not careful opens you up to using junk desktop software written by embedded developers, which never goes well.

It just opens up a lot more devices to your automated lab.  If you add some middleware into that, like MQTT, Kafka or MQueue you can even open it up to non-electronics bench equipment.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline pdenisowski

  • Frequent Contributor
  • **
  • Posts: 695
  • Country: us
  • Product Management Engineer, Rohde & Schwarz
    • Test and Measurement Fundamentals Playlist on the R&S YouTube channel
Re: Beginner Oscilloscope that can be controlled via Python
« Reply #10 on: May 01, 2024, 11:09:05 am »
Moving out of amateur DIY.  Almost all "pro" gear of any kind, be it scope, gen, PSU can be found with a basic UART console connection (Serial terminal port).  Even the basic TENMA PSU have this.  More modern equipment will usually just have "Serial over USB" and not even a serial port.

Perhaps I’m misunderstanding, but I think R&S counts as a “pro” manufacturer, and almost nothing we make has a UART console for remote control.
Test and Measurement Fundamentals video series on the Rohde & Schwarz YouTube channel:  https://www.youtube.com/playlist?list=PLKxVoO5jUTlvsVtDcqrVn0ybqBVlLj2z8

Free online test and measurement fundamentals courses from Rohde & Schwarz:  https://tinyurl.com/mv7a4vb6
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf