• General
    • Automated Measurements Overview
    • System Requirements
    • Measurement Modes and Default Settings
  • Bode Automation Interface
    • Documentation
    • Command Reference
    • Changelog
  • SCPI
    • Documentation
    • Command Reference
    • Error Handling
    • Changelog

    Show / Hide Table of Contents
    • SCPI Overview
    • Getting Connected
      • Start SCPI server
      • Setup Connection
      • Usage of NI I/O Trace to monitor the SCPI traffic
    • Command Syntax
      • Introduction to the SCPI language
      • Data Formats
      • Data Transmission Formats
      • Suffixes
    • Status & Error Handling
      • Status Register System
      • Error and Event System
      • Error Handling
    • The Trigger System & Data Sychronization
      • Trigger System
      • Select the correct trigger source for :TRIG:SING
      • Synchronization
    • Coding & Examples
      • Reading the query buffer
      • Read buffer size
      • SCPI Python examples
      • Error Handling
    • List of Abbreviations
    • SCPI Changelog

    Usage of NI I/O trace to monitor the SCPI traffic

    The NI I/O Trace is a communication tracing tool by National Instruments which is delivered along with e.g. NI MAX. It can be started out of NI MAX and used either in combination with NI MAX or to monitor any network trafic.

    Start NI I/O Trace out of NI Max

    In the NI Max main menu click on Tools -> NI I/O Trace

    Start NI I/O Trace 01

    Start capture in NI I/O Trace

    In the NI I/O Trace main menu click on Tools -> Start capture

    NI IO Trace start capture

    Try out NI I/O Trace using NI Max

    Send a request using NI Max and verify the corresponding tracing in NI I/O Trace

    NI IO Trace with NI Max

    Try out NI I/O Trace using a Python script with PyVisa

    Send a request using a Python script and verify the corresponding tracing in NI I/O Trace. See also the Phython SCPI examples

    Preconditions

    Before running the examples start the SCPI server, verify and adapt the IP-address and the port number in the python code. The connection to the SCPI server can be verified using NI MAX.

    The PyVISA package must be added to the used Python projects. The currently used version ist the 1.11.3.

    # use pyvisa or similar package
    import pyvisa # required library for Visa communication -- the PyVISA package must be added to the Python project
    
    # adapt IP address and SCPI port according to your needs
    SCPI_server_IP = '172.22.44.29'
    SCPI_Port = '5025'
    
    VISA_resource_name = 'TCPIP::' + SCPI_server_IP + '::' + SCPI_Port + '::SOCKET'
    
    print('Trying to connect to VISA resource: ' + VISA_resource_name)
    visaSession = pyvisa.ResourceManager().open_resource(VISA_resource_name)
    visaSession.read_termination = '\n'
    
    print('SCPI client connected to SCPI server: ' + visaSession.query("*IDN?"))
    

    NI_IO_Trace_pyVisa

    Back to top Generated by DocFX