Beginner Oscilloscope that can be controlled via Python - Page 1
Forum section: electronics / beginners

author: mr_jj
author_rank: Newbie
timestamp: April 30, 2024, 09:47:14 am
content: 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.

author: coromonadalix
author_rank: Super Contributor
timestamp: April 30, 2024, 10:12:27 am
content: 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 easywe do it by ethernet cable, each item has its own ip adress, the software check for their presence and start after a keyboard pressover 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

author: Aldo22
author_rank: Super Contributor
timestamp: April 30, 2024, 10:17:59 am
content: Quote from: mr_jj on April 30, 2024, 09:47:14 amI 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 abode plot script.

author: tggzzz
author_rank: Super Contributor
timestamp: April 30, 2024, 10:21:13 am
content: 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 etcYou 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.

author: BennoG
author_rank: Frequent Contributor
timestamp: April 30, 2024, 02:19:53 pm
content: 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

author: Faranight
author_rank: Unknown
timestamp: April 30, 2024, 07:51:33 pm
content: 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.

author: tautech
author_rank: Super Contributor
timestamp: April 30, 2024, 07:53:14 pm
content: Quote from: mr_jj on April 30, 2024, 09:47:14 amPlease share for best advice.

author: pdenisowski
author_rank: Super Contributor
timestamp: May 01, 2024, 05:31:39 am
content: Quote from: Aldo22 on April 30, 2024, 10:17:59 amThis. 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 01, 2024, 07:35:14 am
content: Any decent scope probably supports SCPI. Even my old Rigol 1052DS has it.And of course,Everydecent scope supports SCPI, if you make SCPI support part of the definition of a decent scope.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

author: paulca
author_rank: Super Contributor
timestamp: May 01, 2024, 10:04:26 am
content: 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.

author: pdenisowski
author_rank: Super Contributor
timestamp: May 01, 2024, 11:09:05 am
content: Quote from: paulca on May 01, 2024, 10:04:26 amPerhaps 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.