Telonic TEST

Category: Knowledge Base SPD1000X

  • 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

  • Power Supply Design: Load Step Response with a SIGLENT DC Electronic Load

    Power Supply Design: Load Step Response with a SIGLENT DC Electronic Load

    Building a power supply that can handle various loads without oscillating can be a challenge. Computational models and computer simulations can help get your design headed in the right direction, but physical testing is essential to proving the performance of your design.

    One method of quickly determining stability is to use a load step response.

    In this test, a DC electronic load is used to provide a current load that steps from a low current draw to a higher value in a short period of time. By directly measuring the voltage and current output of the supply with the stepped load, we can visually observe the recovery of the power supply feedback loop and make changes to the design to optimize the response.

    For this note, we are going to perform identical tests on two supplies and compare the output voltage and current waveforms: One has been tuned so that the output quickly recovers with minimal overshoot and ringing. The other supply is not tuned and subsequently oscillates. We will also discuss some measurement techniques to help get the right data as quickly as possible.

    We also have a video to accompany this note:

    Power Supply Design: Load Step Response with a SIGLENT DC Electronic Load

    The Equipment:

    • A DC Electronic Load: The SIGLENT SDL1020X-E is a 200 W load with dynamic testing capabilities to perform the load step. It also features remote sense capabilities to compensate for the voltage drop across the load leads. High currents can provide a substantial voltage drop across the leads and will add unwanted error.
    • An oscilloscope: The SIGLENT SDS2354X Plus scope has a large display, easy-to-use interface, and features that make capturing these waveforms very easy.
    • A power supply: The SIGLENT SPD1168X single output supply delivers power to our power supply board
    • A current probe: The SIGLENT CP4070 features a 150 kHz bandwidth that will minimize most switching noise from the measurement
    • Power supplies to test: The Analog Devices LTM4646 series of uModule Regulators. This module features two 10A DC-DC converters. One has been “detuned” to show some common problems associated with power supply design. The other supply has been left in it’s tuned state as a comparison to the detuned supply.

    More details click here.

  • 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: