Agilent technologies N9344C, N9343C, N9342C User Manual

Agilent N9342C/43C/44C Handheld Spectrum Analyzer

Programmer’s Guide

Notices
CAUTION
WARNING
© Agilent Technologies, Inc. 2012
Part Number
N9342-90066
Edition
Third Edition, October. 2012
Agilent Technologies, Inc. No. 116 Tuo Xin West 1st Street Hi-Tech Industrial Zone (South) Chengdu 610041, China
Software Revision
This guide is valid for Version A.04.20 or later of the N9342C/43C/44C handheld spectrum analyzer firmware.
Warranty
The material contained in this document is provided “as is,” and is subject to being changed, without notice, in future editions. Further, to the maximum extent permitted by applicable law, Agilent disclaims all warranties, either express or implied, with regard to this manual and any information contained herein, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Agilent shall not be liable for errors or for incidental or consequential damages in connection with the furnishing, use, or performance of this document or of any information contained herein. Should Agilent and the user have a separate written agreement with warranty terms covering the material in this document that conflict with these terms, the warranty terms in the separate agreement shall control.
Restricted Rights Legend
U.S. Government Restricted Rights. Software and technical data rights granted to the federal government include only those rights customarily provided to end user customers. Agilent provides this customary commercial license in Software and technical data pursuant to FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for the Department of Defense, DFARS 252.227-7015 (Technical Data - Commercial Items) and DFARS
227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation).
Technology Licenses
The hardware and/or software described in this document are furnished under a license and may be used or copied only in accordance with the terms of such license.
Safety Notices
A CAUTION notice denotes a hazard. It calls attention to an operating procedure, practice, or the like that, if not correctly performed or adhered to, could result in damage to the product or loss of important data. Do not proceed beyond a CAUTION notice until the indicated conditions are fully understood and met.
A WARNING notice denotes a hazard. It calls attention to an operating procedure, practice, or the like that, if not correctly performed or adhered to, could result in personal injury or death. Do not proceed beyond a WARNING notice until the indicated conditions are fully understood and met.
In This Guide…
This guide contains programming information for the N9342C/43C/44C Handheld Spectrum Analyzer.
1 Getting Started
Prepare for the remote control.
2 Programming Fundamentals
A quick overview of the SCPI programming.
3 Status Registers
Introduction of the status registers.
4 Programming Example
How to accomplish the basic applications in programming.
5 Command Reference
Describe every programming command ant the related softkeys’ functions in detail.
For more information about the HSA handheld spectrum analyzer, please refer to:
Programmer’s Guide
N9342C handheld spectrum analyzer:
www.agilent.com/find/n9342c
N9343C handheld spectrum analyzer:
www.agilent.com/find/n9343c
N9344C handheld spectrum analyzer:
www.agilent.com/find/n9344c
Programmer’s Guide

Contents

1 Getting Started 1
Remotely Operating the Analyzer 2
Computer Requirement for Remote Operation 2 Connecting the Analyzer via the USB Port 3 Connecting the Analyzer via the LAN Port 6
2 Programming Fundamentals 9
Overview 10
Command Categories 12
Command Syntax 13
Creating Valid Commands 15
Program and Response Messages 16
Parameters in Commands 17
3Status Registers 19
Overview 20
Programmer’s Guide
How to use the Status Registers 23
Status Register System 25
4 Programming Example 31
Overview 32
Programming in C using the VTL 33
Checking the USB Connection 39
Using C with Marker Peak Search and Peak Excursion 40
Using Marker Delta Mode and Marker Minimum Search 44
Contents
5 Command Reference 49
IEEE Common Commands 50
System Subsystem 54
Memory Subsystem 66
Instrument Subsystem 70
Sense Subsystem 72
Frequency Subsection 72 Amplitude Subsection 76 Bandwidth Subsection 81 Trac e S u bs e ct i on 83 Detector Subsection 85 Average Subsection 86 Sweep Subsection 87 Display Subsection 90
Calculate Subsystem 91
Limit Line Subsection 91 Marker Subsection 95
Initiate Subsystem 102
Trig ger Sub sy s te m 104
Power Measurement Subsystem 108
ACPR Subsection 108 CHP Subsection 111 OBW Subsection 115 SEM Subsection 117
Spectrum Monitor Option Subsystem 127
Cable and Antenna Test Option Subsystem 134
Channel Scanner Option Subsystem 148
Demodulation Option Subsystem 165
Programmer’s Guide
AM Demodulation Subsection 168 FM Demodulation Subsection 175 ASK Demodulation Subsection 182 FSK Demodulation Subsection 191
Power Meter Option Subsystem 201
Tracking Generator Option Subsystem 214
Contents
Programmer’s Guide
Contents
Programmer’s Guide
Agilent N9342C/43C/44C Handheld Spectrum Analyzer Programmer’s Guide
1 Getting Started
The purpose of this chapter is to serve as a reminder of SCPI (Standard Commands for Programmable Instruments) fundamentals to those who have previous experience in programming SCPI. This chapter is not intended to teach you everything about the SCPI programming language. If you are using an optional programming compatibility modes, you should refer to the manual that came with the option.
1
1 Getting Started

Remotely Operating the Analyzer

The analyzer provides both the USB and LAN connection which allows you to set up a remote operation environment with a controller computer. A controller computer could be a personal computer (PC), a minicomputer. Some intelligent instruments also function as controllers.
Computer Requirement for Remote Operation
Usually, you need to prepare an compatible PC with the following requirements to set up a remote operation environment:
Processor: 450 MHz Pentium
Operating system: Microsoft
Service Pack 1 or later; Windows later
Available memory: 128 MB or higher required
Available disk space: 175 MB or greater required
® II or higher required
® Windows® XP or Home Editon,
® 2000 Professional, service pack 4 or
2 Programmer’s Guide
Connecting the Analyzer via the USB Port
Connecting instrument
Connecting PC
No extra driver is required to connect the analyzer via the USB port to a PC. All you need is the Agilent IO libraries suite and you can find this IO libraries suite in the documentation CD in the shipment along with your analyzer. Or download the IO libraries suite from Agilent website:
http://www.agilent.com/find/iolib
Refer to the following steps to finish the connection:
1 Install Agilent IO libraries suite on your PC
2 Switch on the analyzer
3 Connect the analyzer to a PC with a USB cable.
Getting Started 1
Programmer’s Guide 3
1 Getting Started
4 After a while, the PC finds your analyzer as a new hardware and
prompts a message saying “Found new hardware...”. A Found New Hardware Wizard is initiated immediately.
5 Select Display a list...
4 Programmer’s Guide
Getting Started 1
7 PC will detect the instrument automatically. The item “USB Test and
Measurement Device” displays in the pop-up window. Select it and
press Next.
The wizard will guide you through the rest of installation till the driver is installed. Run Agilent IO libraries suite, the analyzer will be detected automatically.
Programmer’s Guide 5
1 Getting Started
Connecting the Analyzer via the LAN Port
No extra driver is required to connect the analyzer via the LAN port to a PC. All you need is the Agilent IO libraries suite in the Product CD Help Kit. Or refer to the link below to download the IO libraries suite:
http://www.agilent.com/find/iolib
Please refer to the following steps to finish the connection:
1 Switch on the analyzer.
2 Connect the spectrum analyzer to a PC with a LAN cable.
3 Press [SYS] > {Setting} > {IP Admin} > {IP address} to set IP address
for the instrument. For example, set “10.0.0.5” as the IP address for the instrument. Press {Apply} as
4 Run Agilent Connection Expert in IO libraries suite. Right-click on the
LAN (TCPIP0) icon, select “Add Instrument’ in the pop-up menu. The “Add LAN Instruments” window displays for the IP configuration.
5 Select “Add Address”, check “Use IP Address” in the window and input
the IP address as the instrument IP address you set before.
6 Programmer’s Guide
Getting Started 1
6 Press “Test Connection” to check the LAN connection. The figure
below indicates that the connection is ready.
7 Check “*IDN query” and press “Identify Instrument”. The instrument
information shows the firmware revision and product number. The analyzer is ready for your further programming.
Programmer’s Guide 7
1 Getting Started
8 Programmer’s Guide
Agilent N9342C/43C/44C Handheld Spectrum Analyzer Programmer’s Guide
2 Programming Fundamentals
Overview 10
Command Categories 12
Command Syntax 13
Creating Valid Commands 15
Program and Response Messages 16
Parameters in Commands 17
The purpose of this chapter is to serve as a reminder of SCPI (Standard Commands for Programmable Instruments) fundamentals to those who have previous experience in programming SCPI. This chapter is not intended to teach you everything about the SCPI programming language. If you are using an optional programming compatibility modes, you should refer to the manual that came with the option.
9
2 Programming Fundamentals

