Keysight (Agilent) 8712ES Programmer’s Guide

Programmer’s Guide
HP 8712ET/ES and HP 8714ET/ES
RF Network Analyzers
HP Part No. 08714-90015
Printed in USA
Print Date: October 1999
Supersedes: October 1998
© Copyright 1998, 1999 Hewlett-Packard Company
Notice
Softkey
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.
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 Guide iii
• Information on HP BASIC programming is available in the manual set for the BASIC revision being used. For example: BASIC 7.0 Programming 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 Tutorial Description 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.
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 Guide Supplement 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 Guide v
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 Handbook Supplement shows how to use HP Instrument BASIC to program the analyzer.
The Option 100 Fault Location and Structural Return Loss 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.)
Contents
1. Introduction to HP-IB Programming
Introduction to HP-IB Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Bus Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Data Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Handshake Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Control Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Sending Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
HP-IB Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Interface Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Programming Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Controller Capabilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
Response to Bus Management Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
Message Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
2. Synchronizing the Analyzer and a Controller
Synchronizing the Analyzer and a Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Overlapped Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Controlling Execution of Overlapped Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Using *WAI and *OPC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
3. Passing Control
Passing Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
4. Data Types and Encoding
Data Types and Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Numeric Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Character Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
String Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Expression Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Block Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Data Encoding for Large Data Transfers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
ASCII Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Binary Encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Byte Swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Programmer’s Guide Contents-vii
Contents
5. Using Status Registers
Using Status Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
General Status Register Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3
Condition Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
Transition Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
Event Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
Enable Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5
How to Use Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6
The Service Request Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
Generating a Service Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
The Analyzer's Status Register Sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10
Status Byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12
Device Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
Limit Fail Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
Questionable Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-19
Standard Event Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Measuring Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-23
Averaging Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-23
Operational Status Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24
Settings for STATus:PRESet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-25
Analyzer Register Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
6. Trace Data Transfers
Trace Data Transfers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-2
Querying the Measurement Trace Using BASIC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-3
Smith Chart and Polar Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-4
Querying the Measurement Trace Using SICL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-5
Using Binary Data Encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-6
Trace Data Transfer Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-8
Transferring Data with IBASIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-10
Taking Sweeps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-11
CALC:DATA? versus TRACE:DATA? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-12
Querying Single Data Points Using Markers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-13
Accessing Other Measurement Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-14
Applying Gain Correction Using the Memory Trace . . . . . . . . . . . . . . . . . . . . . . . . . .6-16
Performing Your Own Data Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-18
Contents-viii Pr ogrammer’s Guide
Contents
Downloading Trace Data Using Binary Encoding. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20
Internal Measurement Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21
Raw Data Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Ratio Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22
Error Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23
Error Coefficient Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23
Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
Corrected Data Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
Corrected Memory Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
Trace Math Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Electrical Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Transform (Option 100 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Formatted Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Offset and Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
7. Using Graphics
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Window Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
The Graphics Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6
8. Front Panel Keycodes
Front Panel Keycodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Controlling the Front Panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Monitoring the Front Panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
9. Introduction to SCPI
Introduction to SCPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
The Command Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Sending Multiple Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7
Command Abbreviation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
Implied Mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9
Parameter Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Numeric Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10
Character Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
Boolean Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12
Programmer’s Guide Contents-ix
Contents
String Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13
Block Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13
Syntax Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-14
IEEE 488.2 Common Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16
10. Menu Map with SCPI Commands
How to Enter Numbers and Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-4
How to Enter Frequency Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-5
How to Enter Time Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-6
How to Enter Power and Voltage Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-7
How to Enter Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-8
Menu Map for HP 8712ET/ES and HP 8714ET/ES . . . . . . . . . . . . . . . . . . . . . . . . . . .10-9
11. SCPI Command Summary
Queries, Forms, and Parameter Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2
Parameter Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-3
SCPI Device Command Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-4
12. SCPI Conformance Information
SCPI Conformance Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-2
SCPI Standard Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-3
Instrument Specific Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-10
13. SCPI Error Messages
SCPI Error Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-2
Command Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-3
Execution Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-8
Device-Specific Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-15
Query Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-17
Contents-x Programmer’ s Guide
1 Introduction to HP-IB
Programming
1-1

Introduction to HP-IB Programming

HP-IB
Introduction to HP-IB Programming
Introduction to HP-IB Programming
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-2 Programmer’ s Guide
menu. The factory default address for the
Introduction to HP-IB Programming
Softkey
Softkey
Softkey
Introduction to HP-IB Programming
NOTE Throughout 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 Guide 1-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-4 Programmer’ 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:
IFC Interface 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.
ATN Attention. 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.
SRQ Service 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.
REN Remote 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.
EOI End 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 Guide 1-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-6 Programmer’ 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 Guide 1-7
Introduction to HP-IB Programming

Interface Capabilities

Interface Capabilities
The analyzer has the following interface capabilities, defined by the IEEE 488.1 standard:
Table 1-1 Analyzer Interface Capabilities (IEEE 488.1)
SH1 full Source handshake capability AH1 full Acceptor handshake capability T6 basic Talker, Serial Poll, no Talk Only, unaddress if MLA TE0 no Extended Talker capability L4 basic Listener, no Listen Only, unaddress if MTA LE0 no Extended Listener capability SR1 full Service Request capability RL1 full Remote/Local capability DC1 full Device Clear capability C1 System Controller capability C2 send IFC and take charge Controller capability C3 send REN Controller capability
1
C4
1
C8 C12 E2 tri-state drivers DT1 full device trigger capability PP0 no parallel poll capability
1. only when an HP Instrument BASIC program is running
2. only when an HP Instrument BASIC program is not running
1-8 Programmer’ 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 Guide 1-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-10 Programmer’ 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 Guide 1-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-12 Programmer’ 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 Guide 1-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-14 Programmer’ 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 Guide 1-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-16 Programmer’ s Guide
2 Synchronizing 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-2 Programmer’ 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:
ABORt CALibration:SELF: ALL CALibration:SELF: <ON|OFF|ONCE> CALibration:SELF:METHod:<ONEPort|TWOPort> CALibration:ZERO:AUTO CONFigure[1|2] DIAGnostic:CCONstants:LOAD DIAGnostic:CCONstants:STORe:DISK DIAGnostic:CCONstants:STORe:EEPRom DIAGnostic:DITHer DIAGnostic:SPUR:AVOid HCOPy[:IMMediate] INITiate[1|2]:CONTinuous INITiate[1|2][:IMMediate] MMEMory:LOAD:STATe OUTPut[:STATe] POWer[1|2]:MODE PROGram[:SELected]:EXECute ROUTe[1|2]:PATH:DEFine:PORT? ROUTe[1|2]:PATH:DEFine:PORT <num1>, <num2> ROUTe[1|2]:REFLection:DEFine:PORT <num>
Programmer’s Guide 2-3
Synchronizing the Analyzer and a Controller
Overlapped Commands
ROUTe[1|2]:TRANsmission:DEFine:PORT <num> SENSe[1|2]:AVERage:CLEar SENSe[1|2]:AVERage:COUNt SENSe[1|2]:AVERage[:STATe] SENSe[1|2]:BWIDth[:RESolution] SENSe[1|2]:CORRection:CLASs[:SELect]? SENSe[1|2]:CORRection:COLLect[:ACQuire] SENSe[1|2]:CORRection:COLLect[:ACQuire] STANdard1-7 SENSe[1|2]:CORRection:COLLect:CKIT:PORT[1|12]
[:SELECT] SENSe[1|2]:CORRection:COLLect:ISTate[:AUTO] SENSe[1|2]:CORRection:COLLect:METHod SENSe[1|2]:CORRection:COLLect:METHod TWOPort SENSe[1|2]:CORRection:COLLect:SAVE SENSe[1|2]:CORRection:CSET[:SELect] SENSe[1|2]:CORRection[:STATe] SENSe[1|2]:CORRection:ONEPort:REFLection[:IMMediate] SENSe[1|2]:CORRection:ONEPort:TRANSmission
[:IMMediate] SENSe[1|2]:CORRection:TWOPort[:IMMediate] SENSe:COUPle SENSe[1|2]:DETector[:FUNCtion] SENSe[1|2]:DISTance:STARt (Option 100 only) SENSe[1|2]:DISTance:STOP (Option 100 only) SENSe[1|2]:FREQuency:CENTer SENSe[1|2]:FREQuency:MODE (Option 100 only) SENSe[1|2]:FREQuency:SPAN SENSe[1|2]:FREQuency:SPAN:MAXimum SENSe[1|2]:FREQuency:STARt
2-4 Programmer’ s Guide
Loading...
+ 295 hidden pages