Author Topic: Using an oscilloscope for data acquisition  (Read 4805 times)

0 Members and 1 Guest are viewing this topic.

Offline bifferosTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Using an oscilloscope for data acquisition
« on: April 12, 2023, 11:26:34 pm »
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!
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4961
  • Country: au
    • send complaints here
Re: Using an oscilloscope for data acquisition
« Reply #1 on: April 13, 2023, 12:26:55 am »
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-mode
SCPI is not going to come close.
 
The following users thanked this post: egonotto, jasonRF

Offline bifferosTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: Using an oscilloscope for data acquisition
« Reply #2 on: April 13, 2023, 08:12:31 am »
Oscilloscopes are not streaming devices, they're trigger oriented.

I 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?
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 7238
  • Country: hr
Re: Using an oscilloscope for data acquisition
« Reply #3 on: April 13, 2023, 08:35:57 am »
Oscilloscopes are not streaming devices, they're trigger oriented.

I 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?

Streaming 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...
 
The following users thanked this post: egonotto

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5026
  • Country: si
Re: Using an oscilloscope for data acquisition
« Reply #4 on: April 13, 2023, 09:39:59 am »
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.0

Common 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.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27929
  • Country: nl
    • NCT Developments
Re: Using an oscilloscope for data acquisition
« Reply #5 on: April 13, 2023, 10:33:54 am »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline bifferosTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: Using an oscilloscope for data acquisition
« Reply #6 on: April 13, 2023, 11:29:31 am »
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

Maybe 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 RAW
And then I was reading the raw values.

Or are you saying the driver receives ASCII over the USB bus and converts it for me?
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5026
  • Country: si
Re: Using an oscilloscope for data acquisition
« Reply #7 on: April 13, 2023, 12:55:47 pm »
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)

 

Offline jonpaul

  • Super Contributor
  • ***
  • Posts: 3583
  • Country: fr
Re: Using an oscilloscope for data acquisition
« Reply #8 on: April 13, 2023, 01:20:14 pm »
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
Jean-Paul  the Internet Dinosaur
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27929
  • Country: nl
    • NCT Developments
Re: Using an oscilloscope for data acquisition
« Reply #9 on: April 13, 2023, 02:17:01 pm »
@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
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17184
  • Country: 00
Re: Using an oscilloscope for data acquisition
« Reply #10 on: April 13, 2023, 02:33:27 pm »
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.

It'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.
 
The following users thanked this post: Someone

Offline jasonRF

  • Regular Contributor
  • *
  • Posts: 204
  • Country: us
Re: Using an oscilloscope for data acquisition
« Reply #11 on: April 13, 2023, 03:55:24 pm »
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
The 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
 
The following users thanked this post: egonotto

Offline bifferosTopic starter

  • Regular Contributor
  • *
  • Posts: 52
  • Country: gb
Re: Using an oscilloscope for data acquisition
« Reply #12 on: April 13, 2023, 04:37:42 pm »
The 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…

I 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!
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 7238
  • Country: hr
Re: Using an oscilloscope for data acquisition
« Reply #13 on: April 13, 2023, 06:37:38 pm »
The 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…

I 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!

You 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...
 
The following users thanked this post: egonotto

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4961
  • Country: au
    • send complaints here
Re: Using an oscilloscope for data acquisition
« Reply #14 on: April 13, 2023, 10:33:58 pm »
The 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…

I 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!

You 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...
This 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 scopes could do 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.
« Last Edit: April 14, 2023, 02:36:35 am by Someone »
 
The following users thanked this post: egonotto, 2N3055

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17184
  • Country: 00
Re: Using an oscilloscope for data acquisition
« Reply #15 on: April 13, 2023, 11:07:30 pm »
the hardware of many scopes could do 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.

Plus: 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
« Last Edit: April 13, 2023, 11:28:04 pm by Fungus »
 
The following users thanked this post: Someone

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 7238
  • Country: hr
Re: Using an oscilloscope for data acquisition
« Reply #16 on: April 13, 2023, 11:08:49 pm »
the hardware of many scopes could do 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.

Plus: 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?

PS: You can get 384kHz, 32-bit sound cards quite cheap these days (under $150). They'll stream data all day long - they're designed for it.

Opening question was for 20MS/s..
 
The following users thanked this post: egonotto

Online Fungus

  • Super Contributor
  • ***
  • Posts: 17184
  • Country: 00
Re: Using an oscilloscope for data acquisition
« Reply #17 on: April 13, 2023, 11:23:11 pm »
Opening question was for 20MS/s..

I know. I was trying to point out that a sound card would probably be better than any existing 'scope. Post edited for clarity.
 
The following users thanked this post: 2N3055

Offline jonpaul

  • Super Contributor
  • ***
  • Posts: 3583
  • Country: fr
Re: Using an oscilloscope for data acquisition
« Reply #18 on: April 14, 2023, 01:30:16 am »
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 IC

https://www.ti.com/lit/ds/snas136m/snas136m.pdf?ts=1681435728055&ref_url=https%253A%252F%252Fwww.google.com%252F

National Instruments modules

https://www.ni.com/en-us/shop/hardware/products/multifunction-io-device.html

Jon
Jean-Paul  the Internet Dinosaur
 

Offline maxwell3e10

  • Frequent Contributor
  • **
  • Posts: 903
  • Country: us
Re: Using an oscilloscope for data acquisition
« Reply #19 on: April 14, 2023, 03:20:32 am »
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.
 
The following users thanked this post: jasonRF

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5026
  • Country: si
Re: Using an oscilloscope for data acquisition
« Reply #20 on: April 14, 2023, 05:42:53 am »
@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

Did go look at the SCPI specification here:
https://www.ivifoundation.org/docs/scpi-99.pdf

For 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.

The 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…
I 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!

Well 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.
 
The following users thanked this post: egonotto

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 7238
  • Country: hr
Re: Using an oscilloscope for data acquisition
« Reply #21 on: April 14, 2023, 11:35:52 am »
Did go look at the SCPI specification here:
https://www.ivifoundation.org/docs/scpi-99.pdf

For 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"

SCPI can use the IEEE 488.2 block format for binary data. This is also mentioned in the linked document. My instruments from Rigol or R&S also use the block format.

Peter

Not in the one linked but this one...: DOI: 10.1109/IEEESTD.1992.114468

But 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....
 
The following users thanked this post: egonotto

Online zrq

  • Frequent Contributor
  • **
  • Posts: 333
  • Country: 00
Re: Using an oscilloscope for data acquisition
« Reply #22 on: April 14, 2023, 11:39:04 am »
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.
 

Online egonotto

  • Frequent Contributor
  • **
  • Posts: 975
Re: Using an oscilloscope for data acquisition
« Reply #23 on: April 14, 2023, 05:18:08 pm »
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.

Hello,

with my Pitaya STEMlab 125-14 I reach max 14.897 MB/s with 1 channel and 8 Bit

Best regards
egonotto


 

Online zrq

  • Frequent Contributor
  • **
  • Posts: 333
  • Country: 00
Re: Using an oscilloscope for data acquisition
« Reply #24 on: April 14, 2023, 05:33:40 pm »
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...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf