Page 1
EXA Signal Analyzer N9010A CXA Signal Analyzer N9000A MXE EMI Receiver N9038A Notice: This document contains references to Agilent. Please note that Agilent’s Test and Measurement business has become Keysight Technologies. For more information, go to www.keysight.com X-Series Programmers’ Guide...
WARNING of any information contained herein. A WARNING notice denotes a hazard. Should Keysight and the user have a It calls attention to an operating separate written agreement with procedure, practice, or the like that, if...
Page 3
To receive the latest updates by email, subscribe to Keysight Email Updates at the following URL: http://www.keysight.com/find/emailupdates Information on preventing instrument damage can be found at: http://www.keysight.com/find/tips Is your product software up-to-date? Periodically, Keysight releases software updates to fix known defects and incorporate product enhancements. To search for software updates for your product, go to the Keysight Technical Support website at: http://www.keysight.com/find/techsupport...
Simple SCPI Communication Methods Communicating SCPI Using Telnet Determining Instrument IP Address Enabling Telnet in Windows Communicating SCPI using Keysight Connection Expert Techniques for Improving Measurement Performance Turn off Display Updates Use Binary Data Format instead of ASCII Minimize the Number of Bus Transactions...
Phase Noise Trace Math C#.NET & Visual Studio 2010 Retrieve Screen Images Poll Method for Operation Complete SRQ Method for Operation Complete Phase Noise Trace Math Keysight VEE Pro Retrieve Screen Images Retrieve Trace Data LabVIEW Screen Capture MATLAB Upload a File...
Page 7
X-Series Programmers Guide Contents Appendix A References Documents & Web Sites Developer Resources Developer Network Technical Support...
• “Interchangeable Virtual Instruments (IVI-COM, IVI-C) Drivers” on page 11 • “VISA Driver Options” on page 12 • “Keysight VEE Pro” on page 13 • “Programming Documentation Roadmap” on page 14 The second chapter, “SCPI Programming Fundamentals” on page 15, provides an introduction to Standard Commands for Programmable Instruments (SCPI), which is the most popular and versatile protocol for programming X-Series instruments.
For more details, see “VISA Driver Options” on page Acquisition & Licensing Free download from Keysight web site. Requires separate ADE? Yes, but depending on your program development requirements, you may be able to use a free download such as one of the Microsoft Visual Studio Express editions.
Introduction to Programming X-Series Applications Hardware Connection Formats Figure 1-1 X-Series Software Driver Hierarchy Hard ware Connection Formats X-Series instruments support the following hardware connection standards (represented by the "Network Layer" in Figure above): Standard Instrument Connection Type GPIB GPIB devices and interfaces TCPIP LAN and HiSLIP instruments USB instruments...
I/O libraries (SICL, VISA, and VISA COM) enable instrument communication for a variety of development environments (Keysight VEE Pro, Microsoft Visual Studio, etc.) that are compatible with GPIB, USB, LAN, RS-232, PXI, AXIe, and VXI test instruments from a variety of manufacturers.
Keysight VEE Pro can communicate with any instrument from any vendor, using GPIB, LAN, USB, RS-232, VXI or LXI. For further details, see the web page for Keysight VEE Pro.
Notes Keysight I/O Libraries Suite The download package includes documentation describing the Keysight Virtual Instrument Software Architecture (VISA) library, and showing how to use it to develop I/O applications and instrument drivers on Windows PCs. Not included on X-Series Documentation DVD.
X-Series Programmers Guide SCPI Programming Fundamentals SCPI Programming Fundamentals This chapter provides overall information on programming X-Series instruments using Standard Commands for Programmable Instruments (SCPI). Sections include: • “SCPI Language Basics” on page 16 • “Where to find X-Series SCPI Command Definitions” on page 23 •...
SCPI Programming Fundamentals SCPI Language Basics SCPI Language Basics This section provides a basic introduction to the SCPI language. For more details about SCPI, see IEEE Standard 488.2–1992. Topics covered in this section include: • “Command Keywords, Separators and Syntax” on page 16 •...
SCPI Programming Fundamentals SCPI Language Basics Creating Valid Commands Commands are not case-sensitive, and there are often many different ways of writing a particular command. These are examples of valid commands for a given command syntax: Command Syntax Sample Valid Commands The following sample commands are all identical.
Page 18
SCPI Programming Fundamentals SCPI Language Basics Special Character Meaning Example < > Angle brackets around a word, or words, indicates Command: SENS:FREQ <freq> they are not to be used literally in the command. They In this command example the word <freq> should be replaced by an represent the needed item.
SCPI Programming Fundamentals SCPI Language Basics Parameters in Commands There are four basic types of parameters: booleans, keywords, variables and arbitrary block program data. Type Description OFF|ON|0|1 This is a two state boolean-type parameter. The numeric value 0 is equivalent to OFF. Any numeric value other than 0 is equivalent to ON.
Page 20
SCPI Programming Fundamentals SCPI Language Basics Type Description <string> A series of alpha numeric characters. <bit_pattern> Specifies a series of bits rather than a numeric value. The bit series is the binary representation of a numeric value. There are no units. Bit patterns are most often specified as hexadecimal numbers, though octal, binary or decimal numbers may also be used.
SCPI Programming Fundamentals SCPI Language Basics Block Program Data Some parameters consist of a block of data. There are a few standard types of block data. Arbitrary blocks of program data can also be used. Type Description <trace> An array of rational numbers corresponding to displayed trace data. See the description of the FORMat:DATA command in the "Programming the Analyzer"...
Page 22
SCPI Programming Fundamentals SCPI Language Basics [:SENSe]:FREQuency:STARt:POWer[:RF]:MIXer:RANGe[:UPPer] Table 2-1 Examples of Valid and Invalid SCPI Commands Problem Invalid Command Valid Command The short form of POWER is POW, not PWR. PWR:ATT 40dB POW:ATT 40dB The MIX:RANG command is in the same :SENSE subsystem as FREQ, but executing the FREQ command puts you back at the SENSE FREQ:STAR 30MHz;MIX:RANG -20dBm level.
Reference Manuals \files. You can also download all Users & Programmers Reference manuals from the Keysight web site, by using the hyperlinks in the Additional Documentation section of the instrument’s Embedded Help. In the Users & Programmers References, SCPI command descriptions are organized by front-panel functionality, but you can also find a specific command by looking for it in the common or measurement-specific "List of SCPI...
SCPI Programming Fundamentals Where to find X-Series SCPI Command Definitions “Help Topic Content” on page 24 “List of SCPI Commands” on page 25 Help Topic Content A typical Help topic is shown in Figure 2-2. Each Help topic includes: • A description of the current active function or key, •...
SCPI Programming Fundamentals Where to find X-Series SCPI Command Definitions List of SCPI Commands The List of SCPI Commands is an alphabetically sorted list of all commands in the current measurement application. Each item shown is a hyperlink to the specific Help Topic that contains the command or query. See Figure 2-3 for an example of a List of SCPI Commands.
• “Communicating SCPI Using Telnet” on page 26 • “Communicating SCPI using Keysight Connection Expert” on page 28 Communicating SCPI Using Telnet You can communicate SCPI using a Telnet connection from a computer to the instrument. The following procedure describes how to connect a computer running Microsoft Windows to the instrument.
Command Window and ping Command results Determining Instrument IP Address 1. If necessary, close the Keysight Signal Analyzer application, by selecting File > Exit from the front panel and softkey menu, then confirming that you want to close the application.
In the listbox, locate Telnet client and check its checkbox. Click OK. Communicating SCPI using Keysight Connection Expert You can use Keysight Connection Expert to communicate with devices on any supported network type. Keysight Connection Expert is installed as part of the Keysight I/O Libraries Suite.
Page 29
Figure 2-8 Tasks for This Instrument If you click the item "Send commands to this instrument", the Keysight Interactive IO dialog appears as shown in Figure below, which allows you to send SCPI commands to the instrument and read the responses.
Page 30
Simple SCPI Communication Methods Figure 2-9 Keysight Interactive IO For full details of how to use these features, open the Keysight Connection Expert main screen (as shown in Figure 2-7) and select Help > Connection Expert Help from the menu.
SCPI Programming Fundamentals Techniques for Improving Measurement Performance Techniques for Improving Measurement Performance This section describes several programming techniques that can improve speed and efficiency. Most, but not all, of these techniques relate to SCPI program design. • “Turn off Display Updates” on page 31 •...
SCPI Programming Fundamentals Techniques for Improving Measurement Performance • When doing bottom/middle/top measurements on Base Stations, you can reduce transactions by making a time slot active at each of the B,M,T frequencies. Then, issue three measurements at once in the programming code and retrieve three data sets with just one bus transaction pair (write, read).
SCPI Programming Fundamentals Techniques for Improving Measurement Performance RFBurst triggering depends on its establishment of a valid triggering reference level, based on previous bursts. If you only have a single burst, the peak detection nature of this triggering function, may result in the trigger being done at the wrong level/point generating incorrect data, or it may not trigger at all.
This reduces the amount of data that must be transferred. Initiate measurement and acquire data :INIT Retrieve the desired data :CALC:DATA2:COMP? MEAN,25us,526us,579.6us,8 More Hints & Tips For more information about optimizing measurement speed using X-Series instruments, see Keysight Application Note 1583.
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\include Programming in C or C++ with VISA Full details of X-Series programming in C and C++ are provided in the Keysight I/O Libraries Suite. Location of Header Files & Libraries The header file visa.h can be found in: C:\Program Files (x86)\IVI Foundation\VISA\WinNT\include Programs must link to the VISA libraries visa32.lib or agvisa32.lib, located in subfolders of:...
VISA C Library (visa32.dll or visa64.dll). For programmers accustomed to the VISA-C API, or those not familiar with COM, use of Keysight’s .NET header files may offer a preferable approach, because it avoids the overhead of the VISA COM implementation and exposes VISA functionality in a more familiar style.
Microsoft Windows' DLL search rules. If you developed your program using Keysight VISA, and you wish to ensure that your program uses Keysight VISA even if other VISA implementations are on your deployed systems, you can change the DLL name in all of the method declarations in visa32.cs or visa32.vb from "visa32.DLL"...
Page 38
Developing and Deploying VISA Projects Requirements for Deploying a VISA Project...
You can browse to this directory by opening the Keysight Connection Expert and selecting Help > Programming Samples from the menu, (The Keysight I/O Libraries Suite samples are not described in this document, and are in general not specific to X-Series instruments.)
• Visual Basic 6 • C, C++ • C#.NET & Visual Studio 2010 • Keysight VEE Pro • LabVIEW • MATLAB NOTE These samples have all been tested and validated as functional in the Spectrum Analyzer mode. They have not necessarily been tested in other modes. However, they should work in all other modes, except where exceptions are noted.
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Visual Basic 6 NOTE In some cases, Visual Basic 6 files with the extension .bas have been renamed with the extension .bas.txt, to avoid possible instrument security warnings generated by the .bas extension.
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Retrieve Screen Images Function Transfer Screen Images from the instrument Description This example demonstrates how to: Store the current screen image in instrument memory as “D:\PICTURE.PNG” Transfer the memory image file via GPIB or LAN Store the transferred image in the computer’s current directory as “C:\PICTURE.PNG”...
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Poll Method for Operation Complete Function Serial Poll for Sweep Complete Description This example demonstrates how to: Modify the timeout value Initiate a sweep Poll the instrument to determine when the operation is complete Query and report the sweep result Language File name...
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Description This example demonstrates how to: Set various types of trace (Max Hold, Clear Write, Min Hold) Relate markers to specified traces Couple markers NOTE The instrument supports multiple simultaneous detectors (for example, peak detector for max hold, sample for clear and write, and negative peak for min hold).
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Retrieve Screen Images Function Capture and transfer Screen Images from the instrument Description This example demonstrates how to: Store the current screen image as a PNG file on the instrument’s D: drive, with a user-specified name Retrieve the screen image data from the instrument as a Program Data Block Analyze the header of the Program Data Block and extract the PNG bitmap from the block Store the extracted bitmap as a PNG file in the computer’s current directory, with the same user-specified name...
Calculate the power difference between Trace 1 and Trace 2, then save the result as Trace 3 Retrieve Trace 3 data from the instrument as a binary data block Optionally, save the retrieved trace data in an on-disk text file Language Project Folder vs2010.net/x_phasenoise Keysight VEE Pro Retrieve Screen Images Retrieve Trace Data...
Store the current screen image in instrument memory as “D:\mxascr.PNG” Transfer the memory image file via GPIB Store the transferred image on the computer, in a user-specified directory, as “capture.gif” Delete the instrument memory file "D:\mxascr.PNG" Language Keysight VEE Pro File name mxa_screencapture.vee Retrieve Trace Data Function Transfer trace data from the instrument.
Program Samples N9060A Spectrum Analyzer Mode Programing Samples Upload a File Function Upload a state file to the instrument Description The program opens a state file on the computer’s hard disk, transfers it to the instrument via LAN, then stores the file on the instrument’s D: drive.
• “Digital Demod Measurement” on page 49 Each sample is implemented for three development environments, programming languages and driver technologies: • Keysight VEE Pro, • Visual Basic 6 with VISA COM, • Visual Studio 2003 / VB.NET with VISA COM The VEE samples consist of a single file each, whereas the Visual Basic 6 and Visual Studio 2003 samples consist of project file sets in specified subfolders.
Page 50
Program Samples N9064A VXA Vector Signal Analyzer Programming Samples Description This example program: Creates a ResourceManager object (except in VEE example) Creates a FormattedIO488 interface object (except in VEE example) Sets VXA Mode Sets Digital Demod Measurement Configures the measurement Initiates the measurement Sets REAL,32 format, then reads Demodulated Bits Reads Error Vector Time (VEE example only)
Keysight I/O Libraries Suite Keysight Technologies Inc. All Keysight VISA, VISA COM, SICL and 488 documentation is included in HTML Help (CHM) format in the Keysight I/O Libraries Suite installer, which may be downloaded from: www.keysight.com/find/iosuite After installing the libraries suite, you can access the help by clicking the IO taskbar icon, then selecting Documentation > API...
"Maximizing Measurement Speed with Keysight’s X-Series Signal Analyzers" May be downloaded in Acrobat (PDF) format from: http://literature.cdn.keysight.com/litweb/pdf/5989-4947EN.pdf Keysight Application Note 1595 "How to Use IVI-COM Drivers in Keysight VEE Pro 8.0" May be downloaded in Acrobat (PDF) format from: http://literature.cdn.keysight.com/litweb/pdf/5989-6914EN.pdf Keysight VEE Pro For links to all available information, see: www.keysight.com/find/vee...
Need help?
Do you have a question about the N9000A and is the answer not in the manual?
Questions and answers