Turning point in the Battle against the SCPI Gods


SCPI stands for "Standard Commands for Programmable Instruments." I have been using SCPI (often pronounced "SKIPPY") my entire engineering career and they are anything but standardized.

Every brand of instrument (Agilent, Tektronix, Siglent) uses different command trees and can have different parameters syntaxes. Worse, many times things don't work as advertised and it takes hours of trial and error to determine if the problem is a bug (either in your code or the instrument firmware), quirk (like having to pause before sending the next command), or Error in the documentation.   

Many of the big makers are moving toward what is known by the acronym IVI.  But I want to stay away from that because it requires all kinds of third-party libraries to be loaded on someone's PC.  I just want to use a simple ethernet socket connection to setup and collect data.

Fortunately, Siglent has cleaned up their act with their latest firmware releases.  Their SCPI documentation leaves allot to be desired, however, once I got the AWG working on the SDG6022X it also worked on the SDG2122X once they were both updated to the latest firmware.

The problem that I had is that the documentation does not explain how to send an arbitrary waveform to the AWG.  I found examples on the Siglent website for both Matlab (using VISA) and python (using sockets).  Both had the same SCPI commands.  When I wrote the example in C# (using sockets) it did not work.  

After scratching my head for a while, I reasoned that python is a very slow language. So I put thread sleeps (pauses) between the commands in C# to slow it down and it worked fine.  I spent (or wasted) time eliminating the sleeps (one by one) to see which were actually needed.  The only one that is needed is the one after sending the binary wave data.  The pause at the end of the Binary data seems to signal that there is no more binary data.  Without the pause, the AWG interprets follow-on SCPI commands as part of the waveform data.  PIA.

The major issues are solved.  Next weekend the C# control software that will close the loop to create an inductance measurement instrument from an AWG and Scope should be done and we can demonstrate it (as scheduled).  Also, we can start to design the Transistor circuit (this is actually the easiest part).

Patreon:
https://www.patreon.com/posts/turning-point-in-78276103

Tagged:
Sign In or Register to comment.

About Cookies

This website uses cookies to ensure you get the best experience on our website.

Learn more: https://www.cookiesandyou.com/