Telonic TEST

Category: Knowledge Base SDM3000 Series

  • Programming Example: Performing a series of measurements with an SDM and Scan Card

    Programming Example: Performing a series of measurements with an SDM and Scan Card

    Here are a list of recommended commands for programmatically executing a scan with a SIGLENT SDM3055 or SDM3065X with scan card option (formerly the SC1016 option)

    NOTE: # indicates a comment. You may need to change this symbol, depending on which programming environment you choose to use.

    The commands, shown in quotes, will need to be sent using the appropriate function call for the program environment and command type. More information on each command can be found in the Programming Guide for the SDM. For exact command syntax, please refer to your programming environment documentation.

    “ROUT:SCAN ON” #Enable scan

    “ROUT:FUNC STEP” #Select step type of scan

    “ROUT:DCV:AZ OFF” #Turn off the Autozero. Scan will execute more quickly, but accuracy may suffer over time due to drift

    “ROUT:CHAN 1,ON,DCV,AUTO,FAST” #Configure Channel 1

    “ROUT:CHAN 2,ON,DCV,AUTO,FAST” #Configure Channel 2

    “ROUT:CHAN 3,ON,DCV,AUTO,FAST” #Configure Channel 3

    “ROUT:CHAN 4,ON,DCV,AUTO,FAST” #Configure Channel 4

    “ROUT:CHAN 5,ON,DCV,AUTO,FAST” #Configure Channel 5

    #The scan will start at the Low channel and step to the High, defined below

    “ROUT:LIMI:HIGH 5” #This sets the highest channel value in the scan list

    “ROUT:LIMI:LOW 1” #This sets the lowest channel value in the scan list

    “ROUTe:COUN 1” #Perform a single scan

    “ROUTe:START ON” #Begin scan

    #Poll (loop, when response matches “OFF”, scan is finished)

    “ROUT:START?” #Is the scan finished?

    #Insert proper READ statement here to evaluate return string for poll

    #Return data string from each channel individually

    “ROUT:DATA? 1”

    #Insert proper READ statement here to return the data string

    “ROUT:DATA? 2”

    #Insert proper READ statement here to return the data string

    “ROUTe:DATA? 3”

    #Insert proper READ statement here to return the data string

    “ROUTe:DATA? 4”

    #Insert proper READ statement here to return the data string

    “ROUTe:DATA? 5”

    #Insert proper READ statement here to return the data string

  • Quick remote computer control using LXI Tools

    Quick remote computer control using LXI Tools

    Introduction:

    There are many options for people considering remote communication and control of test and measurement instrumentation. In most cases, a computer is used to communicate to test instrumentation using USB or LAN connections. The computer can configure the instruments, collect and organize data, and present it in a useful and flexible way.

    Remote control provides:

    • Increased repeatability: The instrumentation is set up the same way, every time.
    • Efficient data collection: Data can be automatically filtered and stored.
    • Easily configure the test system parameters: Each command is executed in the same order and in the same timeframe.
    • Quickly visualize system performance: Graphical or tabular data formatting is easy.

    There are numerous platforms (Windows, Linux, etc..) and software programs (LabVIEW, .NET, Python) available to build automated test systems. The right choice for your application is highly dependent on your needs and the available skills you have.

    In this note, we are going to discuss how to use LXI Tools to communicate with SIGLENT instrumentation. LXI Tools is an open source software application that uses the local area network (LAN) connection to quickly control remote instrumentation. It is easy to install, has a small operating footprint, and is really powerful while being quite easy to use. Let’s start by looking at the basics.

    You can also see the video version of this note here: https://siglentna.com/video/lxi-tools/

    Why Open Source?

    Open source coding is a community-based development style in which a group of contributors work together to build and maintain programs using shared code and components. In this way, a platform can be built and tested quickly and may cost significantly less than commercial programming environments. LXI Tools is free open source software and the project welcomes new contributors that would like to help improve the tools.

    Here is a link to the LXI Tools website: https://lxi-tools.github.io

     

    Why LXI Tools?

    LXI-Tools is a collection of open source software tools that provide direct control of LXI compatible instruments such as modern oscilloscopes, power supplies, spectrum analyzers, and more.Simply install LXI Tools, connect your instrument, and start communicating.

    It really is that easy.

     

    LXI-Tools Provides:

    • Quickly discover the available instruments on the LAN
    • Retrieve copies of the displayed images (quickly see signals, data, and instrumentation setups) and convert image file types
    • Benchmark LAN performance
    • Send individual commands to an instrument to perform simple test actions. For example, you could return the measured data from a DMM.

    To learn more about LXI-Tools, please see https://github.com/lxi-tools/lxi-tools

     

    Instructions:

    1. Install the appropriate version of LXI-Tools for your operating system

     

    2. Open a terminal. In this example, I am using Ubuntu (17.10) running on a virtual machine hosted by a Win 10/64 bit OS.

    To learn more about the virtual machine used in this example:https://www.virtualbox.org/

    The OS is Ubuntu: https://www.ubuntu.com/

     

    3. Once loaded, startup Linux:

    With Ubuntu, you can use Snap to install:

    $ snap install lxi-tools

     

    LXI Discover:

    Quickly searches the LAN for instruments and lists their identification string and IP address.

    Plug in and power on your instrumentation and make sure that they are connected to a working LAN connection. You can manually check the instrument IP address and save this info to compare to later steps.

    Open up a terminal window.  At the “$” prompt, simply type lxi discover… LXI tools will search the LAN for connected instruments.

     

    Here, we have three devices connected: an SDM3065X, SSA3032X, and an SDS1102X-E (which has been superseded by the SDS1202X-E series here in North America). It also includes the instrument serial number, firmware revision, and IP address.

    NOTE: This has been tested with a large number of instruments, but may not be supported by some. There is a list of compatible instruments at the end of this note or you can check LXI-Tools support for the latest list of supported products.

     

    Screenshot:

    This function retrieves a copy of the instrument display and saves it to the local drive. This is ideal for adding information to reports and sharing events with colleagues.

    Type “lxi screenshot – – address <device address>”

    NOTE: There should be two “-” with no spaces before “address” for every command.

     

     

    Image Edits using ImageMagicks

    Use ImageMagick® to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPXEXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

    For more information, visit… https://www.imagemagick.org/script/index.php

    $ lxi screenshot –address <ip> – | convert – screenshot.jpg
    $ lxi screenshot –address <ip> – | convert – screenshot.tiff
    $ lxi screenshot –address <ip> – | convert – screenshot.bmp

     

    Benchmark:

    The benchmark command sends 100 requests via LAN and measures the average response time of the instrument. It can be used as a gauge for the health of the connection. Higher response rates = faster links.

    $ lxi benchmark –address <ip>

     

    Manual vs. Auto-load:

    The commands can also be manually or auto-loaded:

    Auto-load/detect:

    $ lxi screenshot –address 10.0.0.42

    Vs. manually specifying which screenshot plugin to use:

    $ lxi screenshot –address 10.0.0.42 –plugin siglent-ssa3000x

    The only advantage of manually specifying which plugin to use it that it is a bit faster because it does not go through the instrument auto detection steps (retrieve ID, parse regex rules to match correct plugin etc.).

     

    Sending instrument specific commands:

    You can also use the SCPI command to send any command to the instrument.

    Note that if you have an SCPI command with spaces you must remember to send the specific command in quotes like so:

    $ lxi scpi –address 192.168.55.113 “MEAS:VOLT? CH1”

    This way the tool knows how to parse the full SCPI string.

    In this example, we send the “READ?” command to an SDM and return a reading:

     

     

    GUI

    Another really great feature is the GUI for LXI Tools. This allows you easy access to discovery of instruments on the network as well as some powerful tools for data capture and instrument control.

    $ lxi-tools.lxi-gui

    This adds a very simple yet powerful graphical interface for the LXI tools program:

     

    NOTE: Ignore the “Qt” error shown.

    This opens a clean control window:

     

    • Search: Discover the instruments connected to the LAN. Here, we have three instruments connected:

     

    • SCPI command line: Send instrument specific commands. Click on the instrument you wish to communicate with and then enter the command. For queries (commands that require an instrument response, or read function), the returned string will be shown in the text box:

    NOTE: The specific commands that can be used are available in the instrument programming guide. Check out the specific instrument documentation for more details.

    This tool can be helpful when trying out specific sequences of commands. You can send them one-at-a-time and then observe the instrument functionality.

     

    • Screenshot:  Capture and save an image from the instrument. This also features a “live” button that will continuously poll the instrument.

     

    After saving, you can recall the image:

     

    • Benchmark:  Checks the performance of the LAN  connection by sending a series of commands and measuring the response time. Larger “requests/second” = greater possible bus performance.

     

    • Data Recorder:  Sends the user-defined command a number of times/second and attempts to graph the data. Be aware that data can be returned in different formats and at different rates depending on device configuration. Going faster can make the system unstable and could cause a crash or hang-up.

     

    And the data: 

     

    • Settings: Configure the timeouts and other controls.

     

    • About:  Version info.

     

     

     


    *Here is a list of the latest compatible instruments tested with Lxi-Tools (03/13/2018)

    SSA3000X Series:

    SSA3000X (Latest 1.2.8.5a)

     

    SDS1000X-E Series:

    SDS1202X-E (Older 5.1.3.8R2)

    SDS1202X-E (Latest 5.1.3.13)

    SDS1204X-E (Latest/first production release 7.6.1.12)

     

    SDS1000X/X+ Series:

    SDS1202X+ (Latest 1.1.2.15E3)*

    *LIMITED COMMAND SET AVAILABILITY

     

    SDS2000X Series:

    SDS2304X (Older 1.2.2.2)*

    SDS2304X (Latest 1.2.2.2R10)*

    *LIMITED COMMAND SET AVAILABILITY

     

    SDS2000 Series (replaced by the SDS2000X):

    SDS2204 (Latest 1.2.2.2)*

    *LIMITED COMMAND SET AVAILABILITY

     

    SDM3000 Series:

    SDM3045X (Older rev 5.01.01.01)

    SDM3045X (Latest rev 5.01.01.03)

    SDM3055 (Latest rev 1.01.01.01.19)

    SDM3065X (Older rev 3.01.01.02)

    SDM3065X (Latest rev 3.01.01.03)

     

    SDG1/2/6X Series:

    SDG1032X (Latest 1.01.01.22R5)

    SDG20122X (2.01.01.23R7)

    SDG6052X (Latest 6.01.01.28R1): 405.3

  • Testing Open Socket Communications Using PuTTY

    Testing Open Socket Communications Using PuTTY

    Many instruments include the ability to be controlled via a remote connection to a computer using an Ethernet connection. In many cases, these instruments require a special software library that can help establish and maintain the communications link between the instrument and controlling computer. This can be annoying for a few reasons… the software library is likely to occupy a large amount of space on the controlling computer and is also required on any computer that is being used to control the instrument. In a remote networking application where multiple user’s may want access to a test instrument, this can cause support and installation headaches.

    Luckily, there are a few solutions that can help. In this application note, we are going to discuss using open socket communication techniques using an open source communication tool called PuTTY with a SIGLENT SSA3032X spectrum analyser.

    What are open sockets and why use them?

    Within the context of Ethernet/LAN connections, sockets are like mailboxes. If you want to deliver information to a specific place, you need to be sure that your information is delivered to the correct address.

    In the context of test instrumentation, an open socket is a fixed address (or port number) on the Ethernet/LAN bus that is dedicated to process remote commands.

    Open sockets allow remote computers to simply use existing raw Ethernet connections for communications without having to add additional libraries (VISA or similar) that require additional storage space and processing overhead.

    Programs that utilize sockets for LAN communication tend to take up less memory and operate more quickly.

    PuTTY

    PuTTY is an open source software tool that provides a number of simple communication links (RAW, Telnet, SSSH, Serial, and others). It is available for free and there are a number of versions available for popular operating systems.

    You can download as well as learn more here: https://www.putty.org/

    In this example, we are using PuTTY to verify the raw LAN connection is working properly. It is quite a simple program that does not allow for very complex operation (sequences, converting data sets/strings, etc..). If you require more complex functionality, software platforms like Python, .NET, C#, LabVIEW, etc.. can be used to control the instrument using a similar open socket connection.

    Configuration

    In this test, we are using the most current revision of the SIGLENT SSA3032X Spectrum Analyzer firmware (Revision 01.02.08.02) which enables open socket communication.

    This example also uses PuTTY version 0.67:

    Steps

    1. Install PuTTY for the OS you intend to use

    2. Make sure your instrument and firmware revision can use open sockets

    The SSA3032X revision 01.02.08.02 enables open socket communication.

    To find the revision, press the System button > Sys Info.

    Figure 1 below shows a sample system information screen from a SIGLENT SSA3000X analyzer:


    Figure 1: Sample system information page from an SSA3000X.

    Check the product page and firmware release notes for more information.

    3. Connect the instrument to the local area using an Ethernet cable

    4. Find the IP address for the instrument. This is typically located in the System Information menu. On the SIGLENT SSA3032X, press the System button on the front panel > Interface > LAN.

    Figure 2 below shows a sample LAN setup page from a SIGLENT SSA3000X:


    Figure 2: Sample LAN information page from an SSA3000X.

    5. Open PuTTY

    6. Select Raw as connection type

    7. Enter the IP address in the Host Name field

    8. Enter the port number. This should be provided in the users or programming guide for the instrument.

    The SIGLENT SSA3000X uses port 5025.

    Figure 3 below shows the PuTTY configuration for this example:


    Figure 3: Example PuTTY configuration.

    9. Press Open. This will open a terminal window as shown in below:

    10. Using the computer keypad, enter *IDN? and press the Enter key on the keyboard to send the command.

    This is the standard command string that is used to request the identification string from the instrument. As shown below, the instrument responds with the manufacture, product ID, Serial Number, and firmware revision.

    Conclusion

    PuTTY is an easy way to verify an operational LAN connection to instrumentation that can use open sockets.

  • Verification of a LAN connection using Telnet

    Verification of a LAN connection using Telnet

    Automating a test can dramatically increase the productivity, throughput, and accuracy of a process. Automating a setup involves connecting a computer to the test instrumentation using a standard communications bus like USB or LAN and then utilizing code entered via a software layer (like LabVIEW, .NET, Python, etc..) to sequence the specific instrument commands and process data.

    This process normally goes quite smoothly, but if there are problems, there are some basic troubleshooting steps that can help get your test up-and-running quickly.

    In this note, we are going to show how to use Telnet to test the communications connection between an instrument and a remote computer using a LAN connection to ensure that it is working properly. Once the connection is verified, you can begin to work on the control software.

    Telnet provides a means of communicating over a LAN connection. The Telnet client, run on a LAN connected computer, will create a login session on the instrument.

    NOTE: The Telnet connection requires open sockets on the instrumentation. At this time, not all SIGLENT products feature open sockets. Check the product page FAQs or with your local SIGLENT support office for more information.

    A connection, established between the computer and instrument, generates a user interface display screen with SCPI> prompts on the command line.

    Using the Telnet protocol to send commands to the instrument is similar to communicating with USB. You establish a connection with the instrument and then send or receive information using SCPI commands. Communication is interactive: one command at a time.

    The Windows operating systems use a command prompt style interface for the Telnet client.

    STEPS

    1. Power on and connect the instrument to the network via LAN

    2. Verify that the Gateway, Subnet Mask, and IP address of the instrument are valid for the network you wish to use. This information is typically located in the System Information or IO menu. See the specific instrument user’s guide for more information on LAN settings.

    3. On the computer, click Start > All Programs > Accessories > Command Prompt.

    4. At the command prompt, type in telnet.

    5. Press the Enter key. The Telnet display screen will be displayed.

    6. At the Telnet command line, type: open XXX.XXX.XXX.XXX 5024 where XXX.XXX.XXX.XXX is the instrument’s IP address and 5024 is the port. You should see a response similar to the following:

    7. Now, you can enter any valid command for the specific instrument that you are controlling. See the specific programming guide for the instrument for more information.

    This is especially helpful when you are planning a specific test sequence, the effect of delays/timing, or troubleshooting a command. You can send each command one-at-a-time and check the performance of the instrument.

    *IDN? is a common identification string query (question or information request) that returns the information from the connected instrument

  • Programming Example: List connected VISA compatible resources using PyVISA

    Programming Example: List connected VISA compatible resources using PyVISA

    PyVISA is a software library that enables Python applications to communicate with resources (typically instruments) connected to a controlling computer using different buses, including: GPIB, RS-232, LAN, and USB.

    This example scans and lists the available resources.

    It requires PyVISA to be installed (see the PyVISA documentation for more information)

    ***

    #Example that scans a computer for connected instruments that
    #are compatible with the VISA communication protocol.
    #
    #The instrument VISA resource ID for each compatible instrument
    #is then listed.
    #
    #
    #Dependencies:
    #Python 3.4 32 bit
    #PyVisa 1.7
    #
    #Rev 1: 08302018 JC

    import visa

    def main():

    rm = visa.ResourceManager()
    print (rm.list_resources())

    if __name__==’__main__’:

    main()

    *****

    Here is the code:

    And here is the result of a scan:

     

    Each connected instrument returns a specific formatted string of characters called the VISA Resource ID.

    The resource ID format is as follows:

    ‘Communication/Board Type (USB, GPIB, etc.)::Resource Information (Vendor ID, Product ID, Serial Number, IP address, etc..)::Resource Type’

    In the response, each resource is separated by a comma. So, we have three resources listed in this example:

    ‘USB0::0x0483::0x7540::SPD3XGB4150080::INSTR’ – This is a power supply (SPD3X) connected via USB (USB0)

    ‘USB0::0xF4EC::0x1301::SVA1XEAX2R0073::INSTR’ – This is a vector network analyzer (SVA1X) connected via USB (USB0)

    ‘TCPIP0::192.168.55.122::inst0::INSTR’ – This is an instrument connected via LAN using a TCPIP connection at IP address 192.168.55.122

  • Programming Example: Open Socket LAN connection using Python

    Programming Example: Open Socket LAN connection using Python

    Automating a test can dramatically increase the productivity, throughput, and accuracy of a process. Automating a setup involves connecting a computer to the test instrumentation using a standard communications bus like USB or LAN and then utilizing code entered via a software layer (like LabVIEW, .NET, Python, etc..) to sequence the specific instrument commands and process data.

    In this note, we are going to show how to use Python to create a communications link between an instrument and a remote computer using a LAN connection. Once the connection is verified, you can begin to work on the control software.

    NOTE: This example requires open sockets on the instrumentation. At this time, not all SIGLENT products feature open sockets. Check the product page FAQs or with your local SIGLENT support office for more information.

    Python is an interpreted programming language that lets you work quickly and is very portable. Python has a low-level networking module that provides access to the socket interface. Python scripts can be written for sockets to do a variety of test and measurements tasks.

    Here is a Python 2.7 script that opens a socket, sends a query and closes the socket. It performs this operation in a loop 10 times:

    PythonSocket_052018

    You can follow the instructions below to build your own example:


    1. Power on and connect the instrument to the network via LAN

    2. Verify that the Gateway, Subnet Mask, and IP address of the instrument are valid for the network you wish to use. This information is typically located in the System Information or IO menu. See the specific instrument user’s guide for more information on LAN settings.

    3. Download python and your favorite python editor (I use IDLE):

    https://www.python.org/

    https://docs.python.org/2/library/idle.html

    Start your python editor:

    5. Open a new file by pressing File > New File.. and name the file

    6. Copy and paste the code at the end of this note into the file editing window:

    7. Change the IP address and port number so that they match the IP address and port for the instrument you wish to connect to:

    Save the file:

    8. To Run, select Run and Run Module: