Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group - Page 1
Forum section: electronics / testgear

author: daveyk
author_rank: Frequent Contributor
timestamp: December 12, 2018, 05:07:22 pm
content: Does anyone on here write software in VBA or VB6, or Visual Studio to control a Siglent SDS1200 Series, or similar Siglent Scope?It would be nice to have a programming support thread/group. It would be nice to see how some of us has worked around some limitations, or figured out some un-documented features in the programmer's manual.I've been able to add quite of bit of my normal scope control code to a SDS1204 module, but there are certain features I am pulling my hair out over, or would like to find a better way to do things.Dave

author: Rerouter
author_rank: Super Contributor
timestamp: December 12, 2018, 10:06:42 pm
content: Explain what your trying to do and I will help explain the commands for you. There is actually very little that is not broken out in to commands as far as I can tell. Its just that 75% of it was undocumented. Ive found all the commands and are currently documenting them myself.The awg and mso options are all there aswell as triggering and decoders. And other fun things with a few typos in the mix.

author: tautech
author_rank: Super Contributor
timestamp: December 13, 2018, 01:45:58 am
content: Yes Rerouter has compiled the full list of SCPI commands here:https://www.eevblog.com/forum/testgear/siglent-sds1204x-e-released-for-domestic-markets-in-china/msg2024833/#msg2024833Some of the 4ch X-E functionality at this time has no remote control SCPI support however all functionality is still remotely available from within the webserver virtual UI.On the subject of this topic; Siglent do release updated programming manuals from time to time so one should check the Programming or Documents page occasionally for the latest manual versions:http://www.siglent.com/ENs/down.aspx?id=28

author: Rerouter
author_rank: Super Contributor
timestamp: December 13, 2018, 03:03:33 am
content: Tautech. My impression is Siglent would still not release documentation that fully covers all of the user level commands I have dug up though? E.g. the triggering. Decoding and commands for the options e.g. MSO and AWG?I am slowly going through all the menu screens and linking commands to menu buttons. So far there are very few gaps. And will keep you up to date when I have compiled it.

author: tv84
author_rank: Super Contributor
timestamp: December 13, 2018, 02:25:21 pm
content: Rerouter,It would be clearer if you suppress the various get/set commands and find another way of representation.And not indicate all versions of the same command for different channels.It would make the list shorter and easier to grasp. Just my opinion.

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 07:09:20 pm
content: Sorry, I didn't get back here until now. Jason has been responding and sending in confirmed bugs to Siglent engineering. In the meantime....For example, How to programically press the "Statistics" and especially, the "Clear" button on the measurement menu?I finally go to adding the sweep control commands to my software module, and looking through the programmer's manual, I know I must be dumb and blind, but I haven't found the commands to set the sweep range and position (delay). That is probably on me, but my eyes are tired now.I am also frustrated with the *RST command. it does not do a true reset, but instead is the same as pressing the DEFAULT button. When you give it the command to *RST, it sets two measurements for me that I do not want! If I could figure out how to press CLEAR, who cares, but since they get set in the order that they were selected, I can not just change Measurement (CUST1) to what I want it to be.There is a lot more. I can detail the confirmed setup recall bugs and the power off and power back on bugs if you want.Dave

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 07:28:13 pm
content: I put your notes in to a word file and printed them out (landscape mode); thanks!Okay, I missed the Timebase commands in the manual. I could swear they weren't there before I found them in your list them I found them in the programmer's manual - lol. That is vudu dude! lol

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 07:54:19 pm
content: Question:I perform a *RST command as a matter of course with my utilities and then setup all scope setting programically as I need them to be.I have my program sleep 4 seconds before continuing. There is a *WAI command, but that only prevents the scope from executing other commands until stacked commands are completed (such as RST).Is there a way to have the Vb program probe the scope and wait until the scope is finished resetting? How would the program know if the scope is ready for the next command? I have some ideas but don't know if they will work.Dave

author: tautech
author_rank: Super Contributor
timestamp: December 13, 2018, 08:02:27 pm
content: We should probably drop a link to the latest programming guide for those that want to play along at home:Version RC01-E02A2018-05-22http://old.siglentamerica.com/USA_website_2014/Documents/Program_Material/Programming%20Guide.pdfMany SCPI commands are universal for the Siglent DSO's while some are restricted to certain models/series and throughout the programming guide there are tables to indicate which commands suit which models:Eg.Availability of Digital Commands in Each Oscilloscope SeriesModel Valid?SDS1000CFL noSDS1000A noSDS1000CML+/CNL+/DL+/E+/F+ noSDS2000X yesSDS1000X yesSDS1000X-E yes

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 08:11:30 pm
content: Quote from: tautech on December 13, 2018, 08:02:27 pmYup that's the one I have. I'm working on a sub program to try to determine when the scope is finished with the reset. I am having little luck.It is interesting. I can ask it for a measurement while it is in the process of resetting and it replies with a valid response. I.E., C1:PAVA? MIN..but if I tell it to change the vertical scale, before the reset is complete, that command is ignored all together and is not stacked.Dave

