Using an oscilloscope for data acquisition - Page 1
Forum section: electronics / testgear

author: bifferos
author_rank: Regular Contributor
timestamp: April 12, 2023, 11:26:34 pm
content: It's pretty hard to figure out which scopes can be used for continuous capture to a PC. Can anyone suggest a budget scope capable of sustaining, say, 20MS/s in 8-bit accuracy from a single channel? Are there specific SCPI commands I should be looking for?thanks!

author: Someone
author_rank: Super Contributor
timestamp: April 13, 2023, 12:26:55 am
content: Oscilloscopes are not streaming devices, they're trigger oriented. But some of the USB scopes can do it:https://www.picotech.com/library/oscilloscopes/streaming-modeSCPI is not going to come close.

author: bifferos
author_rank: Regular Contributor
timestamp: April 13, 2023, 08:12:31 am
content: Quote from: Someone on April 13, 2023, 12:26:55 amI don't see how being trigger oriented precludes the ability to stream. Surely streaming is just triggering at a fast enough rate?Also, I don't understand your statement "SCPI is not going to come close", that's just a protocol and doesn't as far as I can see dictate timing or prohibit transfers while data collection is in progress. Can you explain this a bit more please?

author: 2N3055
author_rank: Super Contributor
timestamp: April 13, 2023, 08:35:57 am
content: Quote from: bifferos on April 13, 2023, 08:12:31 amStreaming is streaming. No triggering, just endless stream of data.Someone is right, SCPI is too slow for this. Not because in theory it couldn't but because it has huge overhead in implementation and devices just aren't fast over it...If you need streaming with a scope take look at the Picoscope. But you will need to write your own application and stream over API...

author: Berni
author_rank: Super Contributor
timestamp: April 13, 2023, 09:39:59 am
content: It is not going to work with SCPI.In theory it could but converting 20M values to ASCII just to be sent over the wire is really wasteful for both processing power and bandwidth. Even if it was sufficiently optimized to run on the limited processing power, the interfaces most scopes have are too slow. In ASCII you would need 4 characters per sample so that is 80MB/s. The only common interfaces that can do that are gigabit Ethernet and USB 3.0Common devices that do continuously stream high sample rate ADC samples are SDRs, but they typically don't work down to DC is that is what you are looking for.Sounds like a PC based scope that has the API support to write your own software like the picoscope is likely the easiest way indeed.

author: nctnico
author_rank: Super Contributor
timestamp: April 13, 2023, 10:33:54 am
content: Scpi also supports binary data and with a fast enough network the sky is the limit. However, an oscilloscope is usually not setup to do continous streaming.

author: bifferos
author_rank: Regular Contributor
timestamp: April 13, 2023, 11:29:31 am
content: Quote from: Berni on April 13, 2023, 09:39:59 amMaybe I don't know what SCPI is vs what are the extensions are on my DS1052E, but the Linux driver providing /dev/usbtmc0 is delivering binary. I did something like:WAVeform:FORMat BYTE:WAVeform:POINts:MODE RAWAnd then I was reading the raw values.Or are you saying the driver receives ASCII over the USB bus and converts it for me?

author: Berni
author_rank: Super Contributor
timestamp: April 13, 2023, 12:55:47 pm
content: SCPI is a standard that defines a common communication protocol with common commands. This way instruments from different manufacturers are compatible with the same test automation scripts (well.. sometimes not entirely in practice, but it does make it much easier to port to a different instrument)The SCPI standard defines that human readable ASCII is used for both commands and data. This is then sent over whatever communication link is being used to the instrument. These links operate similar to a serial port. Be it the original IEEE488 GPIB it was originally made for, more modern USB, RS232, a TCP/IP connection over ethernet..etc. So when you send a SCPI command it is just ASCII being sent byte by byte to the instrument over your communication link flavor of choice. Instruments can implement non ASCII formats too, but those commands are not really SCPI anymore, they are just a manufacturer proprietary command.This kind of protocol is designed to be simple and easy to use (hence human readable ASCII for everything), not performant. As such the whole architecture around it that runs is is not built for high throughput or low latency. In the instrument this is typically handled by the main CPU that also runs all of the UI, so it has a limit to how much CPU time it can dedicate to the task of SCPI parsing and needs to actually fetch data from elsewhere (like in a scope, the acquisition ASIC/FPGA), so even when using the proprietary binary format commands you don't get great throughput.What you will generally get with oscilloscopes is being able to capture up many points (up to the max sample memory of the scope), then send those points over SCPI and start a new capture. So there will always be at least a small gap between where one capture ends and next starts.So scopes that can do live streaming will usually move data over some more proprietary protocol that is built from the ground up for high throughput. Often the motivation to put work into implementing that is that the scope can use the PCs system RAM as giant sample memory.The real solution for high speed real time continuous signal capture into a computer are so called digitizer cards. They are purpose built pumping data from an ADC into a very fast PCIe bus:https://www.keysight.com/us/en/products/modular/pxi-products/pxi-oscilloscopes-digitizers.html#DynamicTable(But is a rather expensive solution as you might imagine, so best to go for a cheep USB PC based scope that has some continuous streaming API documented)

