Author Topic: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group  (Read 4318 times)

0 Members and 1 Guest are viewing this topic.

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
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
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #1 on: December 12, 2018, 10:06:42 pm »
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.
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28371
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #2 on: December 13, 2018, 01:45:58 am »
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/#msg2024833

Some 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
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 
The following users thanked this post: daveyk

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #3 on: December 13, 2018, 03:03:33 am »
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.
 
The following users thanked this post: tautech, daveyk

Offline tv84

  • Super Contributor
  • ***
  • Posts: 3221
  • Country: pt
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #4 on: December 13, 2018, 02:25:21 pm »
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.
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #5 on: December 13, 2018, 07:09:20 pm »
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
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #6 on: December 13, 2018, 07:28:13 pm »
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
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #7 on: December 13, 2018, 07:54:19 pm »
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
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28371
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #8 on: December 13, 2018, 08:02:27 pm »
We should probably drop a link to the latest programming guide for those that want to play along at home:
Version RC01-E02A
2018-05-22
http://old.siglentamerica.com/USA_website_2014/Documents/Program_Material/Programming%20Guide.pdf

Many 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 Series
Model               Valid?
SDS1000CFL     no
SDS1000A        no
SDS1000CML+/CNL+/DL+/E+/F+   no
SDS2000X        yes
SDS1000X        yes
SDS1000X-E     yes



Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #9 on: December 13, 2018, 08:11:30 pm »
Version RC01-E02A
2018-05-22

Yup 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
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28371
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #10 on: December 13, 2018, 08:26:53 pm »
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.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #11 on: December 13, 2018, 09:28:56 pm »
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

Use "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 value

To clear all statistics use the PACL command
To setup custom measurements you can use PACU

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

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.

If you need a full description of any given command just ask.
 
The following users thanked this post: daveyk

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #12 on: December 13, 2018, 10:48:12 pm »
"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
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #13 on: December 13, 2018, 10:54:15 pm »
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
 

Offline Performa01

  • Super Contributor
  • ***
  • Posts: 1642
  • Country: at
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #14 on: December 13, 2018, 11:02:21 pm »
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
Go to [Utility] -> Reference Position.
Select Horizontal "Constant Position" instead of "Constant Delay".
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #15 on: December 13, 2018, 11:12:07 pm »
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_clear

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

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #17 on: December 18, 2018, 12:37:18 am »
"Select Horizontal "Constant Position" instead of "Constant Delay"."

In the case of the SDS1204E-X, that is Horizontal: Fixed Position

Thanks!  Now I will see if that can be set programmically.


Dave
 

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #18 on: December 18, 2018, 12:48:40 am »
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.ResourceManager
Global Scope As VisaComLib.FormattedIO488
================================
And then in the scope functions module:
Set ioMgr = New VisaComLib.ResourceManager
Set Scope = New VisaComLib.FormattedIO488
Set Scope.IO = ioMgr.Open(Trim(TDSAdr))
================================
So anywhere in the program, if I type:
scope.  I get a bunch of options

The 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
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #19 on: December 18, 2018, 06:24:22 am »
https://www.siglentamerica.com/wp-content/uploads/dlm_uploads/2017/10/ProgrammingGuide_forSDS-1-1.pdf

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

Offline daveykTopic starter

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: us
Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #20 on: December 18, 2018, 07:07:19 am »
https://www.siglentamerica.com/wp-content/uploads/dlm_uploads/2017/10/ProgrammingGuide_forSDS-1-1.pdf

Page 141,


That’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.

Dave


Sent from my iPhone using Tapatalk
« Last Edit: December 18, 2018, 07:10:20 am by daveyk »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #21 on: December 18, 2018, 07:38:08 am »
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.
« Last Edit: December 18, 2018, 07:41:33 am by Rerouter »
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28371
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1204X-E, SDS1200 Series Programming Support thread/Group
« Reply #22 on: December 18, 2018, 08:31:58 am »
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 of workable size.
https://www.siglentamerica.com/video/binary-to-csv-x-e/


Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf