Automated wave capture for Siglent Scopes - Page 1
Forum section: electronics / testgear

author: HendriXML
author_rank: Super Contributor
timestamp: October 10, 2019, 01:11:02 am
content: I made a GitHub repository explaining how to capture traces and show them as a diagram in Excel.https://github.com/HendriXML/XMLScripts-Project-WaveCapture/wiki/Making-a-Excel-graph-step-by-stepFeel free to discuss whether this is of use (and what could be improved).The script is tested with the normal acquisition mode and CH1..CH4. (It's also not intended for critical usage.)

author: HendriXML
author_rank: Super Contributor
timestamp: October 10, 2019, 09:06:30 am
content: Here's a link to the main script:https://github.com/HendriXML/XMLScripts-Project-WaveCapture/blob/master/Script.Project/Capture%20traces.xmlIt reads some parameters from a config section. That config section is then echoed back.With more complex scripts this is handy to redo things. Using a more complex script supporting repeating tests its advisable to save the reports tabs. The tool can support many of them, making it easy to document things.Normally I would also use the script to setup the scope, awg, psu, however this script is intended as an easy way to just capture the active traces and the screen.

author: HendriXML
author_rank: Super Contributor
timestamp: October 10, 2019, 12:32:29 pm
content: I was happy to read about Windows having a sandbox option nowadays. The tool can off course run in it, but it also needs the VISA drivers installed. (Only the bare minimum)These can be found at:https://www.ni.com/nl-nl/support/downloads/drivers/download/packaged.ni-visa.305862.htmlThe after installing the sandbox option in Windows the tool can be executed using the RunSandboxed.wsb config file I added to the root of the repository.It's best to first edit it to set the right directories (they must exist) and then "run" it.The tool will automatically start, but will give an missing component error when executing the script. Therefore before actually executing the script the VISA package must be installed. This won't take long, because it only needs a bare minimum (deselect all).But don't reboot at the end, this will close and wipe the sandbox session.Using this approach the script could be executed completely sandboxed within 6 minutes. The directory locations in the sandbox are different (on desktop), so the script configuration should use those.BTW, the virus report of the exe can be shown here:https://www.virustotal.com/gui/file/98cd39bccb493cb1b5d553539cf20a3430facdf91e04adc1c8888dc92d6a6eec/detection

author: HendriXML
author_rank: Super Contributor
timestamp: October 10, 2019, 04:56:48 pm
content: Made a wikipage on running it in a sandbox:Running-the-script-sandboxedTheMaking-a-Excel-graph-step-by-stepis updated as well.

author: tautech
author_rank: Super Contributor
timestamp: October 10, 2019, 09:39:48 pm
content: What advantage/s does this offer over using SCPI commands from within the webserver command page to get .bin files that can be converted to .csv for dropping straight into Excel ?There's a .bin to .csv utility available in the webserver to install on your PC and then convert the exported .bin files.An outline of this .bin to .csv utility is in a video here:https://siglentna.com/video/binary-to-csv-x-e/

author: HendriXML
author_rank: Super Contributor
timestamp: October 10, 2019, 11:59:55 pm
content: Quote from: tautech on October 10, 2019, 09:39:48 pmGood question!One benefit of this script over the Siglent tool could be the file format. Its a bit how you use it.The Siglent tool combines the value of parameters and the actual wave data in the same csv file. This can make it harder to choose a datatype for each column. Also the first records need to be skipped.With the XML file format they're separated, and only the wave data is within a table. This is also a true Excel table, which gives benefits. The data can also easily be refreshed. The parameters of the waveform can be placed anywhere else.Using scripts the capture is automated using filenames of choice. The scope can be setup, but also a signal generator or psu.Also calculations can be done. Averaging multi frame acquisitions, resulting in higher bit depths are already supported and can be saved to another xml format. But why always use Excel to do the processing? For a lot of stuff it is not the right tool. Processing data using a script that can interact with the scope can be beneficial too.Also scripts can be used to document things by writing a log. That can be handy when doing a lot of tests.I think it's mostly a difference between automated and semi-automated. In some situations it makes all the difference, in some it doesn't.Automating stuff comes with some investment, like learning the tool and the scripting language. I bring this tool forward to see whether it could have its (tiny) place in the e-community. It sure has its place in how I enjoy my hobby. This particular script is a way to find out whether it could be of use to owners of the same scope. The idea was initiated by someone asking when the Siglent tool would show the time (related) to the trigger moment. I then thought, the script should support that! And why not share it.

author: HendriXML
author_rank: Super Contributor
timestamp: October 11, 2019, 10:01:09 am
content: I used the Siglent tool to do a quick comparison between the script. They are except for some very little rounding differences the same. As can be seen in the graph.The Siglent tool seems to be limited at 100K samples.

author: HendriXML
author_rank: Super Contributor
timestamp: October 11, 2019, 10:56:24 am
content: When I look at the CVS the Siglent tool produces, the channel values are formatted like:-0.26000A decimal resolution of 10u. Using the 500uV/div there's a 25 uV LSB / DAC resolution. So rounding errors could become relevant. But when using attenuations of lower than 1, it might become problematic.Will test this sometime...

author: rf-loop
author_rank: Super Contributor
timestamp: October 11, 2019, 06:09:55 pm
content: Quote from: HendriXML on October 11, 2019, 10:56:24 amAfaik, 500uV/div DAC nominal resolution is 20uV (step size is 20uV), not 25uV.

author: HendriXML
author_rank: Super Contributor
timestamp: October 11, 2019, 06:25:13 pm
content: Quote from: rf-loop on October 11, 2019, 06:09:55 pmYou're right! Don't really have a calculator brain.. maybe that's why I like them scripts so much!

author: HendriXML
author_rank: Super Contributor
timestamp: October 12, 2019, 11:33:24 pm
content: I'm in the process of adding a extra script to the repository. This script takes the averages of a multi segment capture. It also allows saving the min and max value.This corresponds to the averaging mode (but better, with increased resolution) and a multi cycle peak detect mode (normal peak detect mode is a way of displaying multiple samples in one point in time, Excel also seems to show both the lows an the highs the same way).I however added noise to the waveform. Without noise there's only a little bit of increased resolution, because it then clearly shows the quantization done by the scope. The normal noise on the signal is not enough to elevate/descent the signal enough to reach higher or lower bit values.The min max is due to the added noise not meaningful, but there's no harm in showing it.With this technique (averaging with added noise), it is possible to see details that otherwise cannot be seen. Or show a normal sine in all its glory.The bottom image is without averaging.

author: HendriXML
author_rank: Super Contributor
timestamp: October 13, 2019, 12:35:48 am
content: I added the new script. Using the following commands in the local repository should do the trick.Code:git pull origingit submodule update --recursiveStarting with a new local repository is also an option.

author: HendriXML
author_rank: Super Contributor
timestamp: October 15, 2019, 08:32:32 pm
content: Updated the scripts and tool, it now no longer uses the Visa COM wrappers, which had USB connection issues.The added image shows how detailed the visualization of the signal can get. It also shows subtracting the average of the noise signal (ideally that should be 0V, but in practice it might have some spikes).The signal is a sine with a superimposed sine with a 0.5% amplitude of the main one.

author: HendriXML
author_rank: Super Contributor
timestamp: October 15, 2019, 10:00:10 pm
content: When running the script checking verbose logging shows some extra processing details.

author: HendriXML
author_rank: Super Contributor
timestamp: October 22, 2019, 01:47:49 pm
content: Uploaded a new version of the scripts.Because the averaging script might take a while I added nested status updates so the progress can be followed.There's also the possibility to monitor the SCPI commands in the VISA report by checking the debug mode checkbox.https://github.com/HendriXML/XMLScripts-Project-WaveCapture/wiki/Making-a-Excel-graph-step-by-step

author: HendriXML
author_rank: Super Contributor
timestamp: November 10, 2019, 07:57:23 pm
content: Updated the script a bit and upgraded the libraries it is based upon.To be notified of future progress it's most handy to use GitHub "watch" functionality.

author: HendriXML
author_rank: Super Contributor
timestamp: November 14, 2019, 10:24:31 pm
content: Updated the scripts to have them possibly run on more scopes.The idea is to virtualize the devices more. About the same direction as the purpose of VISA classes: talking to different devices via the same programming interface. But now by implementing classes via SCPI calls.This is doable because many scope models from Siglent share the same SCPI commands. Some with restrictions, some a bit different.In this update the framework to implement differences and act on restrictions is implemented as a proof of concept. To actually implement more scopes I either need them on the bench, or need feedback from owners.The main script initializes a scope object like this:Code:TSiglentScope.MatchingClass(ScopeSession).Create(ScopeSession)This is implemented in "VISA Siglent Scopes.xml" as this:Code:<Choose><When Expression="Manufacturer = 'Siglent Technologies'"><Choose><When Expression="Model='SDS1204X-E'"><Execute Statement="Result:= TSiglentSDS1204XE"/></When><When Expression="Model='SDS1104X-E'"><Execute Statement="Result:= TSiglentSDS1104XE"/></When><When Expression="Model='SDS1202X-E'"><Execute Statement="Result:= TSiglentSDS1202XE"/></When><When Expression="Model='SDS1102X-E'"><Execute Statement="Result:= TSiglentSDS1102XE"/></When><Otherwise><Raise Expression="Exception.Create(sErrorUnknownScope + Model)"/></Otherwise></Choose></When><Otherwise><Raise Expression="Exception.Create(sErrorUnknownScope + Manufacturer + ' ' + Model)"/></Otherwise></Choose>Which reads the manufacturer and model via the SCPI IDN Query. Using that data a specialized class for this scope is returned. For now the models are thus limited.Also the differences in implementations within such a class is limited. More advanced implementations would -for example- raise exceptions on all the stuff that's not supported by a certain model.On GitHub device requests/issues can be added.https://github.com/HendriXML/XMLScripts-Common-VISA/issuesWhat I offer is to catch some low hanging fruit, but others are of course free to join the exercise.

author: HendriXML
author_rank: Super Contributor
timestamp: January 20, 2020, 02:17:21 pm
content: Another thread got me interested in filtering a multisegment acquisition on a certain criteria, in this case a rising or falling slope which is out of specs.I tested the script using 2 combined AWG channels, each generating a pulse.The second channel pulses are slow rising/falling, delayed a bit and 5 Hz instead of 500 Hz. (Thus "rare")The script saves only the screen shots and data files of those segments who violate the max rise/fall times.The following configuration can be set:Code:VoltageLow=0 VVoltageHigh=5 VMaxRiseTime=50 nsMaxFallTime=50 nsThe rise and fall times are determined between the low/high crossings:VoltageLow + (VoltageHigh - VoltageLow) * 0.1andVoltageHigh - (VoltageHigh - VoltageLow) * 0.1The script needs to be run after a stopped multi segment acquisition with history off or the last segment activated.I'll put the updated scripts on GitHub, but that might take some time.

author: HendriXML
author_rank: Super Contributor
timestamp: January 20, 2020, 03:39:47 pm
content: I uploaded the script to GitHub, the main script can be viewed:https://github.com/HendriXML/XMLScripts-Project-WaveCapture/blob/master/Script.Project/Capture%20multi%20segment%20traces.xml