Overview

SCPI Language Basics
This section is not intended to teach you everything about the SCPI (Standard Commands for Programmable Instruments) programming language. The SCPI Consortium or IEEE provides that level of detailed information.
Programming with SCPI requires knowledge of:
Computer programming languages, such as C, C++, and MicrosoftVisual Basic.
The language of your instrument. The analyzer employs SCPI as its programming language.
The semantic requirements of your controller’s language determine how the programming commands and responses are handled in your application program.
SCPI is an ASCII-based instrument command language designed for test and measurement instruments, with the goal of reducing automatic test equipment (ATE) program development time.
SCPI accomplishes this goal by providing a consistent programming environment for instrument control and data usage. This consistent programming environment is achieved by the use of defined program messages, instrument responses, and data formats across all SCPI instruments.
By providing a consistent programming environment, replacing one SCPI instrument with another SCPI instrument in a system will usually require less effort than with non-SCPI instrument.
SCPI is not a standard which completely provides for interchangeable instrumentation. SCPI helps move toward interchangeability by defining instrument commands and responses, but not functionality, accuracy, resolution, etc.
10 Programmer’s Guide
Common Terms used in this Book
Programming Fundamentals 2
Te rm s
Controller
Instrument
Command
Query
Description
Any computer used to communicate with an instrument. A controller can be a personal computer (PC), a minicomputer, or a plug-in card in a card cage. Some intelligent instruments can also function as controllers.
Any device that implements SCPI. Most instruments are electronic measurement or stimulus devices, but this is not a requirement. Similarly, most instruments use a GPIB or RS-232 or USB interface for communication. The same concepts apply regardless of the instrument function or the type of interface used.
An instruction. You combine commands to form messages that control instruments to complete a specified task. In general, a command consists of mnemonics (keywords), parameters and punctuation.
A special type of command. Queries instruct the instrument to make response data available to the controller. Query keywords always end with a question mark, ? .
The SCPI Consortium or IEEE can provide detailed information on the subject of SCPI programming. Refer to IEEE Standard 488.1-1987,
IEEE Standard Digital Interface for Programmable Instrumentation. New York, NY, 1987, or to IEEE Standard 488.2-1992, IEEE Standard Codes, Formats, Protocols and Common Commands for Use with ANSI/IEEE Std 488.1-1987. New York, NY, 1992.
Programmer’s Guide 11
2 Programming Fundamentals

Command Categories

The SCPI command falls into two categories:
Subsystem commands that simulate front panel keystrokes
Common commands that are unique and have no front panel
equivalent
Use a computer to control the instrument (but operate the power/standby switch manually). Computer programming procedures for the instrument involve selecting a programming statement and then adding the specified programming codes to that statement to achieve the desired operating conditions.
For more specific command instructions, please refer to Chapter 5, “Command Reference,” starting on page 49.
12 Programmer’s Guide

Command Syntax

