Telonic TEST

Category: Blog

  • Programming Example: SSA/SVA analyser screen image capture using Python over LAN

    Here is a brief code example written in Python 3.4 that uses a socket to pull a display image (screenshot) from a SIGLENT SSA/SVA analyser via LAN
    and save it to the local drive of the controlling computer.

    NOTE: This program saves the picture/display image file in the same directory that the .py file is being run from. It will overwrite any existing file that has the same name.

    Download Python 3.4, connect an analyser to the LAN using an Ethernet cable, get the scope IP address, and run the attached .PY program to save an image of the analyser display. The type of file saved is determined by the instruments setting when the program is run.

    You can download the .PY file here: [Download not found]

    Tested with:

    Python 3.4
    SSA3000X
    SSA3000X Plus
    SVA1000X

  • Build FM NRSC masks for SIGLENT SSA3000X/SVA1000Xs using a Python script

    Many broadcast applications require monitoring a transmitter and observing the output amplitude vs. frequency. For FM radio applications, a common mask is defined by the National Radio Systems Committee (NRSC) and is commonly referred to as the FM NRSC mask.

    A very helpful SIGLENT owner, Dan from Alabama Broadcast Services, LLC, built an FM NRSC Mask tool using our original AM NRSC mask python code

    This program was built using Python 2.7 and helps create masks around user-defined center frequencies.

    Here is a link to the zipped download of the finished Python code: SSA3XNRSC_FM_Limit.zip

  • Programming Example: Return Peak Table Data with an SSA3000X Spectrum Analyser

    The SIGLENT SSA3000X series of spectrum analysers have an on-screen peak detection that can be used to easily show the peak values in a

    • Configure the instrument span, RBW, and amplitude to capture the signals of interest
    • Send “:CALC:MARK:PEAK:TABL ON”
    • Send “:CALC:PEAK:TABL? “ to return the peak table data

    Here, we show the displayed peak table and the data return using a VISA interface:

    Products Mentioned In This Article:

    • SSA3000X Series please see HERE
  • Testing Intrinsic Safety Barrier fusing and circuitry using an Electronic Load

    From Wikipedia: Intrinsic safety (IS) is a protection technique for safe operation of electrical equipment in hazardous areas by limiting the energy, electrical and thermal, available for ignition.

    The idea is to minimise the risk of fire or explosion by physically eliminating any potential source of ignition.

    Many IS circuits utilise special fusing and elements that are designed to dissipate the available power below certain temperature thresholds. During a fault condition, no component within the design can exceed this temperature rating.

    Testing the performance of this type of design is quite simple: Load the circuit to pull the maximum rated power and measure the temperature of all of the circuit elements (heat sinks, packaging, resistors, etc..).

    In practice, you could use a power resistor network with proper heat sinking for the load but a more convenient solution is to use an electronic load like the SIGLENT SDL1000X series.

    The SDL1000X is available in 200 and 300 W versions and features a Constant Power (CP) operation mode as well as Constant Resistance (CR), Constant Voltage (CV), as well as user-defined limits to ensure safe operation within the application test requirements.

    • Connect the Device-Under-Test (DUT)
    • Select Constant Power (CP) Mode
    • Set the current (I_range) and voltage (V_range) ranges for the test
    • Set the Power you wish the load to sink
    • Activate the load input

    After the specified time limit for your test (see your device/environment specifics for details), you can measure the components/design temperature using a thermal camera or direct temperature measurements using thermocouples and DMM like SIGLENTs SDM3000X series. In fact, the SDM3055-SC and SDM3065X-SC products feature the ability to monitor temperature on up-to-twelve thermocouples to provide multi-point temperature readings from different points on your design.

    Be sure to check heatsinks and components that are expected to dissipate the most power, but also other peripheral components and traces that may carry unexpected loads during a fault.

    NOTE: In this picture, we show an open power supply with no shielding or case. For more accurate measurement, we recommend leaving as much of the original design (shielding/case/metalwork) in place to get the most representative measurement possible.

    Products Mentioned In This Article:

    • SDL1000X Series please see HERE
    • SDM3000X Series please see HERE
  • Programming Example: Controlling an SPD power supply via Sockets over LAN

    Here is a Python 3.6 example of using sockets to control an SPD power supply connected to a computer using LAN.

    NOTE: The SPD uses VXI-11 protocol for LAN. On some systems, it is helpful to use the VXI-11 format for the IP address:

    “TCPIP::ip.add.re.ss::INSTR”

    Here is the program in full:

    Products Mentioned In This Article:

    Siglent SPD Power Supplies please see HERE

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

  • 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 utilising 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 short script that opens a socket, sends a query, and closes the socket. It does this loop for 10 times.

    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 favourite 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 so that it matches the IP address of the instrument you wish to connect to:

    Save the file:

    8. To Run, select Run and Run Module:

    #!/usr/bin/env python
    #-*- coding:utf-8 –*-
    #—————————————————————————–
    # The short script is a example that open a socket, sends a query,
    # print the return message and closes the socket.
    #—————————————————————————–
    import socket # for sockets
    import sys # for exit
    import time # for sleep
    #—————————————————————————–
    remote_ip = “192.168.0.17” # should match the instrument’s IP address
    port = 5024 # the port number of the instrument service
    count = 0

    def SocketConnect():
    try:
    #create an AF_INET, STREAM socket (TCP)
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    except socket.error:
    print (‘Failed to create socket.’)
    sys.exit();
    try:
    #Connect to remote server
    s.connect((remote_ip , port))
    info = s.recv(4096)
    print (info)
    except socket.error:
    print (‘failed to connect to ip ‘ + remote_ip)
    return s

    def SocketQuery(Sock, cmd):
    try :
    #Send cmd string
    Sock.sendall(cmd)
    time.sleep(1)
    except socket.error:
    #Send failed
    print (‘Send failed’)
    sys.exit()
    reply = Sock.recv(4096)
    return reply

    def SocketClose(Sock):
    #close the socket
    Sock.close()
    time.sleep(.300)

    def main():
    global remote_ip
    global port
    global count

    # Body: send the SCPI commands *IDN? 10 times and print the return message
    s = SocketConnect()
    for i in range(10):
    qStr = SocketQuery(s, b’*IDN?’)
    print (str(count) + “:: ” + str(qStr))
    count = count + 1
    SocketClose(s)
    input(‘Press “Enter” to exit’)

    if __name__ == ‘__main__’:
    proc = main()

    Products Mentioned In This Article:

    • SPD3000X please see HERE
  • Verification of a working remote communications connection using NI – MAX

    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 NI-MAX to test the communications connection between an instrument and a remote computer using both a USB and a LAN connection to ensure that they are working properly. Once the connection is verified, you can begin to work on the control software.

    National Instruments Measurement and Automation Explorer (NI-MAX) is a free communications tool provided with NI’s VISA library.

    You can learn more here: http://digital.ni.com/public.nsf/allkb/71544521BDE34FFB86256FCF005F4FB6

    USB Connections

    1. Power on and connect the instrument via USB cable to the computer. On a computer running Windows, the first time you connect the USB from an instrument should open a dialog box or show a notification of a new device being connected.

    You can check the status of the USB connections by opening Device Manager located in the Control Panel menu of most Windows Operating systems and expanding the driver information as shown below in this Windows 10 example:

    This indicates that the operating system recognizes the connected instrument as a test instrument.

    If the device manager reports the USB connection as some other type of device (printer, camera, unknown, etc.), there is likely a problem linking the proper driver (ausbtmc.sys) to the instrument. One possible solution to this is to disable the driver, disconnect the USB cable, verify that ausbtmc.sys exists, and then reconnect the USB cable.

    2. Run NI-MAX by left-clicking on the icon on the desktop or finding it via the start menu

    3. This will open the main window, as shown below:

    4. Expand the “Devices and Interfaces” menu. You should see the instruments attached via USB with a brief description as shown for an SDS2000X oscilloscope below:

    This indicates that a software application (NI-MAX) has correctly identified a test and measurement device (the oscilloscope) over the USB connection.

    5. By left-clicking on the instrument, you can see additional information about it:

    6. To further test the connection, right-click on the instrument and select Open VISA Test Panel or select it from the side bar:

    The VISA Test Panel window shows some helpful information, including the instrument manufacturer, model, serial number, and the USB identifier (VISA Address) along the top.

    7. Another useful item in the VISA Test Panel is the Input/Output function. This mode allows you to send specific instrument commands and receive instrument responses.

    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.

    Select Input/Output > Basic I/O > and Enter the command in the text window:

    – *IDN? is a common identification string query (question or information request) that returns the information from the connected instrument
    – /n is a termination character that represents a new line. This is the standard termination character for SIGLENT instrumentation.
    – Write will send the command to the instrument
    – Read will pull data from the instrument
    – Query will perform a read and then a write command to request and return data from the instrument

    USB Checklist

    – Is the USB port configured properly on the instrument? Some instruments feature USB ports that can be configured as TMC (Test and Measurement) or Printer communication ports. The USB port should be set to USBTMC or similar for remote control.
    – Try a direct connection to the controlling computer. USB hubs or long connections may cause issues.
    – Try a different USB cable. Connectors can go bad or prove to be faulty.
    – Try a different USB port on the computer.
    – On machines running Windows, check the Device Manager. Test instrumentation should appear as USB Test and Measurement Device (IVI) and use the AUSBTMC.SYS driver

    Lan Connections

    1. Power on and connect the instrument via LAN cable to a LAN network connected to the computer you wish to use.

    You can check the status of the LAN connection by using a software tool like NMAP: https://nmap.org/

    NMAP allows you to scan networks and identify IP addresses.

    First, identify the LAN connection for the instrument. This is typically located in the System menu under IO or LAN settings.

    Here is the IO information for an SDS2000X oscilloscope:

    DHCP Enabled will automatically configure the instrument connection settings and apply a valid IP address. With DHCP enabled, the IP address may change over time. It is recommended to check the instrument IP address and then confirm that it is visible on the network using NMAP:

    Here, we are performing a Ping (short scan to identify what IP addresses are being used) over the range of IP addresses that may match the instrument.

    This can be performed by setting the target using the “/24” extension. This scans 24 bits For example, 192.168.10.0/24 would scan the 256 hosts between
    192.168.10.0 and 192.168.10.255

    Here is more information from NMAP:
    https://nmap.org/book/man-target-specification.html

    For example, to ping all IP addresses that start with 192.168.0., set the target as follows:

    Note the IP address and MAC address that identify your instrument.

    2. Run NI-MAX by left-clicking on the icon on the desktop or finding it via the start menu

    This will open the main window, as shown below:

    3. Unlike USB, there is not an easy way to identify all of the instruments connected via LAN.

    In many cases, you will have to manually add the LAN instrumentation. Recall from Step 2, our instrument IP address is 192.168.0.87

    Right-click on Network Devices, and select Create New VISA TCP/IP Resource:

    4. Select Manual Entry of LAN:

    5. Enter the IP address and press Validate

    6. After successfully creating a TCP/IP connection, select finish

    7. After the system updates it’s configuration, the instrument will appear in the Network Devices menu:

    8. To further test the connection, right-click on the instrument and select Open VISA Test Panel or select it from the side bar:

    The VISA Test Panel window shows some helpful information, including the TCP/IP identifier (VISA Address) along the top.

    9. Another useful item in the VISA Test Panel is the Input/Output function. This mode allows you to send specific instrument commands and receive instrument responses.

    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.

    Select Input/Output > Basic I/O > and Enter the command in the text window:

    – *IDN? is a common identification string query (question or information request) that returns the information from the connected instrument
    – /n is a termination character that represents a new line. This is the standard termination character for SIGLENT instrumentation.
    – Write will send the command to the instrument
    – Read will pull data from the instrument
    – Query will perform a read and then a write command to request and return data from the instrument