Fetching Data from Owon SDS7102V to PC
For one of my recent projects, I needed to automatically fetch oscilloscope samples to PC for automatic analysis. I own the Owon SDS7102V oscilloscope so the first step was to find how to get data from it.
The oscilloscope supports USB and ethernet connectivity (non-V versions probably also RS232, but mine has VGA connector instead).
According to the documentation, the Owon SDS7102 should support SCPI commands, but the one I own didn’t respond to any of them (including the SCPI activation command). It either doesn’t support SCPI at all or the FW on my scope is simply too old. At the time I checked, the link to the firmware update for my oscilloscope on the Owon site was dead :S
Also in the SCPI manual, there are no commands for reading / downloading data and no commands for triggering. There is another command manual which outlines the Owon proprietary commands for fetching data and the return data format. Owon proprietary commands for setting up the oscilloscope don’t seem to be documented, but the source code of the two applications I will mention later is pretty self-explanatory.
Next to the official Owon PC application, there are at least two published applications for controlling Owon oscilloscope. owon-dump can be used to fetch data and parse it. owoncontrol is used to send commands to the oscilloscope and to change the parameters. Both are open source and seem to be more oriented towards the linux society, with no binary files available, also both are using the USB interface.
I decided it was simpler for me to translate the owon-dump to python and change the interface to TCP than to try to port the programs and compile them under windows.
Owon scope needs to have a manually assigned IP to be able to accept TCP connection from PC (you have to configure it on the oscilloscope). I used a MikroTik Hap Lite as a wireless client to make my oscilloscope WiFi enabled 🙂
The “dump” commands (STARTBMP, STARTBIN, STARTMEMDEPTH) are pretty simple and I had them running quickly. The only thing that can go wrong here is setting the delays/timeouts for the data reception (the scope does take its time when you request a data snapshot).
Here is a simple script that worked for me:
import socket, time, errno, ctypes, struct
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "Open socket"
# set IP and socket to your oscilloscope
print "Send command"
chunk_size = 1024 * 16
rcvd_data = 0
full_data = ''
timeout = 0
print "Read data ",
if(rcvd_data == 0):
timeout = timeout + 1
timeout = 0
data_chunk = s.recv(chunk_size)
rcvd_data = len(data_chunk)
full_data += data_chunk
except socket.error, e:
if e.args == errno.EWOULDBLOCK:
rcvd_data = 0
print "Close socket"
print "Write file"
with open("Output.bin", "wb") as text_file:
The next step was to decode the BIN file and produce some processable data. This involved translating owon-parse to python which took a bit more effort, mainly because of data casting (hint: see struct.unpack).
And now I have some meaningful data I can feed to my processing algorithms 🙂
That’s just how bad an uncompensated probe looks on the square calibration signal 😉 If you look carefully you will notice it’s the same signals as in the first image on the scope.
Do you have the bin file parser? I am looking to do the same thing
You can try compiling the owon-dump sources, which should be easy on linux and not too hard on windows… I will have a dig when I am at home to find the sources translated to python (but note that code might be buggy and it certainly isn’t as clean as dump code presented here)…
You can check out the following code: http://www.rei-labs.net/wp-content/uploads/2018/01/owon_read.zip But beware that it is untested so i suggest you to first do some test readouts at different scope settings (voltage divider, offset, timebase) to verify that it actually works 😉
Thank you for this article and code. I found that whilst owon_read.zip worked correctly on one python installation it did not on another. The trigger for the problem being a negative y offset. IMHO the cause and solution is:
i = read_u32()
i = read_u32()
I’m no Python expert but presumably long can have different implementations.
Here is a similar discussion about Owon oscilloscopes, SCPI and Matlab:
The following link could eventually also be helpful to stream data from an Owon oscilloscope to a PC via SCPI, MATLAB or Python:
I am trying this code on SDS7102V under Python 3 on Ethernet, apparently it does not communicate (does not respond with anything) even when the syntax is converted. Does SDS7102V support SCPI?
Is there a way to check if the scope correctly responds (it responds to Ping), for instance, connecting it to terminal application (what is the format? RAW?)
You can try connecting using putty to port 3000. You can then send simple textual commands to the scope.
I’ve been able to communicate well with the SDS7102, from linux with a Python program, and using SCPI. All went well till I wanted to get the channel sensitivity (command :CHAN1:SCALe?) No reply from the ‘scope. Undocumented: When in SCPI mode, the scope still accepts STARTMEMDEPTH, STARTBMP and STARTBIN which is great, because switching between proprietary and SCPI mode is tedious.
Do you have any idea which could be the correct SCPI command to get the channel V/div?