author: jonpaul
author_rank: Super Contributor
timestamp: April 13, 2023, 01:20:14 pm
content: Bonjour, we did data acquisition and Spectrum analysis since 1968.For audio BW use any sound card, record on any sound track editor, many are free. Most are 16..20 bit and capabilities 20 .Hz.20 kHz. FS to 192 kHz.We use Oscilloscope, speech and spectrum analysis SW on W10 laptop.For DC or wider BW, many PCI cards for PC BUS PC and USB ADC, scopes, many much cheaper than the crazy high cost Picos.Jon

author: nctnico
author_rank: Super Contributor
timestamp: April 13, 2023, 02:17:01 pm
content: @Berni: I think you need to read deeper into the origine of SCPI. Binary data isn’t a proprietary extrnsion. And it definitely is meant for realtime as well. Many A brand equipment even lists response and processing times for SCPI commands

author: Fungus
author_rank: Super Contributor
timestamp: April 13, 2023, 02:33:27 pm
content: Quote from: nctnico on April 13, 2023, 10:33:54 amIt's not about how fast the network is, it's about how fast the 'scope will send the data.We both know that 'scopes aren't made for doing this.If all you want is data capture to a PC then there's special data capture devices for the job.

author: jasonRF
author_rank: Regular Contributor
timestamp: April 13, 2023, 03:55:24 pm
content: Quote from: jonpaul on April 13, 2023, 01:20:14 pmThe OP needs at least 8 bits at 20 MS/s. Do you have any specific products that you could recommend for that sample rate? The least expensive picoscope that can do that seems to be the 2206b, which runs $419 US. It seems like there should be something available that is cheaper…jason

author: bifferos
author_rank: Regular Contributor
timestamp: April 13, 2023, 04:37:42 pm
content: Quote from: jasonRF on April 13, 2023, 03:55:24 pmI really don't want a picoscope... for whatever price. I'm in the market for a new scope, could do with a 4-channel one, and don't really want to purchase hardware for a specific use that could just be left in a drawer unused. I don't really like PC scopes in general and prefer to have a bench-top one. The industrial ADC cards are really over-priced for what you get, and again, it's just going to sit in a drawer when I'm not using it whereas a new bench top scope will be something I'll be using all the time. If I wanted something custom I'd probably go the AD9226 route they have cheap boards on ali-express, but it's still a project to get the data into the PC, and that's not really the project I wanted!

author: 2N3055
author_rank: Super Contributor
timestamp: April 13, 2023, 06:37:38 pm
content: Quote from: bifferos on April 13, 2023, 04:37:42 pmYou asked the question. Picoscope is cheapest solution that works inside your parameters.Standalone scopes cannot do that. I don't know if there is even one standalone scope that can stream data, at any speed.. only triggered blocks..So what you want is not doable the way you are trying to force the solution. I agree standalone scope is more general solution. It will be good for everything else, except streaming...

author: Someone
author_rank: Super Contributor
timestamp: April 13, 2023, 10:33:58 pm
content: Quote from: 2N3055 on April 13, 2023, 06:37:38 pmThis was over with the first reply, the OP is trying to find something which doesn't exist. Which from one point of view is understandable as the hardware of many scopescoulddo this task (at some lower sample rate) but the manufacturers don't see the point in adding that feature as its such a niche use and has high support costs.

author: Fungus
author_rank: Super Contributor
timestamp: April 13, 2023, 11:07:30 pm
content: Quote from: Someone on April 13, 2023, 10:33:58 pmPlus: The results would probably be so bad that most people would just go online and be angry about it."My 'scope is capable of 2GS/sec, why can it only stream at 100kS/sec.??"What manufacturer needs that?(A sound card will do better: You can get 384kHz, 32-bit sound cards quite cheap these days (under $150), they'll stream data all day long because they're designed for that)Edited for clarity

author: 2N3055
author_rank: Super Contributor
timestamp: April 13, 2023, 11:08:49 pm
content: Quote from: Fungus on April 13, 2023, 11:07:30 pmOpening question was for 20MS/s..