author: tautech
author_rank: Super Contributor
timestamp: December 13, 2018, 08:26:53 pm
content: Dave, TBH SCPI is something I'm just learning....certainly not a strong point so just helping out where I can and learning as I go.....sorry I can't be more helpful.All I can suggest is to study the syntax examples carefully just in case there's a simple error.

author: Rerouter
author_rank: Super Contributor
timestamp: December 13, 2018, 09:28:56 pm
content: Quote from: daveyk on December 13, 2018, 07:09:20 pmUse "REBOOT" instead of RST to actually reset the scope (power cycle it)All of the statistics can be accessed for all channels even when not on screen with the PAVA? command. E.g. C1:PAVA? PKPK will grab thr peak to peak valueTo clear all statistics use the PACL commandTo setup custom measurements you can use PACUFor setting up a frequency sweep you can use the SWWV command (sweepwave) its only documented in there signal generator manuals for now.If your refering to the bode plot sweep. This is a feature I am currently requesting to be broken out on SCPI and tautech seems to be taking a tally of interest.As for determininh when the scope is back from a reset. That would just be polling IDN when it responds the scope is able to measure.There is also a switch command for statistics. But not sure its relevent to you PASTATAlso not sure if its helpful but you dont really need to rate limit yourself with this scope. The SCPI buffer size is about 700K characters. So you can throw it pages of commands and it will just work through them.If you need a full description of any given command just ask.

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 10:48:12 pm
content: "Use "REBOOT" instead of RST to actually reset the scope (power cycle it)"*RST is what is needed in this case. Doing a reboot, keeps the scope in its current state (sans the Fine VDIV bug acknowledge by Siglent). Rebooting also causes the scope to loose connection with the VISA driver/program. I am using Agilient connection expert. I have to refresh the interface after a reboot command in order to connect to the scope again. It's funny, a reset doesn't cause that."All of the statistics can be accessed for all channels even when not on screen with the PAVA? command. E.g. C1:PAVA? PKPK will grab thr peak to peak value"Yup, I missed that on page 107, I believe, of the manual."To clear all statistics use the PACL command"This does not reset the Statistics Count, at least for me. That's in the Pass/Fail section of the manual. I do not use any pass/fail features."To setup custom measurements you can use PACU"Yes, they show up in the order that they were selected. I was just upset that *RST already created two measurements for you. There doesn't appear to be a away to remove measurements once created. On the scope itself, you can do that by press "Clear". There doesn't appear to be a SPCI command to do this. The also isn't an SPCI command to press the "Statistics" button to turn on statistics."As for determining when the scope is back from a reset. That would just be polling IDN when it responds the scope is able to measure."Doesn't work, causes a VISA TimeOut error to pop-up from the visa driver. Unfortunately, On Error, can not intercept visa errors. Some commands don't cause that."There is also a switch command for statistics. But not sure its relevent to you PASTAT"Yes, that works! "PASTAT ON"."Also not sure if its helpful but you dont really need to rate limit yourself with this scope. The SCPI buffer size is about 700K characters. So you can throw it pages of commands and it will just work through them."Unfortunately, while the scope is resetting, VB does know it is resetting and keeps sending command. Most commands are lost and not in that command buffer. Right now, I am using a Sleep(4000) command after issuing the "*RST" command. It only has to reset the scope one time, when the program/utility first loads so it not a real big deal, just not as efficient as it could be.Thanks kindly for the response,Dave

author: daveyk
author_rank: Frequent Contributor
timestamp: December 13, 2018, 10:54:15 pm
content: Not programming, but there one annoyance why operating. On 50ns sweep range, I have a negative pulse on the left side of the screen.I want to spread that out, so I change Horz to 20ns and the signal flies off the left side of the screen.I have to press in the position encoder to get it back in the center of the screen and the use it to locate it to the left side of the screen again (two Major divisions from the left).It's just an annoyance. I never experienced that with the Tek TDS scopes I worked with. On a TDS3032, the Horz range selection does not change the horizontal position. It's not hard to get the pulser back, but it is annoying.Dave

author: Performa01
author_rank: Super Contributor
timestamp: December 13, 2018, 11:02:21 pm
content: Quote from: daveyk on December 13, 2018, 10:54:15 pmGo to  -> Reference Position.Select Horizontal "Constant Position" instead of "Constant Delay".

author: Rerouter
author_rank: Super Contributor
timestamp: December 13, 2018, 11:12:07 pm
content: So your issue is that 2 custom measurements are already present on reset.Why not just redefine them for what suits you. While i dont have access to see if i can clear them at the moment you should be able to reassign them.Im using eezstudio for my scpi terminal. Its an open project so if you wanted to you could take a peek at how they implemented there driver as so far nothing i have thrown at it has caused an hang or crash. Only literally crashing the scope application (be carefule with WVPR if it doesnt have a parameter it crashes the scope)There is another command that may help forcing a statistics value reset. DSCL display_clearAs for knowing when a measurement for statistics is valid. You can likely use MEASTAT?The reason i suggested PACL was its manual description for another model of scope was "clears all current parameters in custom and pass/fail"

author: Rerouter
author_rank: Super Contributor
timestamp: December 15, 2018, 11:27:47 am
content: Found a way to press the buttons, Hope it helps Daveykhttps://www.eevblog.com/forum/testgear/siglent-sds1204x-e-released-for-domestic-markets-in-china/msg2041723/#msg2041723

author: daveyk
author_rank: Frequent Contributor
timestamp: December 18, 2018, 12:37:18 am
content: "Select Horizontal "Constant Position" instead of "Constant Delay"."In the case of the SDS1204E-X, that is Horizontal: Fixed PositionThanks! Now I will see if that can be set programmically.Dave

author: daveyk
author_rank: Frequent Contributor
timestamp: December 18, 2018, 12:48:40 am
content: Does anyone have a VB example of reading the waveform data? The manual only shows a Python example.Once I tell the scope to "C1:wf? dat2", I haven't figured out a way to read all that data in.The Python example shows setting the timeout and chunk_size. With the SPCI insterface to NI VISA, that I am using, I do not have a scope.chuck_size or scope.timeout options to set.Here is how, I open the scope port:In a Global module:Global ioMgr As VisaComLib.ResourceManagerGlobal Scope As VisaComLib.FormattedIO488================================And then in the scope functions module:Set ioMgr = New VisaComLib.ResourceManagerSet Scope = New VisaComLib.FormattedIO488Set Scope.IO = ioMgr.Open(Trim(TDSAdr))================================So anywhere in the program, if I type:scope. I get a bunch of optionsThe examples shown in Python are not on the scope list. What I need to figure out how to do is create a reading loop to read the buffer.Dave

author: Rerouter
author_rank: Super Contributor
timestamp: December 18, 2018, 06:24:22 am
content: https://www.siglentamerica.com/wp-content/uploads/dlm_uploads/2017/10/ProgrammingGuide_forSDS-1-1.pdfPage 141,by reading the header for the WF? transfer, you get the amount of bytes you will need to read in (length of the block) the example they gave was 70 bytes,As for the timeout, thats hard to say, but expect it to take lets say less than 5 seconds.

author: daveyk
author_rank: Frequent Contributor
timestamp: December 18, 2018, 07:07:19 am
content: Quote from: Rerouter on December 18, 2018, 06:24:22 amThat’s not the same manual but still valuable. The VB example is very basic. What I want to do is more involved, reading the waveform data. The only example of that is in Python and I don’t even know what python is.I would imagine that once you ask it to dump the waveform data that happens very fast. I don’t understand how to read that data in to defined variables. I guess it is all sent in one big chunk. It’s not easy and I don’t have experience doing that.I do read waveform data from one of the UT instruments I work on, but through an RS232 port. It took me a long time to get that read correctly and I know if it dumped much quicker VB probably couldn’t keep up with it. Data transfer via the cat5 port is very fast with this scope.I would love if someone had already done this to share a code chunk.The reason I want to do this is not to draw the waveform in a chart, but that would be a plus. I want to be able to analyze the data and measure pulse width at whatever reference points I choose.So, I need to put this wf data in to a dimensioned variable. Each point would represent a horizontal time calculated by the horz TDIV time the point number and then the data in that variable point would be the amplitude (volts) data based on VDIV.I don’t think that part would be difficult, but for me, getting the data is hard. I just don’t have the experience receiving large chunks of data. I’m thinking with the UT instrument, I opened a file and constantly dumped the data in it, as fast as possible, closed it and then read the temp file back in to a dimensioned variable. It’s been several years since I did that routine. I will have to review it and see if anything from it can be adapted to thus need.DaveSent from my iPhone using Tapatalk

author: Rerouter
author_rank: Super Contributor
timestamp: December 18, 2018, 07:38:08 am
content: The scope does start spitting out packets very quickly, yes, a quick wire shark session shows 1514 byte packets every microsecond or so, however the WFSU command can limit the transfers size and scope if you would prefer to reduce how much your handling.From receiving the request it takes about 1 second to start,as your dealing with it by scpi, just approach it like reading and writing tcp packets. e.g. eezstudio sends it as a text payload. to the correct port.so you send form a port that is all your own, recieve messages on that port and let the computer deal with the buffer, you just read until there is no more stored packets.

author: tautech
author_rank: Super Contributor
timestamp: December 18, 2018, 08:31:58 am
content: A couple of tips for retrieving data.LXI tools:https://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/https://www.siglentamerica.com/video/lxi-tools/Use the .BIN export/save and the inbuilt .BIN to .CSV converter. Set memory depth so that .BIN files are ofworkablesize.https://www.siglentamerica.com/video/binary-to-csv-x-e/