Programming Fundamentals 2
A command consists of mnemonics (keywords), parameters and punctuation. Before you start to program your signal generator, familiarize yourself with the standard notation of each of them.
Command Mnemonics (keywords)
Punctuation A vertical bar "|" dictates a choice of one element from a list. For example:
Separator A colon ":" seperates keywords of different levels. The colon before the
Many commands have both a long and a short form: use either one. (a combination of the two is not allowed). Consider the :FREQuency command for example:
Short form :FREQ
Long form :FREQUENCY
SCPI is not case sensitive, so fREquEncy is just as valid as FREQUENCY, but FREQ and FREQUENCY are the only valid forms of the FREQuency command.
In this documentation, upper case letters indicate the short form of the keyword. The lower case letters indicate the long form of the keyword.
<A>|<B> indicates that either A or B can be selected, but not both.
Square brackets "[ ]" indicates that the enclosed items are optional.
Angle brackets "< >" indicates a variable items to be entered to represent
user choices.
A question mark "?" after a subsystem command indicates that the command is a query. The returned information, <value> varies in format according to the type of the field.
root keyword is usually omitted.
A space separates a keyword and a parameter, as well as a parameter and a unit.
Programmer’s Guide 13
2 Programming Fundamentals
NOTE
Command Statement Rules Overview
Command Example
Besides the standard notation of SCPI described above, please remember the following rules in programming:
command statements read from left to right
use either long form or short form of keywords, but do not use both
no separating space between the keywords, only use a colon to
separate keywords of different levels
always separating a keyword from a variable with a space
always separating a variable from its unit with a space (if variable has a unit).
A typical command is made up of key words set off by colons. The key words are followed by parameters that can be followed by optional units.
Example 1 :TRIGger:SEQuence:VIDeo:LEVel 2.5V
The instrument does not distinguish between upper and lower case letters. In the documentation, upper case letters indicate the short form of the key word. The upper and lower case letters, together, indicate the long form of the key word. Either form may be used in the command.
Example 2 :Trig:Seq:Vid:Lev 2.5V is the same as
:trigger:sequence:video:level 2.5V.
The command :TRIGG:Sequence:Video:Level 2.5V is not valid because command.
14 Programmer’s Guide
:TRIGG is neither the long, nor the short form of the

Creating Valid Commands

Command Syntax Sample Valid Commands
Programming Fundamentals 2
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:
[:SENSe]:BANDwidth[:RESolution]<freq>
:CALCulate:MARKer[1]|2|3|4:Y? The last command below returns different results than
[:SENSe]:DETector[:FUNCtion] NEGative|POSitive|SAMPle
:INITiate:CONTinuous OFF|ON|0|1 The sample commands below are identical.
The following sample commands are all identical. They will all cause the same result.
:Sense:Band:Res 1700 :BANDWIDTH:RESOLUTION 1.7e3 :sens:band 1.7KHZ :SENS:band 1.7E3Hz :band 1.7kHz :bandwidth:RES 1.7e3Hz
the commands above it. The number 3 in the command causes this. See the command description for more information.
:CALC:MARK:Y? :calc:mark:y? :CALC:MARK2:Y?
DET:FUNC NEG :Sense:Detector:Function Sample
:INIT:CONT ON :init:continuous 1
Programmer’s Guide 15
2 Programming Fundamentals

Program and Response Messages

To understand how your instrument and controller communicate using SCPI, you must understand the concepts of program and response messages.
Program Messages
Program messages are the formatted data sent from the controller to the instrument. Conversely, response messages are formatted data sent from the instrument to the controller. Program messages contain one or more commands, and response messages contain one or more responses.
Response Messages
The controller may send commands at any time, but the instrument sends responses only when query commands is received. All query mnemonics end with a question mark. Queries return either measured values or internal instrument settings.
Forgiving Listening and Precise Talking
SCPI uses the concept of forgiving listening and precise talking outlined in IEEE 488.2.
Forgiving listening means that instruments are very flexible in accepting various command and parameter formats. For example, the spectrum analyzer accepts either
:FREQuency:CENTer:STEP:AUTO 1
Precise talking means that the response format for a particular query is always the same. For example, if you query RF output state when it is on (using is always 1, regardless of if you previously sent
:FREQuency:CENTer:STEP:AUTO?), the response
:FREQuency:CENTer:STEP:AUTO ON
:FREQuency:CENTer:STEP:AUTO 1.
16 Programmer’s Guide
:FREQuency:CENTer:STEP:AUTO ON or
or

Parameters in Commands