author: Fungus
author_rank: Super Contributor
timestamp: April 13, 2023, 11:23:11 pm
content: Quote from: 2N3055 on April 13, 2023, 11:08:49 pmI know. I was trying to point out that a sound card would probably be better than any existing 'scope. Post edited for clarity.

author: jonpaul
author_rank: Super Contributor
timestamp: April 14, 2023, 01:30:16 am
content: If the OP wants 8 bits at 20 M samples/sec, exp[ect to pay a lot.Thyer PC or devices the OP uses must have the memory to accommodate the data flow, or a real time DSP/Analyzer.Depend on the application, many PC cards and DACs exist for A to D conversion, but none are intended as a scope.See TI for an IChttps://www.ti.com/lit/ds/snas136m/snas136m.pdf?ts=1681435728055&ref_url=https%253A%252F%252Fwww.google.com%252FNational Instruments moduleshttps://www.ni.com/en-us/shop/hardware/products/multifunction-io-device.htmlJon

author: maxwell3e10
author_rank: Frequent Contributor
timestamp: April 14, 2023, 03:20:32 am
content: An inexpensive solution that would mostly work is a USB logic analyzer with an analog channel. There are many versions but I played at some point with LHT00SU1 for $20. It can stream 16 MHz 8 bit data to PC using sigrok until stopped by user. The only issue I found is that it needs a high-quality USB cable to work reliably.

author: Berni
author_rank: Super Contributor
timestamp: April 14, 2023, 05:42:53 am
content: Quote from: nctnico on April 13, 2023, 02:17:01 pmDid go look at the SCPI specification here:https://www.ivifoundation.org/docs/scpi-99.pdfFor binary data it specifies binary data as being ASCII encoded in binary,hex or octal. So they are sent as "#B00000011" or #"H03" or "#Q0003"But yeah the term SCPI tends to be used as a name for describing test equipment remote control, mostly because the majority of the equipment out there uses it for remote control. Perfectly fine to add proprietary commands on top since the SCPI spec cant possibly cover all use cases. It doesn't make SCPI impossible to use for high bandwith uses, just that the way it is typically implemented in test equipment does not lend itself to moving this much data this fast. Instruments that do need this much I/O performance tend to use other protocols that are purpusly built for it.Quote from: bifferos on April 13, 2023, 04:37:42 pmWell you asked for scopes that can do this, and you got the answer.Id say 400 bucks is a pretty good deal. If i needed such a system and was to go cobble together one, i would likely spend more than 400 bucks worth of my time to get it working.Most people here agree that PC based scopes are annoying as heck to use. But they are the only kind of scope that actually benefits a good deal of functionality(long memory, analysis etc..) from having such a streaming mode, so for the designers of the scope it was worth the extra time and effort to implement the streaming functionality.For regular oscilloscopes that are designed to capture data at GS/s not MS/s they are architectured to process the samples locally at high speed, since this is too much data to stream to a PC anyway. Even things that do use SCPI control for running these scopes (like part of a industrial test system) will generally not have much use for it, they will typically just use automated measurements (like freqency, volts pp..etc) and grab the result over SCPI. If they do need the waveform, then they will typically set up the system to trigger on the exact required moment and only transfer the waveform of interest, since that is much faster than sifting trough gigabytes of data manually in software. Hence there is very little motivation for real oscilloscopes to have such a streaming feature in the first place.

author: 2N3055
author_rank: Super Contributor
timestamp: April 14, 2023, 11:35:52 am
content: Quote from: PeDre on April 14, 2023, 10:58:15 amNot in the one linked but this one...: DOI: 10.1109/IEEESTD.1992.114468But that is support for the 8 bit integer and floating point binary BLOCK mode.There is no known implementation of STREAMING..You could cache, block transfer, cache block transfer etc... But that requires even faster burst speed, and reassembly at target.There is no mention anywhere, streaming is supported for such high data volume device....

author: zrq
author_rank: Frequent Contributor
timestamp: April 14, 2023, 11:39:04 am
content: One may consider a Red Pitaya board. It's still overpriced given how poor their AFE design is and how cheap the Chinese scopes are today, but it should fit your need with a margin.

author: egonotto
author_rank: Super Contributor
timestamp: April 14, 2023, 05:18:08 pm
content: Quote from: zrq on April 14, 2023, 11:39:04 amHello,with my Pitaya STEMlab 125-14 I reach max 14.897 MB/s with 1 channel and 8 BitBest regardsegonotto

author: zrq
author_rank: Frequent Contributor
timestamp: April 14, 2023, 05:33:40 pm
content: I haven't tried with my board yet, but the doc (https://redpitaya.readthedocs.io/en/latest/appsFeatures/applications/streaming/appStreaming.html) say it can stream up to 20 MB/s via GbE.I know they are incompetent, but didn't expect this much...

author: 2N3055
author_rank: Super Contributor
timestamp: April 14, 2023, 08:50:40 pm
content: And then you just go with Pico that simply works as specified...

author: Ben321
author_rank: Frequent Contributor
timestamp: March 20, 2025, 01:08:47 pm
content: Quote from: maxwell3e10 on April 14, 2023, 03:20:32 amWow that is actually really impressive. Does it work in streaming mode in its own official software? Or does it depend on 3rd party software using its API to do streaming mode?

author: Ben321
author_rank: Frequent Contributor
timestamp: March 20, 2025, 01:15:36 pm
content: Quote from: egonotto on April 14, 2023, 05:18:08 pmDoes that even support streaming mode? When I go to their official website, it mentions different features it has like spectrum analyzer and oscilloscope, but no mention of streaming mode. Is that like some secret undocumented feature it has?

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 20, 2025, 01:26:49 pm
content: Quote from: maxwell3e10 on April 14, 2023, 03:20:32 amI never noticed this device before... Looking at theSigrok database, they comment that the analog channel has a bandwidth of 3MHz. Still, streaming analog can be a useful feature.I don't know why so many people poo-poo on the Pico scopes - personally, I'd love to have one but cannot justify the cost for hobby use.EDIT - for $13 on Amazon -shipped- I may well get one of these LHT00SU1 boxes just to play with.

author: 2N3055
author_rank: Super Contributor
timestamp: March 20, 2025, 01:55:18 pm
content: Quote from: TomKatt on March 20, 2025, 01:26:49 pmPicoscopes are top notch equipment.For some applications they are best there is.But you are correct, they are not cheap.

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 20, 2025, 02:27:49 pm
content: Quote from: 2N3055 on March 20, 2025, 01:55:18 pmI wonder if they hold some patent or something? I find it odd that there are few cheap knock-off clones of Pico scopes. I guess the software is what makes Pico scopes to be as good as they are, and there's no way to cheap out on quality software.

author: ledtester
author_rank: Super Contributor
timestamp: March 20, 2025, 03:15:57 pm
content: Quote from: TomKatt on March 20, 2025, 01:26:49 pmhttps://www.amazon.com/LHT00SU1-Oscilloscope-Multifunction-Generator-JTLB/dp/B0C6QXM62FMaybe read the only review of it... perhaps it'll work with sigrok but not being to return it if it doesn't work would be a bummer.

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 20, 2025, 04:22:00 pm
content: Quote from: ledtester on March 20, 2025, 03:15:57 pmI saw that review as well - funny how the exact same item sold by other vendors does not seem to have that problem. I've seen so many negative reviews from people who obviously have little experience with electronic modules complaining about 'issues' that are simply due to lack of knowledge. In this case, I suspect the item description with 'Salae' in the wording makes them think it will work with the Salae Logic application. We all know that Salae software only works with genuine Salae products. But as this item is listed on the Sigrok database, I suspect it will work just fine.EDIT - Maybe I've been lucky, but I've never had an issue returning something that was ships from Amazon. Even if the seller doesn't respond, I just click on the 'Return' button in my order history and write a little complaint and off it goes back to them. Granted, I don't abuse the return privilege and have only returned a small number of items that all had legitimate reasons. This is why I try to avoid 3rd party sellers and shipping if possible. That said, I really only use Amazon as the US version of Alibaba - anything significant (ie test gear) I always purchase through the official vendor or distributor. I have found that not only does this provide better service down the road, but in many cases is actuallycheaperthan Amazon. Plus - screw Amazon and others making money of the working class. Make them pee in a can because they don't get 5 minutes to use a rest room lol. Not to mention Bezos bought the Washington Post and was too intimidated to endorse Harris - I dropped my subscription that day. Sorry, had to get that out of my system - I'm still wound up about the whole debacle.

author: egonotto
author_rank: Super Contributor
timestamp: March 20, 2025, 06:00:07 pm
content: Quote from: Ben321 on March 20, 2025, 01:15:36 pmHello,yes, the Red Pitaya can stream. You need a program on your PC to do this. I haven't tried it for a long time and can't remember the details.The Analog Discovery can also stream, although not very fast. You might even get 4 channels with two of the same Analog Discovery.Best regardsegonotto