SDS1104X-U Bugs + Scripts - Page 1
Forum section: electronics / testgear

author: sanderb
author_rank: Contributor
timestamp: February 15, 2025, 04:53:41 am
content: I purchased an SDS1104X-U several years ago, figuring that I didn't need the additional features of the SDS1104X-E. It is serving me well, albeit sometimes (before the release of the SDS800X HD) I wished I had purchased the SDS1104X-E for its webserver and bode plotting.Its biggest flaw is something no reviewer could have known at the time, which is that unlike for all its other oscilloscopes, Siglent has not released a single firmware update for it, ever. It is stil stuck at its original 1.1.5R6 from 2021.I figure Siglent forked the SDS1104X-E codebase back then, tweaked and disabled features for the SDS1104X-U, and never touched it again. That's a problem, because its SCPI subsystem has some very important bugs. At least at the time, Siglent must not have had any automated unit tests for it.For example,The<source>:WF? DAT2command to fetch waveform samples cannot fetch more than 20 samples at a time. The SCPI subsystem seems prone to internal buffer overflows, and any query returning more than approximately 40 bytes gets it into a corrupt state. Luckily theWFSUcommand works correctly, so I can still fetch 14,000 samples in 9 seconds per channel by sampling the buffer 700 times.The screendumpSCDPcommand returns the BMP header and a few bytes of garbage, and then corrupts the SCPI subsystem. Unplugging the USB cable or turning off/on the oscilloscope cleans up the bad state. I had hoped to use this command to obtain screenshots without the need for USB stick swapping, but alas.Querying for the phase difference between two channels with<source>:MEAD? PHAresults in a decode error because of two extra bytes. The returned phase is also not in the range [-180,180[ but [-90, 270[ instead. The same is the case in the user interface. This is of course easy to work around.The command<source>:PAVA? ALLreturns a truncated response and SCPI gets into a bad state. The workaround is to usePAVAcommands for individual measurements.TheMENU? / MENU ON / MENU OFFcommands do the exact opposite. E.g. to turn off the menu, useMENU ON.UsingMEGS?hangs the SCPI subsystem.Cursor track mode is very slow with SCPI. Gate measurements is faster and should be used instead with SCPI.No doubt there are more SCPI bugs, but by far the most important one is the broken<source>:WF? DAT2command. If only Siglent would release a firmware update that fixes that command.Anyhow, not all is lost. If you own an SDS1104X-U, you may want to check out the Python scripts I recently shared athttps://github.com/sanderberents/eelab. Connect your SDS1104X-U with USB to your computer, and an SDG1032X as well if you have any, install a few Pyton dependencies and run them. I have only tested it on a Mac, but they should work on other OSes as well:autoscale.py: I assigned this to a keyboard shortcut on my Mac. Have your waveforms fit on the screen, press the keyboard shortcut, and it will automatically optimize the vertical scale and offset to make full use of the available 8 bits.plot.py: Plots up to 14,000 samples from the active oscilloscope channels. Optionally it can average multiple sweeps, giving you a virtual 10, 12 or even 16 bits oscilloscope if you are patient. I added this script as a Shortcut menubar item (I use a Mac), with multiple averaging variants, so with one click I can plot the samples in a window on my computer and copy/paste them in my notes.bodeplot.py: Yes, you can create bode plots with your SDS1104X-U too.curvetracer.py: A lot nicer than X-Y mode.datalogger.py: Use this in Roll mode to output or plot changing voltages over minutes, hours or days.scpi.py: Experiment with SCPI yourself, and link your scripts and the bugs you find here.These scripts are written specifically for the SDS1104X-U, working around the bugs. Because I cannot retrieve the whole 14M samples buffer, I often use gated measurements for example.Enjoy!

author: eTobey
author_rank: Super Contributor
timestamp: February 15, 2025, 06:05:24 am
content: Quote from: sanderb on February 15, 2025, 04:53:41 amSince the SDS800X HD has also SCPI bugs (among others), it seems that they dont really care about that. Or they should improve their test procedures in general.

author: tautech
author_rank: Super Contributor
timestamp: February 15, 2025, 06:07:55 am
content: Quote from: sanderb on February 15, 2025, 04:53:41 amWelcome to the forum.Thanks for the report.Can I ask of your source of SCPI commands as not all you have mentioned are in the official programming manual:https://int.siglent.com/u_file/document/SDS1000%20Series&SDS2000X&SDS2000X-E_ProgrammingGuide_PG01-E02D.pdf

author: sanderb
author_rank: Contributor
timestamp: February 15, 2025, 06:41:09 am
content: Quote from: tautech on February 15, 2025, 06:07:55 amThank you. That is the exact document I used.<source>:WF? DAT2on p263WFSUon p264SCDPon p149<source>:MEAD? PHAon p116<source>:PAVA? ALLon p122MENU? / MENU ON / MENU OFFon p86MEGS?on p130

author: tautech
author_rank: Super Contributor
timestamp: February 15, 2025, 06:53:41 am
content: You only mentioned you were using a MAC and USB connectivity, is it with NI-VISA connectivity drivers MAC version ?Not a programmer arse here, just trying to extract all possible pertinent info for Siglent to analyze.

author: sanderb
author_rank: Contributor
timestamp: February 15, 2025, 07:23:08 am
content: Quote from: tautech on February 15, 2025, 06:53:41 amI am using Python3 and pyvisa on macOS (Sequoia, but happened also on older versions). I experimented with buffer sizes, timeouts and reading data in chunks. I was able to retrieve a few KB ofSCDPthat way, but it was still garbage. The<source>:WF? DAT2bug is most important of course. The results are always pretty much the same.If incorrect command syntax is used, or a buggy command, or the query response is more than around 40 bytes, the SCPI subsystem will get into a bad state. Subsequential commands will then return partial previous responses, or it will stop responding all together. The manual oscilloscope operations will keep working fine, only the SCPI subsystem is affected.Since unplugging/replugging the USB cable resolves it, it might be either that pyvisa gets into a bad state, or the oscilloscope, and unplugging/replugging it resets that state. But either way it is likely caused by the oscilloscope SCPI subsystem returning extra unexpected bytes, or too few of them. E.g. retrieving 20 samples works reliably, but try 21, 30, 50 or 100 and it will fail.

author: tautech
author_rank: Super Contributor
timestamp: February 15, 2025, 07:44:45 am
content: As mentioned I couldn't program my way outta a paper bag but there might be something in the App notes on the NA website:https://siglentna.com/application-notes/sds100x-u/https://siglentna.com/application-note/programming-example-sds-oscilloscope-save-a-copy-of-a-screen-image-via-python-pyvisa/

author: sanderb
author_rank: Contributor
timestamp: February 15, 2025, 08:01:03 am
content: Quote from: tautech on February 15, 2025, 07:44:45 amI have more details in the git repository that I didn't mention in my post above, but the examples Siglent provides on their website and in their official documentation do not work on the SDS1104X-U. Obtaining a screenshot with SCPI does not work at all, and retrieving waveform samples works only if it is done in batches of up to 20 samples max. This is how one of my scripts fetches up to 14,000 samples, by sending 700WF?andWFSUcommands. That takes 9 seconds per channel. Doing that for all 14,000,000 samples would take approximately 2.5 hours.

author: tautech
author_rank: Super Contributor
timestamp: February 15, 2025, 08:30:48 am
content: Hopefully one of the X-E member coders here can test your findings so for us to know if it's a X-* platform issue or just relevant to the X-U.