The information contained in this document is subject to change without
notice.
Hewlett-Packard makes no warranty of any kind with regard to this
material, including but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. Hewlett-Packard
shall not be liable for errors contained herein or for incidental or
consequential damages in connection with the furnishing, performance,
or use of this material.
Key Conventions
This manual uses the following conventions:
FRONT PANEL KEY
analyzer (a “hardkey”).
: This indicates a “softkey”-- a key whose label is determined
by the instrument’s firmware, and is displayed on the right side of the
instrument’s screen next to the eight unlabeled keys.
: This represents a key physically located on the
Firmware Revision
This manual documents analyzers with firmware revisions E.06.00 and
above.
iiProgrammer’ s Guide
HP-IB Programming
This document is an introduction to programming your analyzer over the
Hewlett-Packard Interface Bus (HP-IB). Its purpose is to provide concise
information about the operation of the instrument under HP-IB control.
It provides some background information on the HP-IB and some short
programming examples to demonstrate the remote operation of the
analyzer.
Example programs can be run on the analyzer’s internal controller or on
an external controller. These programs can be found in the following
three locations:
• Example Programs Disk (included with the analyzer)— DOS Format :
part number 08714-10003.
A LIF version of the Example Programs Disk is available, but is not
shipped with your analyzer:
ExamplePrograms Disk – LIF Format HP part number 08714-10004.
Contact the nearest HP sales office for ordering information. A list of
HP sales and service offices can be found in the “Specifications”
chapter of the User’s Guide.
• Example Programs Guide (included with the analyzer): part number
08714-90016. (This document may not include all of the example
programs found on the disk or on the Web site.)
• Web site http://www.hp.com or http://www.agilent.com. Use the
search function to find Web pages related to 8712 example programs.
You should become familiar with the operation of your network analyzer
before controlling it over HP-IB. This document is not intended to teach
programming or to discuss HP-IB theory except at an introductory level.
Related information can be found in the following references:
• Information on making measurements with the analyzer is available
in the analyzer’s User’s Guide.
• Information on HP Instrument BASIC is available in the
HP Instrument BASIC User’s Handbook.
Programmer’s Guideiii
• Information on HP BASIC programming is available in the manual
set for the BASIC revision being used. For example: BASIC 7.0Programming Techniques and BASIC 7.0 Language Reference.
• Example programs are described in Example Programs Guide.
• Information on using the HP-IB is available in the TutorialDescription of the Hewlett-Packard Interface Bus (HP literature
no. 5021-1927).
• Information on using the analyzer to make automated measurements
is available in Automated Measurements User’s Guide Supplement.
• Information on using the analyzer with a Local Area Network (LAN)
is available in The LAN Interface User’s Guide.
Contact the nearest HP sales office for ordering information. A list of HP
sales and service offices can be found in the “Specifications” chapter of
the User’s Guide.
ivProgrammer’ s Guide
HP 8712ET/ES and HP 8714ET/ES
Network Analyzer
Documentation Map
The CDROM provides the contents of all of the documents
listed below.
The User’s Guide shows how to make measurements,
explains commonly-used features, and tells you how to get
the most performance from the analyzer.
The LAN Interface User’s Guide Supplement shows
how to use a local area network (LAN) for programming and
remote operation of the analyzer.
The Automating Measurements User’s GuideSupplement provides information on how to configure and
control test systems for automation of test processes.
The Programmer’s Guide provides programming
information including HP-IB and SCPI command
references, as well as short programming examples.
Programmer’s Guidev
The Example Programs Guide provides a tutorial
introduction using BASIC programming examples to
demonstrate the remote operation of the analyzer
.
The Service Guide provides the information needed to
adjust, troubleshoot, repair, and verify analyzer
conformance to published specifications.
The HP Instrument BASIC User’s Handbook describes
programming and interfacing techniques using
HP Instrument BASIC, and includes a language reference.
The HP Instrument BASIC User’s HandbookSupplement shows how to use HP Instrument BASIC to
program the analyzer.
The Option 100 Fault Location and Structural ReturnLoss Measurements User’s Guide Supplement provides
theory and measurement examples for making fault location
and SRL measurements. (Shipped only with Option 100
analyzers.)
The CATV Quick Start Guide provides abbreviated
instructions for testing the quality of coaxial cables.
(Shipped only with Option 100 analyzers.)
The Cellular Antenna Quick Start Guide provides
abbreviated instructions for verifying the performance of
cellular antenna systems. (Shipped only with Option 100
analyzers.)
HP-IB—the Hewlett-Packard Interface Bus—is a high-performance bus
that connects individual instruments and computers together to make
integrated test systems. The bus and its associated interface operations
are defined by the IEEE 488.1 standard. The IEEE 488.2 standard
defines the interface capabilities of instruments and controllers in a
measurement system, including some frequently used commands.
HP-IB cables provide the physical link between devices on the bus. There
are eight data lines on each cable that are used to send data from one
device to another. Devices that send data over these lines are called
Talkers. Listeners are devices that receive data over the same lines.
There are also five control lines on each cable that are used to manage
traffic on the data lines and to control other interface operations.
Controllers are devices that use these control lines to specify the talker
and listener in a data exchange. When an HP-IB system contains more
that one device with controller capabilities, only one of the devices is
allowed to control data exchanges at any given time. The device
currently controlling data exchanges is called the Active Controller.
Also, only one of the controller-capable devices can be designated as the
System Controller, the one device that can take control of the bus even
if it is not the active controller. The network analyzer can act as a talker,
listener, active controller or system controller at different times.
HP-IB addresses provide a way to identify devices on the bus. Each
device on the bus must have a unique address. The active controller uses
HP-IB addresses to specify which device talks and which device listens
during a data exchange. Device addresses are set on each device using
either a front-panel key sequence or a rear-panel switch.
To set the HP-IB address on the analyzer, use the softkeys located in the
SYSTEM OPTIONS
analyzer is 16.
1-2Programmer’ s Guide
menu. The factory default address for the
Introduction to HP-IB Programming
Softkey
Softkey
Softkey
Introduction to HP-IB Programming
NOTEThroughout this manual, the following conventions are used:
• Square brackets ([ ]) are used to enclose a keyword that is
optional or implied when programming the command; that is, the
instrument will process the command to have the same effect
whether the option node is omitted or not.
• Parameter types (< >) are distinguished by enclosing the type
name in angle brackets.
• A vertical bar (|) can be read as “or” and is used to separate
alternative parameter options.
• A is a labeled button on the instrument front panel.
• A is one of the eight unlabeled buttons along the right side
HARDKEY
of the instrument display. The function of each is indicated
next to the on the instrument display.
Programmer’s Guide1-3
Introduction to HP-IB Programming
Bus Structure
Bus Structure
Data Bus
The data bus consists of eight lines that are used to transfer data from
one device to another. Programming commands and data sent on these
lines are typically encoded in the ASCII format, although binary
encoding is often used to speed up the transfer of large arrays. Both
ASCII and binary data formats are available to the analyzer. In addition,
every byte transferred over HP-IB undergoes a handshake to ensure
valid data.
Handshake Lines
A three-line handshake scheme coordinates the transfer of data between
talkers and listeners. This technique forces data transfers to occur at the
speed of the slowest device, and ensures data integrity in multiple
listener transfers. With most computing controllers and instruments , the
handshake is performed automatically, which makes it transparent to
the programmer.
1-4Programmer’ s Guide
Introduction to HP-IB Programming
Return to Local
Bus Structure
Control Lines
The data bus also has five control lines that the controller uses both to
send bus commands and to address devices:
IFCInterface Clear. Only the system controller uses this
line. When this line is true (low), all devices (addressed
or not) are deselected, and go to an idle state.
ATNAttention. The active controller uses this line to define
whether the information on the data bus is a
command or is data. When this line is true (low), the
bus is in the command mode and the data lines carry
bus commands. When this line is false (high), the bus is
in the data mode and the data lines carry
device-dependent instructions or data.
SRQService Request. This line is set true (low) when a
device requests service: the active controller services
the requesting device. The analyzer can set the SRQ
line true (low) for a variety of reasons.
RENRemote Enable. Only the system controller uses this
line. When this line is set true (low), the bus is in the
remote mode and devices are addressed either to listen
or talk. When the bus is in remote mode and a device is
addressed, the device receives instructions from HP-IB
rather than from its front panel (pressing the
softkey returns the device to front
panel operation). When this line is set false (high), the
bus and all devices return to local operation.
EOIEnd or Identify. This line is used by a talker to indicate
the last data byte in a multiple byte transmission, or by
an active controller to initiate a parallel poll sequence.
The analyzer recognizes the EOI line as a terminator
and it sets the EOI line true (low) with the last byte of
a message output (data, markers, plots, prints, error
messages). The analyzer does not respond to parallel
poll.
Programmer’s Guide1-5
Introduction to HP-IB Programming
Sending Commands
Sending Commands
Commands are sent over the HP-IB via a controller's language system,
such as IBASIC, Quic kBASIC or C. The keywords used by a controller to
send HP-IB commands vary among systems. When determining the
correct keywords to use, keep in mind that there are two different kinds
of HP-IB commands:
• Bus management commands, which control the HP-IB interface.
• Device commands, which control analyzer functions.
Language systems usually deal differently with these two kinds of HP-IB
commands. For example, HP BASIC uses a unique keyword to send each
bus management command, but always uses the keyword OUTPUT to
send device commands.
The following example shows how to send a typical device command:
OUTPUT 716;"CALCULATE:MARKER:MAXIMUM"
This sends the command CALCULATE:MARKER:MAXIMUM to the HP-IB
device at address 716. If the device is an analyzer, the command
instructs the analyzer to set a marker to the maximum point on the data
trace.
1-6Programmer’ s Guide
Introduction to HP-IB Programming
HP-IB Requirements
Number of Interconnected Devices:
15 maximum
Interconnection Path/Maximum Cable Length:
20 meters maximum or 2 meters per device, whichever is less.
Message Transfer Scheme:
Byte serial/bit parallel asynchronous data transfer using a
3-line handshake system.
Data Rate:
Maximum of 1 megabyte per second over limited distances
with tri-state drivers. The actual data rate is the transfer rate
of the slowest device involved.
HP-IB Requirements
Address Capability:
Primary addresses: 31 talk, 31 listen. A maximum of 1 talker
and 14 listeners at one time.
Multiple Controller Capability:
In systems with more than one controller (like the analyzer
system), only one can be active at a time. The active controller
can pass control to another controller, but only the system
controller can assume unconditional control. Only one system
controller is allowed. The system controller is hard-wired to
assume bus control after a power failure.
Programmer’s Guide1-7
Introduction to HP-IB Programming
Interface Capabilities
Interface Capabilities
The analyzer has the following interface capabilities, defined by the
IEEE 488.1 standard:
1. only when an HP Instrument BASIC program is running
2. only when an HP Instrument BASIC program is not running
1-8Programmer’ s Guide
respond to SRQ
send IFC, receive control, pass control, pass control to self
2
send IF messages, receive control, pass control
Introduction to HP-IB Programming
System Controller
Talker Listener
HP-IB
Programming Fundamentals
Programming Fundamentals
This section includes specific information for programming your network
analyzer. It includes how the analyzer interacts with a controller, how
data is transferred between the analyzer and a controller , and how to use
the analyzer's status register structure to generate service requests.
Controller Capabilities
The analyzer can be configured as an HP-IB system controller or as a
talker/listener on the bus. To configure the analyzer, select either the
or the softkey in the
SYSTEM OPTIONS
The analyzer is not usually configured as the system controller unless it
is the only controller on the bus. This setup would be used if the analyzer
only needed to control printers or plotters. It would also be used if HP
Instrument BASIC was being used to control other test equipment.
When the analyzer is used with another controller on the bus, it is
usually configured as a talker/listener. In this configuration, when the
analyzer is given control it can function as the active controller.
menu.
Programmer’s Guide1-9
Introduction to HP-IB Programming
Programming Fundamentals
Response to Bus Management Commands
The HP-IB contains an attention (ATN) line that determines whether
the interface is in command mode or data mode. When the interface is in
command mode (ATN TRUE), a controller can send bus management
commands over the bus. Bus management commands specify which
devices on the interface can talk (send data) and which can listen
(receive data). They also instruct devices on the bus, either individually
or collectively, to perform a particular interface operation.
This section describes how the analyzer responds to the HP-IB
management commands. The commands themselves are defined by the
IEEE 488.1 standard. Refer to the documentation for your controller's
language system to determine how to send these commands.
Device Clear (DCL)
When the analyzer receives this command, it does the following:
• clears its input and output queues
• resets its command parser (so it is ready to receive a new program
message)
• cancels any pending *OPC command or query
The command does not affect the following:
• front panel operation
• any analyzer operations in progress (other than those already
mentioned)
• any instrument settings or registers (although clearing the output
queue may indirectly affect the status byte's Message Available
(MAV) bit)
Go To Local (GTL)
This command returns the analyzer to local (front-panel) control. All
keys on the analyzer's front-panel are enabled.
1-10Programmer’ s Guide
Introduction to HP-IB Programming
Return to Local
Programming Fundamentals
Interface Clear (IFC)
This command causes the analyzer to halt all bus activity. It
discontinues any input or output, although the input and output queues
are not cleared. If the analyzer is designated as the active controller
when this command is received, it relinquishes control of the bus to the
system controller. If the analyzer is enabled to respond to a Serial Poll, it
becomes Serial Poll disabled.
Local Lockout (LLO)
This command causes the analyzer to enter the local lockout mode,
regardless of whether it is in the local or remote mode. The analyzer only
leaves the local lockout mode when the HP-IB Remote Enable (REN) line
is set FALSE.
Local Lockout ensures that the analyzer's remote softkey menu
(including the softkey) is disabled when the analyzer
is in the remote mode. When the key is enabled, it allows a front-panel
operator to return the analyzer to local mode, enabling all other
front-panel keys. When the key is disabled, it does not allow the
front-panel operator to return the analyzer to local mode.
Parallel Poll
The analyzer ignores all of the following parallel poll commands:
• Parallel Poll Configure (PPC)
• Parallel Poll Unconfigure (PPU)
• Parallel Poll Enable (PPE)
• Parallel Poll Disable (PPD)
Programmer’s Guide1-11
Introduction to HP-IB Programming
Return to Local
Programming Fundamentals
Remote Enable (REN)
REN is a single line on the HP-IB. When it is set TRUE, the analyzer
will enter the remote mode when addressed to listen. It will remain in
remote mode until it receives the Go to Local (GTL) command or until
the REN line is set FALSE.
When the analyzer is in remote mode and local lockout mode, all front
panel keys are disabled. When the analyzer is in remote mode but not in
local lockout mode, all front panel keys are disabled except for the
softkeys. The remote softkey menu includes seven keys that are
available for use by a program. The eighth softkey is the
key which allows a front-panel operator to return the
analyzer to local mode, enabling all other front-panel keys.
Selected Device Clear (SDC)
The analyzer responds to this command in the same way that it responds
to the Device Clear (DCL) command.
When the analyzer receives this command it does the following:
• clears its input and output queues
• resets its command parser (so it is ready to receive a new program
message)
• cancels any pending *OPC command or query
The command does not affect the following:
• front-panel operation
• any analyzer operations in progress (other than those already
mentioned)
• any analyzer settings or registers (although clearing the output
queue may indirectly affect the status byte's MAV bit) passed
Serial Poll
The analyzer responds to both of the serial poll commands. The Serial
Poll Enable (SPE) command causes the analyzer to enter the serial poll
mode. While the analyzer is in this mode, it sends the contents of its
status byte register to the controller when addressed to talk.
1-12Programmer’ s Guide
Introduction to HP-IB Programming
Programming Fundamentals
When the status byte is returned in response to a serial poll, bit 6 acts as
the Request Service (RQS) bit. If the bit is set, it will be cleared after the
status byte is returned.
The Serial Poll Disable (SPD) command causes the analyzer to leave the
serial poll mode.
Take Control Talker (TCT)
If the analyzer is addressed to talk, this command causes it to take
control of the HP-IB. It becomes the active controller on the bus. The
analyzer automatically passes control back when it completes the
operation that required it to take control. Control is passed back to the
address specified by the *PCB command (which should be sent prior to
passing control).
If the analyzer does not require control when this command is received,
it immediately passes control back.
Message Exchange
The analyzer communicates with the controller and other devices on the
HP-IB using program messages and response messages. Program
messages are used to send commands, queries, and data to the analyzer.
Response messages are used to return data from the analyzer. The
syntax for both kinds of messages is discussed in Chapter 9,
“Introduction to SCPI.”
There are two important things to remember about the message
exchanges between the analyzer and other devices on the bus:
• The analyzer only talks after it receives a terminated query (see
“Query Response Generation” on page 1-16).
• Once it receives a terminated query, the analyzer expects to talk
before it is told to do something else.
Programmer’s Guide1-13
Introduction to HP-IB Programming
Programming Fundamentals
HP-IB Queues
Queues enhance the exchange of messages between the analyzer and
other devices on the bus. The analyzer contains the following:
• an input queue
• an error queue
• an output queue
Input Queue
The input queue temporarily stores the following until they are read by
the analyzer's command parser:
• device commands and queries
• the HP-IB END message (EOI asserted while the last data byte is on
the bus)
The input queue also makes it possible for a controller to send multiple
program messages to the analyzer without regard to the amount of time
required to parse and execute those messages. The queue holds up to 128
bytes. It is cleared when the following actions occur:
• the analyzer is turned on
• the Device Clear (DCL) or Selected Device Clear (SDC) command is
received
Error Queue
The error queue temporarily stores up to 20 error messages. Each time
the analyzer detects an error , it places a message in the queue . When you
send the SYST:ERR? query, one message is moved from the error queue
to the output queue so it can be read by the controller. Error messages
are delivered to the output queue in the order they were received.
The error queue is cleared when the following actions occur:
• all the error messages are read using the SYST:ERR? query
• the analyzer is turned on
• the *CLS command is received
1-14Programmer’ s Guide
Introduction to HP-IB Programming
Programming Fundamentals
Output Queue
The output queue temporarily stores a single response message until it is
read by a controller. It is cleared when the following actions occur:
• the message is read by a controller
• the analyzer is turned on
• the Device Clear (DCL) or Selected Device Clear (SDC) command is
received
Command Parser
The command parser reads program messages from the input queue in
the order they were received from the bus. It analyzes the messages to
determine what actions the analyzer should take.
One of the parser's most important functions is to determine the position
of a program message in the analyzer's command tree (described in
Chapter 9). When the command parser is reset, the next command it
receives is expected to arise from the base of the analyzer's command
tree.
The parser is reset when the following actions occur:
• the analyzer is turned on
• The Device Clear (DCL) or Selected Device Clear (SDC) command is
received.
• a colon immediately follows a semicolon in a program message. (For
more information see “Sending Multiple Commands” on page 9-7.)
• A program message terminator is received. A program message
terminator can be an ASCII carriage return (
or the HP-IB END message (EOI set true).
Programmer’s Guide1-15
C
) or newline character
R
Introduction to HP-IB Programming
Programming Fundamentals
Query Response Generation
When the analyzer parses a query, the response to that query is placed in
the analyzer's output queue. The response should be read immediately
after the query is sent. This ensures that the response is not cleared
before it is read. The response is cleared when one of the following
message exchange conditions occurs:
• Unterminated condition—the query is not properly terminated with
an ASCII carriage return character or the HP-IB END message (EOI
set true) before the response is read.
• Interrupted condition—a second program message is sent before the
response to the first is read.
• Buffer deadlock—a program message is sent that exceeds the length
of the input queue or that generates more response data than fits in
the output queue.
1-16Programmer’ s Guide
2Synchronizing the Analyzer and
a Controller
2-1
Synchronizing the Analyzer and a Controller
Synchronizing the Analyzer and a Controller
Synchronizing the Analyzer and a
Controller
The IEEE 488.2 standard provides tools that can be used to synchronize
the analyzer and a controller. Proper use of these tools ensures that the
analyzer is in a known state when you send a particular command or
query.
Device commands can be divided into two broad classes:
• Sequential commands
• Overlapped commands
Most of the analyzer's commands are processed sequentially. A
sequential command holds off the processing of subsequent commands
until it has been completely processed.
Some commands do not hold off the processing of subsequent commands;
they are called overlapped commands.
2-2Programmer’ s Guide
Synchronizing the Analyzer and a Controller
Overlapped Commands
Overlapped Commands
Typically, overlapped commands take longer to process than sequential
commands. F or example, theINITIATE:IMMEDIATE command restarts a
measurement. The command is not considered to have been completely
processed until the measurement is complete. This can take a long time
with a narrow or fine system bandwidth or when averaging is enabled.
The analyzer has the following overlapped commands: