Siglent scope: trial and error to find proper syntax for SCPI commands - Page 1
Forum section: electronics / testgear

author: rfclown
author_rank: Frequent Contributor
timestamp: October 16, 2023, 06:09:36 pm
content: One of my frustrations with the Siglent SDS-1104X-E scopes we have at work is that I sometimes have to do trial and error to figure out the proper SCPI syntax. You cannot cut and paste from the manual. For instance, I was wanting to read the "Top" measurement of my waveform. Open manual, search for TOP, find the command, cut and paste, expect it to work... wrong as usual with Siglent.So the specific example command they had wasn't TOP, but RISE, so I'll use that example here. If I cut and paste from the manual I get:C2: PAVA? RISETimeout expired before operation completed. (What my program tells me for VISA error -1073807339)So I play around with things, and finally find that if I remove the space between the colon and the PAVA, it works:C2:PAVA? RISEC2:PAVA RISE,3.352000E-07SAs far as I know there is no resource on the scope to determine if your syntax is bad. There is no error message. It just doesn't work. "Is the feature not implemented?", is my immediate thought. Then sometimes after much trial and error I figure out how to make it work. Other times I give up.

author: tautech
author_rank: Super Contributor
timestamp: October 16, 2023, 07:08:15 pm
content: Please state scope FW version in use and programming manual version.

author: KungFuJosh
author_rank: Super Contributor
timestamp: October 16, 2023, 07:23:29 pm
content: Quote from: rfclown on October 16, 2023, 06:09:36 pmDo you know of another device that responds to bad syntax? I'm not any good at SCPI stuff, but I know for the different meters I've tried including other brands, I get no response at all if the command or syntax is wrong.

author: alm
author_rank: Super Contributor
timestamp: October 16, 2023, 07:33:45 pm
content: Quote from: KungFuJosh on October 16, 2023, 07:23:29 pmI don't remember specifically which instrument, but several Keithley and HP instruments I worked with would flash an error message on the screen and beep whenever they received a command they didn't understand, or received a command that's not valid in the current configuration. You can usually also query this error state via SCPI. Only very old instruments from the early eighties or older would behave differently.

author: rfclown
author_rank: Frequent Contributor
timestamp: October 16, 2023, 08:13:07 pm
content: Quote from: alm on October 16, 2023, 07:33:45 pmThis is also my experience. Most of the equipment on my bench at work and at home is HP/Agilent/Keysight. Most (except very old) have an error que that will show all errors. I also have keithley, Gigatronics, Anritsu, LeCroy. I've worked with all kinds of stuff over the years: Wavetek, IOtech, Boonton. I'm trying to think of anything that didn't give SOME kind of error notice (GPIB LEDs, screen message). Some instruments will also emit a beep with a bad command. But my main gripe here is that I cut and paste the command from the manual into my program, and it doesn't work.

author: rfclown
author_rank: Frequent Contributor
timestamp: October 16, 2023, 08:14:58 pm
content: Quote from: tautech on October 16, 2023, 07:08:15 pmSoftware Version: 6.1.37R2Uboot-OS Version: 8.1FPGA Version: 2021-07-12Hardware Version: 01-05Product Type: SDS1104X-EManual is what I found online when I Googled:https://siglentna.com/USA_website_2014/Documents/Program_Material/SIGLENT_Digital_Oscilloscopes_Remote%20Control%20Manual.pdf

author: tautech
author_rank: Super Contributor
timestamp: October 16, 2023, 08:22:10 pm
content: Quote from: rfclown on October 16, 2023, 08:14:58 pmOld FW and OS.Both need updating.https://int.siglent.com/upload_file/zip/firmware/Oscilloscope/SDS1xx4X-E_V6.1.37R10_EN.ziphttps://int.siglent.com/upload_file/zip/firmware/Oscilloscope/SDS1xx4X-E_EN.zipDownload and unzip both. Study PDF installation instructions.QuoteLatest version:https://int.siglent.com/u_file/document/SDS1000%20Series&SDS2000X&SDS2000X-E_ProgrammingGuide_PG01-E02D.pdf

author: rfclown
author_rank: Frequent Contributor
timestamp: October 17, 2023, 01:40:43 pm
content: Quote from: tautech on October 16, 2023, 08:22:10 pmThanks for the information. Might take me a while to try. Security at work doesn't allow easy USB access, so getting firmware onto equipment can be a pain. For now my workaround was figuring out the space issue for the PAVA command, and manually configuring the TOP measurement. I could not figure out how to get the PACU command to work, so I set the measurement manually.So this new firmware/software makes it so that you can have the extra space in the PAVA SCPI command? If you send the command as in my previous post (cut and pasted from manual) it works on a unit you have? What about the PACU command? What is the correct syntax? (I tried all kinds of perturbations of the manual example). Is there any way to get an indication on the scope that a bad SCPI command has been received?

author: KungFuJosh
author_rank: Super Contributor
timestamp: October 17, 2023, 02:47:59 pm
content: Quote from: rfclown on October 17, 2023, 01:40:43 pmYou can probably update firmware on the web console. I know you can on the higher models.

author: nctnico
author_rank: Super Contributor
timestamp: October 17, 2023, 02:54:17 pm
content: Quote from: rfclown on October 17, 2023, 01:40:43 pmNo. SCPI commands never have spaces between ':' and the commands. The ':' IS the seperator. Please read the SCPI protocol specification so you can see an example command is formatted properly or not. This is a good start:https://en.wikipedia.org/wiki/Standard_Commands_for_Programmable_InstrumentsUpdating the firmware has nothing to do with your problem at hand. It would be rather insane if the SCPI commands are different between software versions; it would defeat the purpose of automating measurements.

author: rfclown
author_rank: Frequent Contributor
timestamp: October 17, 2023, 03:25:59 pm
content: Quote from: nctnico on October 17, 2023, 02:54:17 pmThank you for this information. Normally when I'm trying a new SCPI function, I'll cut and paste from the manual to eliminate any possibility of a typo error on my part. If that doesn't work, I don't normally assume that it is an error with the manual. I guess with Siglent, that isn't the case. Hence my gripe with Siglent.

author: h_ro
author_rank: Newbie
timestamp: October 18, 2023, 01:16:14 am
content: Quote from: rfclown on October 16, 2023, 06:09:36 pmAlthough undocumented in Siglent manuals, try using SYSTem:ERRor? to get very basic syntax or execution error messages. Seems to work on my SDS2000X+ scope and appears for several other vendor manuals.It can tell you basic things such as whether it couldn't understand the command or if you submitted an invalid parameter.Code:# Command executed without error>>C1:PAVA? ALLMAX,3.041670E+00,MIN,-3.333000E-02,PKPK,3.075000E+00,TOP,3.025000E+00,BASE,-1.667000E-02,AMPL,3.041670E+00,LEVELX,****,MEAN,1.672978E+00,CMEAN,****,STDEV,1.489559E+00,VSTD,****,RMS,2.240009E+00,CRMS,****,MEDIAN,3.000000E+00,CMEDIAN,****,OVSN,****,FPRE,****,OVSP,5.479452E-01,RPRE,5.479452E-01,PER,****,FREQ,****,TMAX,1.000047E-01,TMIN,9.995001E-02,PWID,****,NWID,****,DUTY,****,NDUTY,****,WID,****,NBWID,****,DELAY,9.999395E-02,TIMEL,9.999395E-02,RISE,3.382510E-06,FALL,****,RISE20T80,3.382510E-06,FALL80T20,****,CCJ,****,PAREA,1.681520E-04,NAREA,8.541200E-07,AREA,1.672978E-04,ABSAREA,1.690061E-04,CYCLES,0.000000E+00,REDGES,1.000000E+00,FEDGES,0.000000E+00,EDGES,1.000000E+00,PPULSES,0.000000E+00,NPULSES,0.000000E+00>>SYST:ERR?0,"No error"# Undefined header/command>>INVALID_COMMAND>>SYST:ERR?-113,"Undefined header;INVALID_COMMAND"# Invalid command parameter>>C1:PAVA? PARAM>>SYST:ERR?-224,"Illegal parameter value"Keysight has a full list of possible error messages:https://rfmw.em.keysight.com/bihelpfiles/n8900/webhelp/US/Content/__A_Home_Page/SCPI_Error_Messages.htm

author: 2N3055
author_rank: Super Contributor
timestamp: October 18, 2023, 06:52:36 am
content: Quote from: nctnico on October 17, 2023, 02:54:17 pmWhat do you mean "Updating the firmware has nothing to do with your problem at hand."??Why do you think firmware update exist? If there is error you simply ignore it?Nobody will change syntax just like that but there can be bug fixes and new commands.Quote from: rfclown on October 17, 2023, 03:25:59 pmLoad latest firmware and download newest manual.I don't see space in manual.Pasted:C2:PAVA? RISEC2:PAVA RISE,3.6E-9SC1:PAVA? ALLC1:PAVAThose are all occurrences of ":PAVA" string in Prog Guide.Again, manual you are referring to is from 2014, as URL you posted clearly states. Manuals can have typos and new features are added all the time, so manuals are corrected and updated. Please download current one as per Tautech link.

author: Performa01
author_rank: Super Contributor
timestamp: October 18, 2023, 08:35:38 am
content: Quote from: 2N3055 on October 18, 2023, 06:52:36 amThis happens only with Siglent. All other manufacturers are perfect in this regard.

author: tautech
author_rank: Super Contributor
timestamp: October 18, 2023, 08:50:27 am
content: Quote from: Performa01 on October 18, 2023, 08:35:38 amAdditional bold added.The clue to this is the latest programming manual version: E02DSome Siglent websites list the manual release date in the URL, some don't so the version # is always the most reliable indication of the latest.

author: 2N3055
author_rank: Super Contributor
timestamp: October 18, 2023, 09:38:05 am
content: Quote from: Performa01 on October 18, 2023, 08:35:38 amAbsolutely.This never happens with, for instance Keysight, where in the manual for MSOX3000T there was:- ETS sampling available and how it is used- 1,5 GHz version clearly stated- USB 2.0 decoding in menus and documentation explained in details although it didn't work (3000T is missing FPGA resources for that)- etc..And don't even get me started on R&S RTB2000..For all my devices, I check for new FW and new manual no rarer than every few months...

author: nctnico
author_rank: Super Contributor
timestamp: October 18, 2023, 01:52:31 pm
content: Quote from: 2N3055 on October 18, 2023, 06:52:36 amBecause the problem is 1) a typo and 2) the OP not seeing the example doesn't adhere to the SCPI standard. Ergo, a firmware update is not going to help. Blindly suggesting a firmware update (without checking a particular firmware version solves the OP's problem) is just wasting time. Especially since the OP clearly states that a command which adheres to the SCPI standard does work.

author: tautech
author_rank: Super Contributor
timestamp: October 18, 2023, 07:09:22 pm
content: Quote from: nctnico on October 18, 2023, 01:52:31 pmYeah right, 2 OS versions and ~6 FW versions behind current means a significant amount of functionality is missing so why can't any customer benefit from updating FW.

author: nctnico
author_rank: Super Contributor
timestamp: October 18, 2023, 07:15:31 pm
content: Quote from: tautech on October 18, 2023, 07:09:22 pmTrying to work on one problem at a time is a much better approach compared to randomly trying to fix things. When your car doesn't start, you are not going to inflate your tires or clean the steering wheel.

author: tautech
author_rank: Super Contributor
timestamp: October 18, 2023, 07:55:19 pm
content: Quote from: nctnico on October 18, 2023, 07:15:31 pmFirst was to get the instrument to the latest state, one OS update then one FW update then work from the latest programming manual. 3 problems = 3 steps.Then we can all work from the same page.

author: rfclown
author_rank: Frequent Contributor
timestamp: October 18, 2023, 08:22:03 pm
content: Quote from: tautech on October 18, 2023, 08:50:27 amIndeed, the problem for me was the manual. I Googled, and picked the first URL I saw that was on the Siglent website.As far as the PACU command, it is very different between the two manuals, not just a difference of a space. No wonder I couldn't guess at the correct syntax.Old manual command example (pg 84): PACU 2, PKPK, C1New manual command example (pg 120): PACUPKPK,C 1This was cut-and-pasted from the manual into this message window. Notice the linefeed after the PACU command... whoops! It should be, "PACU PKPK,C 1" which is how itappearson the manual in a pdf viewer. Sometimes spaces are important, which is why my normal habit is to cut-and-paste from a manual or programming example so that I don't make a mistake.

author: KungFuJosh
author_rank: Super Contributor
timestamp: October 18, 2023, 08:43:17 pm
content: Quote from: nctnico on October 18, 2023, 07:15:31 pmA modern car might need a firmware/software upgrade when troubleshooting. Everything set to a common standard before wasting time randomly fixing things.

author: 2N3055
author_rank: Super Contributor
timestamp: October 18, 2023, 08:54:25 pm
content: Quote from: rfclown on October 18, 2023, 08:22:03 pmI do must warn you that PDF format is actually very bad. It was made for page typesetting.Perfectly visually rendered page, when copied and pasted can paste as a spageti because of how PDF internally works...And writer that creates page has no control of how internally PDF renderer works...I have been bitten by random spaces, mixed codepages and scrambled sentences when copy/pasting from PDF.I still do it, many times it goes without problems, but I always proofread what was pasted..All in all, what is important is that you sorted out problem at hand and can move on with your work..And if you do find any problems, report .. Or if you need help, ask... Maybe someone can help..Best,