There are four basic types of parameters: boolean, key words, variables and arbitrary block program data.
Boolean
The expression OFF|ON|0|1 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. The numeric values of 0 or 1 are commonly used in the command instead of OFF or ON, and queries of the parameter always return a numeric value of 0 or 1.
Key Word
The parameter key words that are allowed for a particular command are defined in the command description and are separated with a vertical slash.
Programming Fundamentals 2
Units
Numerical variables may include units. The valid units for a command depends on the variable type being used. See the following variable descriptions. If no units are sent, the indicated default units will be used. Units can follow the numerical value with, or without, a space.
Variable
A variable can be entered in exponential format as well as standard numeric format. The appropriate variable range and its optional units are defined in the command description.
Programmer’s Guide 17
2 Programming Fundamentals
Variable Parameters
<ampl>,
<rel_ampl>
<file_name> A file name parameter is the name of your file, is not used in the SCPI
<freq> A frequency parameter is a positive rational number followed by
<integer> There are no units associated with an integer parameter.
<number> A number parameter is a member of the set of positive or negative
<percent> A percent parameter is a rational number between 0 and 100, with no
<rel_power> A relative power parameter is a positive rational number followed by
<string> A string parameter includes a series of alpha numeric characters.
<time> A time parameter is a rational number followed by optional units. The
The <ampl> (amplitude) parameter and the <rel_ampl> (relative amplitude) parameter consist of a rational number followed by optional units. Acceptable units for <ampl> include: V, mV, V, dBm, dBmV, dBuV, Watts, W. <rel_ampl> units are given in dB.
command string.
optional units. The default unit is Hz. Acceptable units include: Hz, kHz, MHz, GHz.
intriguers and including zero. Fractional numbers are included in the number parameter. There are no units associated with a number parameter.
units.
optional units. The default units are dB. Acceptable units are dB only.
default units are seconds. Acceptable units include: S, MS, US.
18 Programmer’s Guide
Agilent N9342C/43C/44C Handheld Spectrum Analyzer Programmer’s Guide
3 Status Registers
Overview 20
How to use the Status Registers 23
Status Register System 25
This chapter contains a comprehensive description of status registers explaining what status registers are and how to use them so you can use a program to monitor the instrument. Information about all of the bits of the status registers is also provided.
19
3 Status Registers

Overview

What are Status Registers
When you are programming the instrument you may need to monitor instrument status to check for error conditions or monitor changes. You need to determine the state of certain instrument events/conditions by programming the status register system.
IEEE common commands (those beginning with *) access the higher-level summary registers. To access the information from specific registers you would use the STATus commands. The STATus subsystem remote commands set and query the status hardware registers. This system of registers monitors various events and conditions in the instrument. Software written to control the instrument may need to monitor some of these events and conditions.
The status system contains multiple registers that are arranged in a hierarchical order. The lower-level status registers propagate their data to the higher-level registers in the data structures by means of summary bits. The status byte register is at the top of the hierarchy and contains general status information for the instrument’s events and conditions. All other individual registers are used to determine the specific events or conditions.
Each register set is made up of five registers:
Condition
Register
Positive
Tra ns it io n
Register
Negative
Tra ns it io n
Register
20 Programmer’s Guide
It reports the real-time state of the signals monitored by this register set. There is no latching or buffering for a condition register.
This filter register controls which signals will set a bit in the event register when the signal makes a low to high transition (when the condition bit changes from 0 to 1).
This filter register controls which signals will set a bit in the event register when the signal makes a high to low transition (when the condition bit changes from 1 to 0).
Status Registers 3
Event Register It latches any signal state changes, in the way specified by the filter
registers. Bits in the event register are never cleared by signal state changes. Event registers are cleared when read. They are also cleared by *CLS and by presetting the instrument.
Event Enable
Register
It controls which of the bits, being set in the event register, will be summarized as a single output for the register set. Summary bits are then used by the next higher register.
Access the status registers
There are two different methods to access the status registers:
Common Commands Accesses and Controls
Status Subsystem Commands
Programmer’s Guide 21
3 Status Registers
What are Status Register SCPI Commands
Most monitoring of the instrument conditions is done at the highest level using the IEEE common commands indicated below. Complete command descriptions are available in the IEEE commands section at the beginning of the language reference. Individual status registers can be set and queried using the commands in the STATus subsystem of the language reference.
*CLS (clear status) clears the status byte by emptying the error queue and clearing all the event registers.
*ESE, *ESE? (event status enable) sets and queries the bits in the enable register part of the standard event status register.
*ESR? (event status register) queries and clears the event register part of the standard event status register.
*SRE,*SRE? (service request enable) sets and queries the value of the service request enable register.
*STB? (status byte) queries the value of the status byte register without erasing its contents.
22 Programmer’s Guide
Loading...
+ 194 hidden pages