No part of this manual may be reproduced
in any form or by any means (including
electronic storage and retrieval or
translation into a foreign language) without
prior agreement and written consent from
Agilent Technologies, Inc. as governed by
United States and international copyright
laws.
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.
1Getting Started
Prepare for the remote control.
2Programming Fundamentals
A quick overview of the SCPI programming.
3Status Registers
Introduction of the status registers.
4Programming Example
How to accomplish the basic applications in programming.
5Command 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
1Getting Started1
Remotely Operating the Analyzer2
Computer Requirement for Remote Operation2
Connecting the Analyzer via the USB Port3
Connecting the Analyzer via the LAN Port6
2Programming Fundamentals9
Overview10
Command Categories12
Command Syntax13
Creating Valid Commands15
Program and Response Messages16
Parameters in Commands17
3Status Registers 19
Overview20
Programmer’s Guide
How to use the Status Registers23
Status Register System25
4Programming Example31
Overview32
Programming in C using the VTL33
Checking the USB Connection39
Using C with Marker Peak Search and Peak Excursion40
Using Marker Delta Mode and Marker Minimum Search44
Contents
5Command Reference49
IEEE Common Commands50
System Subsystem54
Memory Subsystem66
Instrument Subsystem70
Sense Subsystem72
Frequency Subsection72
Amplitude Subsection76
Bandwidth Subsection81
Trac e S u bs e ct i on83
Detector Subsection85
Average Subsection86
Sweep Subsection87
Display Subsection90
Calculate Subsystem91
Limit Line Subsection91
Marker Subsection95
Initiate Subsystem102
Trig ger Sub sy s te m104
Power Measurement Subsystem108
ACPR Subsection108
CHP Subsection111
OBW Subsection115
SEM Subsection117
Spectrum Monitor Option Subsystem127
Cable and Antenna Test Option Subsystem134
Channel Scanner Option Subsystem148
Demodulation Option Subsystem165
Programmer’s Guide
AM Demodulation Subsection168
FM Demodulation Subsection175
ASK Demodulation Subsection182
FSK Demodulation Subsection191
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
1Getting 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
2Programmer’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:
1Install Agilent IO libraries suite on your PC
2Switch on the analyzer
3Connect the analyzer to a PC with a USB cable.
Getting Started1
Programmer’s Guide3
1Getting Started
4After 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.
5Select Display a list...
4Programmer’s Guide
Getting Started1
7PC 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 Guide5
1Getting 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:
1Switch on the analyzer.
2Connect the spectrum analyzer to a PC with a LAN cable.
3Press [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
4Run 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.
5Select “Add Address”, check “Use IP Address” in the window and input
the IP address as the instrument IP address you set before.
6Programmer’s Guide
Getting Started1
6Press “Test Connection” to check the LAN connection. The figure
below indicates that the connection is ready.
7Check “*IDN query” and press “Identify Instrument”. The instrument
information shows the firmware revision and product number. The
analyzer is ready for your further programming.
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
2Programming 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.
10Programmer’s Guide
Common Terms used in this Book
Programming Fundamentals2
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 Guide11
2Programming 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.
12Programmer’s Guide
Command Syntax
Programming Fundamentals2
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 Guide13
2Programming 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.
14Programmer’s Guide
:TRIGG is neither the long, nor the short form of the
Creating Valid Commands
Command SyntaxSample Valid Commands
Programming Fundamentals2
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
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 Guide15
2Programming 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.
16Programmer’s Guide
:FREQuency:CENTer:STEP:AUTO ONor
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 Fundamentals2
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 Guide17
2Programming 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.
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
3Status 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
20Programmer’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 Registers3
Event RegisterIt 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 Guide21
3Status 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.
22Programmer’s Guide
Loading...
+ 194 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.