Agilent 8702E Programmer’s Guide

Agilent 8702E Lightwave Component Analyzer Programmer’s Guide
© Copyright Agilent Technologies 2001 All Rights Reserved. Repro­duction, adaptation, or trans­lation without prior written permission is prohibited, except as allowed under copy­right laws.
Agilent Part No. 08702-91029 Printed in USA March 2001
Agilent Technologies Lightwave Division 3910 Brickway Boulevard­Santa Rosa, CA 95403, USA
Notice.
The information contained in this document is subject to change without notice. Com­panies, names, and data used in examples herein are ficti­tious unless otherwise noted. Agilent Technologies makes no warranty of any kind with regard to this material, includ­ing but not limited to, the implied warranties of mer­chantability and fitness for a particular purpose. Agilent Technologies shall not be lia­ble for errors contained herein or for incidental or conse­quential damages in connec­tion with the furnishing, performance, or use of this material.
Restricted Rights Legend.
Use, duplication, or disclo­sure by the U.S. Government is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 for DOD agencies, and sub­paragraphs (c) (1) and (c) (2) of the Commercial Computer Software Restricted Rights clause at FAR 52.227-19 for other agencies.
Warranty.
This Agilent Technologies instrument product is war­ranted against defects in material and workmanship for a period of one year from date of shipment. During the war­ranty period, Agilent Technol­ogies will, at its option, either repair or replace products which prove to be defective. For warranty service or repair, this product must be returned to a service facility desig­nated by Agilent Technolo­gies. Buyer shall prepay shipping charges to Agilent Technologies and Agilent Technologies shall pay ship­ping charges to return the product to Buyer. However, Buyer shall pay all shipping charges, duties, and taxes for products returned to Agilent Technologies from another country.
Agilent Technologies war­rants that its software and firmware designated by Agi­lent Technologies for use with an instrument will execute its programming instructions when properly installed on that instrument. Agilent Tech­nologies does not warrant that the operation of the instru­ment, or software, or firmware will be uninterrupted or error­free.
Limitation of Warranty.
The foregoing warranty shall not apply to defects resulting from improper or inadequate maintenance by Buyer, Buyer­supplied software or interfac­ing, unauthorized modifica­tion or misuse, operation outside of the environmental specifications for the product, or improper site preparation or maintenance.
No other warranty is expressed or implied. Agilent Technologies specifically dis­claims the implied warranties of merchantability and fitness for a particular purpose.
Exclusive Remedies.
The remedies provided herein are buyer's sole and exclusive remedies. Agilent Technolo­gies shall not be liable for any direct, indirect, special, inci­dental, or consequential dam­ages, whether based on contract, tort, or any other legal theory.
Safety Symbols.
CAUTION
The
caution
sign denotes a hazard. It calls attention to a procedure which, if not cor­rectly performed or adhered to, could result in damage to or destruction of the product. Do not proceed beyond a cau­tion sign until the indicated conditions are fully under­stood and met.
WAR NI NG
The
warning
sign denotes a hazard. It calls attention to a procedure which, if not cor­rectly performed or adhered to, could result in injury or loss of life. Do not proceed beyond a warning sign until the indicated conditions are fully understood and met.
The instruction man­ual symbol. The prod­uct is marked with this warning symbol when it is necessary for the user to refer to the instructions in the manual.
The laser radiation symbol. This warning symbol is marked on products which have a laser output.
The AC symbol is used to indicate the required nature of the line module input power.
The ON symbols are
|
used to mark the posi­tions of the instrument power line switch.
The OFF symbols
are used to mark the positions of the instru­ment power line switch.
The CE mark is a reg­istered trademark of the European Commu­nity.
The CSA mark is a reg­istered trademark of the Canadian Stan­dards Association.
The C-Tick mark is a registered trademark of the Australian Spec­trum Management Agency.
This text denotes the
ISM1-A
instrument is an Industrial Scientific and Medical Group 1 Class A product.
Typographical Conven­tions.
The following conventions are used in this book:
Key type
for keys or text located on the keyboard or instrument.
Softkey type
for key names that are displayed on the instru­ment’s screen.
Display type
for words or characters displayed on the computer’s screen or instru­ment’s display.
User type
for words or charac-
ters that you type or enter.
Emphasis
type for words or characters that emphasize some point or that are used as place holders for text that you type.
ii

Contents

1 Writing Programs

General Information 1-3 Selecting the GPIB Device Mode 1-7 Making Measurements 1-9 Reading Data 1-11 Data-Processing Chain 1-18 Controlling Command Execution 1-22 Calibrating for Measurements 1-24 Debugging Programs 1-27 Understanding File Names 1-28 Drawing Graphics on the Display 1-29 Monitoring the Instrument 1-31 Response to IEEE-488 Universal Commands 1-37

2 Programming Examples

Preparing Measurement Settings 2-4 Verifying Measurement Settings 2-6 S11 1-Port Measurement Calibration 2-8 Full 2-Port Measurement Calibration 2-12 Data Transfer Using Markers 2-16 Data Transfer Using ASCII Format 2-20 Data Transfer Using Floating-Point Numbers 2-23 Data Transfer Using Frequency-Array Information 2-25 Data Transfer Using Internal Binary Format 2-28 Using Error Queue 2-30 Generating Interrupts 2-33 Power Meter Calibration 2-37 Using the Learn String 2-41 Reading Calibration Data 2-44 Using Instrument States 2-48 Setting a List Frequency Sweep 2-52 Selecting a Single Segment 2-56 Setting up Limit Lines 2-59 Performing Pass/Fail Tests 2-62 Operation Using Talker/Listener Mode 2-66 Controlling Peripherals 2-69 Printing Via the Serial Port 2-73
Contents-1
Contents
Plotting Data 2-75 Reading Plot Files from Disk 2-78 Reading ASCII Instrument Files 2-86

3 Language Reference

4 Graphics Language Reference

5 Tables and Charts

GPIB Requirements 5-2 Programming Commands by Functional Group 5-6 Key Definitions 5-20
Contents-2
1
General Information 1-3
To select the communication mode 1-6 To change the GPIB address 1-6
Selecting the GPIB Device Mode 1-7
To change the GPIB device mode 1-8 Making Measurements 1-9 Reading Data 1-11 Data-Processing Chain 1-18 Controlling Command Execution 1-22 Calibrating for Measurements 1-24
To calibrate the instrument 1-24 Debugging Programs 1-27
To start debugging mode 1-27 Understanding File Names 1-28 Drawing Graphics on the Display 1-29 Monitoring the Instrument 1-31 Response to IEEE-488 Universal Commands 1-37

Writing Programs

Writing Programs
Writing Programs
Writing Programs
This chapter provides a general introduction to programming the Agilent 8702E. It covers topics such as command syntax, addressing the instrument, initializing the instrument, and returning measurement results to the computer.
Before you begin programming, you should first become proficient at making manual measurements as explained in the you learn the techniques and softkey presses needed to make a measurement, you can refer to Table 5-4, “Keys versus Programming Commands,” on page
5-20 to locate the equivalent programming command.
NOTE:
Agilent 8702E User’s Guide
. Once
The Agilent 8702E conforms to IEEE 488.2 and IEC-625 standards for interfacing instru­ments.
1-2
Writing Programs

General Information

General Information
The Agilent 8702E occupies two GPIB addresses: the instrument itself and the display. The display address is derived from the instrument address as described in “Drawing Graphics on the Display” on page 1-29. These addresses are stored in short-term, non-volatile memory and are not affected when you press Agilent 8702E is device 16, and the display address is device 17.
There is also an address for the system controller. This address refers to the controller when the Agilent 8702E is being used in pass-control mode. This is the address that control is passed back to when the Agilent 8702E-controlled operation is complete.
You can change the GPIB address from the front panel as described in “To
change the GPIB address” on page 1-6.
PRESET
or cycle the power. The default address for the
GPIB status lights
When the Agilent 8702E is connected to the GPIB, the front-panel GPIB status lights indicate the current status of the Agilent 8702E. These lights have the following definitions:
R = Remote operation
L = Listen mode
T = Talk mode
S = Service request (SRQ) asserted by the Agilent 8702E
Remote mode and front-panel lockout
Whenever the instrument is controlled by a computer, the front-panel GPIB remote status light, R, is turned on and the instrument keys are disabled. Press
LOCAL
the
Consult the documentation for your programming environment to determine which commands are used to put an instrument in the remote and local lock­out modes. These are not Agilent 8702E commands; they control GPIB control lines and do not send any characters to the Agilent 8702E.
key to restore front panel control of the instrument.
1-3
Writing Programs
General Information
Initialize the instrument at the start of every program
It is good practice to initialize the instrument at the start of every program. This ensures that the bus and all appropriate interfaces are in a known state. HP BASIC provides a CLEAR command which clears the interface buffer and also resets the instrument’s parser. (The parser is the program that reads the instructions that you send.) Whenever the instrument is under remote pro­gramming control, it should be in the single measurement acquisition mode. This is automatically accomplished when the RST is used. The RST command initializes the instrument to the factory preset state:
CLEAR 716 OUTPUT 716;”RST”
Notice in the example above, that the commands are sent to an instrument address of 716. This indicates address 16 on an interface with select code 7. Pressing the
SET
key resets the instrument to either the factory preset state or a user-
PRESET
key does not change the GPIB address. Pressing the
PRE-
defined preset state.
Rules for writing commands
The Agilent 8702E accepts letters, changing lowercase to uppercase, num­bers, decimal points, +, –, semicolons, carriage returns and line feeds. Leading zeros, spaces, carriage returns, and unnecessary terminators are ignored, except when inserted between a command and a numerical or string argu­ment. If the analyzer does not recognize a character as appropriate, it gener­ates a syntax error message and recovers at the next terminator.
For example, the CHAN command must be entered as CHAN1 or CHAN2. Inserting a space in the syntax (CHAN 1) results in an error. However, a space must be entered between the MARK2 command and its argument. For exam­ple, MARK2 1.4GHZ.
Units and terminators
The Agilent 8702E outputs data in basic units and assumes these basic units when it receives an input (unless the input is otherwise qualified). The basic units and allowable expressions can be found below. Both uppercase and low­ercase letters are acceptable.
Table 1-1. Terminator Codes
S Seconds HZ Hertz
MS Milliseconds KHZ Kilohertz
US Microseconds MHZ Megahertz
1-4
Writing Programs
General Information
Table 1-1. Terminator Codes
NS Nanoseconds GHZ Gigahertz
PS Picoseconds DB dB or dBm
FS Femtoseconds V Volts
Terminators are used to indicate the end of a command. This allows the Agilent 8702E to execute the next command in the event of a syntax error. The semicolon (;) is the recommended command terminator. The line-feed character (LF) and the GPIB EOI line can also be used as terminators. Again, the Agilent 8702E will ignore the carriage-return character (CR).
.
Table 1-2. GPIB Interface Capabilities
Capability Description
SH1 Full-source handshake.
AH1 Full-acceptor handshake.
T6 Basic talker, answers serial poll, unaddresses if MLA is issued. No talk-only mode.
L4 Basic listener, unaddresses if MTA is issued. No listen-only mode.
SR1 Complete service request (SRQ) capabilities.
RL1 Complete remote/local capability including local lockout.
PP0 Does not respond to parallel poll.
DC1 Complete device clear.
DT1 Responds to a Group Execute Trigger (GET) in the hold-trigger mode.
C1,C2,C3 System controller capabilities in system-controller mode.
C10 Pass control capabilities in pass-control mode.
E2 Tri-state drivers.
LE0 No extended listener capabilities.
TE0 No extended talker capabilities.
1-5
Writing Programs
General Information
To select the communication mode
1
Press the
2
Press
LOCAL
key.
TALK ER/ LISTE NER
so that this softkey is underlined.
To change the GPIB address
1
Press the
2
Press
3
Press
4
Use the front-panel knob or keys to enter the new GPIB address.
LOCAL
key.
SET ADDRESSES.
ADDRESS: 8702
.
1-6
Writing Programs

Selecting the GPIB Device Mode

Selecting the GPIB Device Mode
Three different device modes are possible for the Agilent 8702E:
• talker/listener mode
• system-controller mode
• pass-control mode
Performing an instrument preset does not affect the selected bus mode, although the bus mode will return to talker/listener mode if the line power is cycled.
Talker/listener mode
This is the mode that is normally used for remote programming of the Agilent 8702E. In talker/listener mode, the Agilent 8702E and all peripheral devices are controlled from an external instrument controller. The controller can command the Agilent 8702E to talk and other devices to listen. The Agilent 8702E and peripheral devices cannot talk directly to each other unless the computer sets up a data path between them. This mode allows the Agilent 8702E to act as either a talker or a listener, as required by the control­ling computer for the particular operation in progress.
While in this mode, the Agilent 8702E can make a plot or print using the
PPLOT;
addressed to talk by the system controller and then dump the display to a plotter/printer that the system controller has addressed to listen. Use of the commands controller.
OUTPPRIN;
or
PLOT;
commands. The Agilent 8702E will wait until it is
PRINALL;
and
require control to be passed to another
OUT-
System-controller mode
Do not attempt to use this mode for programming. This mode allows the Agilent 8702E to control peripherals directly in a standalone environment (without an external controller). This mode can only be selected manually from the Agilent 8702E’s front panel. It can only be used if no active computer or instrument controller is connected to the system via GPIB. If an attempt is made to set the Agilent 8702E to the system-controller mode when another
1-7
Writing Programs
Selecting the GPIB Device Mode
controller is connected to the interface, the following message is displayed on the Agilent 8702E’s display screen:
TROLLER ON GPIB"
The Agilent 8702E must be set to the system-controller mode in order to access peripherals from the front panel. In this mode, the Agilent 8702E can directly control peripherals (for example, plotters, printers, disk drives, and power meters) and the Agilent 8702E may plot, print, store on disk, or per­form power meter functions.
Pass control mode
This mode allows the computer to control the Agilent 8702E via GPIB (as with the talker/listener mode), but also allows the Agilent 8702E to take control of the interface in order to plot, print, or access a disk. During an Agilent 8702E­controlled peripheral operation, the host computer is free to perform other internal tasks (for example, data or display manipulation) while the Agilent 8702E is controlling the bus. After the Agilent 8702E-controlled task is completed, the Agilent 8702E returns control to the system controller.
In pass control mode, the Agilent 8702E can request control from the system controller and take control of the bus if the controller addresses it to take con­trol. This allows the Agilent 8702E to take control of printers, plotters, and disk drives on an as-needed basis. The Agilent 8702E sets event status regis­ter bit 1 when it needs control of the interface, and the Agilent 8702E will transfer control back to the system controller at the completion of the opera­tion. It will pass control back to its controller address specified by ADDR­CONT.
.
"CAUTION: ANOTHER SYSTEM CON-
To change the GPIB device mode
1
Press the
2
Press
1-8
LOCAL
key.
SET ADDRESSES.
Writing Programs

Making Measurements

Making Measurements
This section explains how to organize instrument commands into a measure­ment sequence. A typical measurement sequence consists of the following steps:
1
Setting up the instrument
2
Calibrating the test setup
3
Connecting the device under test
4
Taking the measurement data
5
Post-processing the measurement data
6
Transferring the measurement data
Step 1. Setting up the instrument
Define the measurement by setting all of the basic measurement parameters. These include:
• sweep type
• frequency span
• sweep time
• number of points (in the data trace)
• RF power level
• type of measurement
• averaging
• IF bandwidth You can quickly set up an entire instrument state, using the save/recall regis­ters and the learn string. The learn string is a summary of the instrument state compacted into a string that the computer reads and retransmits to the ana­lyzer. Refer to “Using the Learn String” on page 2-41.
Step 2. Calibrating the test setup
After you have defined an instrument state, you should perform a measure­ment calibration. Although not required, measurement calibration improves accuracy.
1-9
Writing Programs
Making Measurements
The following list describes several methods to calibrate the analyzer:
• Stop the program and perform a calibration from the analyzer’s front panel.
• Use the computer to guide you through the calibration, as discussed in “S11 1-
Port Measurement Calibration” on page 2-8 and “Full 2-Port Measurement Cal­ibration” on page 2-12.
• Transfer the calibration data from a previous calibration back into the analyzer, as discussed in “Using Instrument States” on page 2-48.
Step 3. Connecting the device under test
After you connect your test device, you can use the computer to speed up any necessary device adjustments such as limit testing, bandwidth searches, and trace statistics.
Step 4. Taking the measurement data
Measure the device response and set the analyzer to hold the data. This cap­tures the data on the analyzer display.
By using the single-sweep command (SING), you can ensure a valid sweep. When you use this command, the analyzer completes all stimulus changes before starting the sweep and does not release the GPIB hold state until it has displayed the formatted trace. Then, when the analyzer completes the sweep, the instrument is put into hold mode, freezing the data. Because single sweep is OPC-compatible, it is easy to determine when the sweep has been com­pleted.
The number-of-groups command (NUMGn) triggers multiple sweeps. It is designed to work the same as the single-sweep command. NUMGn is useful for making a measurement with an averaging factor n (n can be 1 to 999). Both the single-sweep and number-of-groups commands restart averaging.
Step 5. Post-processing the measurement data
Figure 1-1 on page 1-19 shows the process functions used to affect the data
after you have made an error-corrected measurement. These process func­tions have parameters that can be adjusted to manipulate the error-corrected data prior to formatting. They do not affect the analyzer’s data gathering. The most useful functions are trace statistics, marker searches, electrical-delay offset, time domain, and gating.
After performing and activating a full 2-port measurement calibration, any of the four S-parameters may be viewed without taking a new sweep.
Step 6. Transferring the measurement data
Read your measurement results. All the data-output commands are designed to ensure that the data transmitted reflects the current state of the instru­ment.
1-10
Writing Programs

Reading Data

Reading Data
Output queue
Whenever an output-data command is received, the Agilent 8702E puts the data into the output queue (or buffer) where it is held until the system con­troller outputs the next read command. The queue, however, is only one event long; the next output-data command will overwrite the data already in the queue. Therefore, it is important to read the output queue immediately after every interrogation or data request from the Agilent 8702E.
Command interrogate
All instrument functions can be interrogated to find the current ON/OFF state or value. For instrument state commands, append the question mark charac­ter (?) to the command to interrogate the state of the functions. Suppose the operator has changed the power level from the Agilent 8702E’s front panel. The computer can ascertain the new power level using the Agilent 8702E’s command-interrogate function. If a question mark is appended to the root of a command, the Agilent 8702E will output the value of that function. For instance, the current RF source power at the test port. When the Agilent 8702E receives This condition illuminates the Agilent 8702E front-panel talk light (T). In this case, the Agilent 8702E transmits the output power level to the controller.
ON/OFF commands can be also be interrogated. The reply is a one (1) if the function is ON or a zero (0) if it is OFF. For example, if a command controls an active function that is underlined on the Agilent 8702E display, interrogating that command yields a one (1) if the command is underlined or a zero (0) if it is not. As another example, there are nine options on the format menu and only one option is underlined at a time. Only the underlined option will return a one (1) when interrogated. For instance, send the command string to the Agilent 8702E. If dual-channel display is switched ON, the Agilent 8702E will return a one (1) to the instrument controller.
POWE 7 DB;
POWE?;
, it prepares to transmit the current RF source power level.
sets the source power to 7 dB, and
POWE?;
outputs
DUAC?;
1-11
Writing Programs
Reading Data
Similarly, to determine if phase is being measured and displayed, send the command string
PHAS?;
to the Agilent 8702E. In this case, the Agilent 8702E will return a one (1) if phase is currently being displayed. Since the command only applies to the active channel, the response to the
PHAS?;
query depends
on which channel is active.
Output syntax
The following three types of data are transmitted by the Agilent 8702E in ASCII format:
• response to interrogation
• certain output commands
• ASCII floating-point (form 4) array transfers
Marker-output commands and interrogated commands are output in ASCII format only, meaning that each character and each digit is transmitted as a separate byte, leaving the receiving computer to reconstruct the numbers and strings. Numbers are transmitted as 24-character strings, consisting of:
-DDD.DDDDDDDDDDDDDDDE-DD
When multiple numbers are sent, the numbers are separated by commas.
Table 1-3. Form 4 (ASCII) Data-Transfer Character Definitions
Character(s)* Definition
Sign – for negative, blank for positive.
3 digits Digits to the left of the decimal point.
Decimal point
15 digits Digits to the right of the decimal point.
E Exponent notation.
Sign – for negative, + (or blank) for positive.
Exponent Two digits for the exponent.
* The items in this column are separated by commas and delimited (terminated) with a line feed character (LF).
1-12
Writing Programs
Reading Data
Marker data
The Agilent 8702E offers several options for outputting trace-related data. Trace information can be read out of the Agilent 8702E in several different formats. Data can be selectively read from the trace using the markers, or the entire trace can be read by the controller. If only specific information is required (such as a single point on the trace or the result of a marker search), the marker output command can be used to read the information.
To read the trace data using the marker, the marker must first be assigned to the desired frequency. This is accomplished using the marker commands. The controller sends a marker command followed by a frequency within the trace­data range. If the actual desired frequency was not sampled, the markers can be set to continuous mode and the desired marker value will be linearly inter­polated from the two nearest points. This interpolation can be prevented by putting the markers into discrete mode. Discrete mode allows the marker to only be positioned on a measured trace-data point.
As an alternative, the Agilent 8702E can be programmed to choose the stimu­lus value by using the value, or bandwidth search can be automatically determined with
SEARCH
. To continually update the search, switch the marker tracking ON. The
MARKER SEARCH
function. Maximum, minimum, target
MARKER
trace-maximum search will remain activated until:
• The search is switched OFF
• The tracking is switched OFF
• All markers are switched OFF Marker data can be output to a controller with a command to the Agilent 8702E. This set of commands causes the Agilent 8702E to transmit three numbers: marker value 1, marker value 2, and marker stimulus value. In log-magnitude display mode we get the log magnitude at marker 1, zero, and the marker frequency. Refer to “Units as a Function of Display Format” on
page 1-13 for a complete listing of all the possibilities for values 1 and 2. The
three possibilities for the third parameter are:
•frequency
• time (as in time domain)
•CW time
Table 1-4. Units as a Function of Display Format
OUTPMARK OUTPFORM Marker Readout
Display Format Marker Mode
LOG MAG dB dB dB PHASE degrees degrees
Value 1 Value 2 Value 1 Value 2 Value
degrees
AUX Value
1-13
Writing Programs
Reading Data
Table 1-4. Units as a Function of Display Format
OUTPMARK OUTPFORM Marker Readout
Display Format Marker Mode
DELAY seconds seconds † SMITH CHART LIN MKR lin mag degrees real imag lin mag degrees
LOG MKR dB degrees real imag dB degrees Re/Im real imag real imag real imag R + jX real ohms imag ohms real imag real ohms imag ohms G + jB real
POLAR LIN MKR lin mag degrees real imag lin mag degrees
LOG MKR dB degrees real imag dB degrees
Re/Im real imag real imag real imag LIN MAG lin mag lin mag lin mag † REAL real real real SWR SWR SWR SWR * The marker readout values are the marker values displayed in the upper right-hand corner of the display. They also correspond to
the value and auxiliary value associated with the fixed marker.
Value 2 is not significant in this format, though it is included in data transfers.
Value 1 Value 2 Value 1 Value 2 Value
seconds
Siemens
Siemens
imag Siemens
real imag real
AUX Value
imag Siemens
Array-data formats
The Agilent 8702E can transmit and receive arrays in the Agilent 8702E’s internal binary format as well as four different numeric formats. The current format is set with the FORM command. This command does not affect learn­string transfers, calibration-kit string transfers, output marker values, or non­array transfers such as queries. A transmitted array will be output in the cur­rent format, and the Agilent 8702E will attempt to read incoming arrays according to the current format. Each data point in an array is a pair of num­bers, usually a real/imaginary pair. The number of data points in each array is the same as the number of points in the current sweep.
The five formats are described below:
1
The Agilent 8702E’s internal binary format, 6 bytes-per-data point. The array is preceded by a four-byte header. The first two bytes represent the string
"#A"
, the standard block header. The second two bytes are an integer representing the number of bytes in the block to follow. FORM 1 is best applied when rapid data transfers, not to be modified by the computer nor interpreted by the user, are required.
2
IEEE 32-bit floating-point format, 8 bytes-per-data point. The data is preceded
1-14
Writing Programs
Reading Data
by the same header as in FORM 1. Each number consists of a 1-bit sign, an 8-
bit biased exponent, and a 23-bit mantissa. FORM 2 is the format of choice if
your computer supports single-precision floating-point numbers.
3
IEEE 64-bit floating-point format, 16 bytes-per-data point. The data is
preceded by the same header as in FORM 1. Each number consists of a 1-bit
sign, an 11-bit biased exponent, and a 52-bit mantissa. This format may be used
with double-precision floating-point numbers. No additional precision is
available in the Agilent 8702E data, but FORM 3 may be a convenient form for
transferring data to your computer.
4
ASCII floating-point format. The data is transmitted as ASCII numbers, as
described in “Output syntax” on page 1-12. There is no header. The
Agilent 8702E uses FORM 4 to transfer non-array data such as marker
responses and instrument settings.
5
PC-DOS 32-bit floating-point format with 4 bytes-per-number, 8 bytes-per-data
point. The data is preceded by the same header as in FORM 1. The byte order
is reversed to comply with PC-DOS formats.
controller, FORM 5 is the most effective format to use.
If you are using a PC-based
The Agilent 8702E terminates each transmission by asserting the EOI inter-
face line with the last byte transmitted. Table 1-5 on page 1-15 offers a com-
parative overview of the five array-data formats.
Table 1-5. Agilent 8702E/Option 011 Array-Data Formats
Format Type Type of Data
1 Internal Binary 3 6 1206 1210
2 IEEE 32-bit
Floating-Point
3 IEEE 64-bit
Floating-Point
4 ASCII Numbers 24 50 10,050
5PC-DOS 32-bit
Floating-Point
a. There are two data values (real and imaginary) for every data point. b. No header is used in form 4.
Bytes per Data Value
4 8 1608 1612
8 16 3216 3220
4 8 1608 1612
Bytes per Data
a
Point
Bytes per 201 Point Trace
Total Bytes with Header
10,050
b
1-15
Writing Programs
Reading Data
Trace-data transfers
Transferring trace data from the Agilent 8702E using an instrument controller can be divided into three steps:
1
allocating an array to receive and store the data
2
commanding the Agilent 8702E to transmit the data
3
accepting the transferred data
Data residing in the Agilent 8702E is always stored in pairs for each data point (to accommodate real/imaginary pairs). The real value is first, followed by the imaginary value. Hence, the receiving array has to be two elements wide, and as deep as the number of points in the array being transferred. Memory space for the array must be declared before any data can be transferred from the Agilent 8702E to the computer. When reading logarithmic amplitude and phase, save the first value of each data point pair and discard the second value.
As mentioned earlier, the Agilent 8702E can transmit data over GPIB in five different formats. The type of format affects what kind of data array is declared (real or integer), because the format determines what type of data is transferred. “Data Transfer Using Markers” on page 2-16 illustrates an ASCII transfer using Form 4. For more information on the various data formats, refer to “Array-data formats” on page 1-14. For information on the various types of data that can be obtained (raw data, error-corrected data, etc.), refer to “Data
levels” on page 1-20.
Frequency-related arrays
Frequency-related values are calculated for the Agilent 8702E displays. The only data available to the programmer are the start and stop frequencies, or center and span frequencies, of the selected frequency range.
In a linear frequency range, the frequency values can be calculated easily because the data points are equally spaced across the trace. Relating the data from a linear frequency sweep to frequency can be done by interrogating the start frequency, the frequency span, and the number of points in the trace.
Given that information, the frequency of point n in a linear-frequency sweep is represented by the equation:
F=Start frequency + (n–1) × Span/(Points–1)
In most cases, this is an easy solution for determining the related frequency value that corresponds with a data point. This technique is illustrated in “Data
Transfer Using Markers” on page 2-16.
1-16
Writing Programs
Reading Data
When using log sweep or a list-frequency sweep, the points are not evenly
spaced over the frequency range of the sweep. In these cases, the frequencies
can be read directly out of the instrument with the
OUTPLIML
command.
“Data Transfer Using Frequency-Array Information” on page 2-25 demon-
strates this technique.
Executing
OUTPLIML;
reports the limit-test results by transmitting:
• the stimulus point tested
• a number indicating the limit-test results
• the upper test limit at the stimulus point (if available)
• the lower test limit at the stimulus point (if available)
The numbers used to indicate the limit-test results are:
• a negative one (–1) for no test
• a zero (0) for fail
• a positive one (1) for pass
If there are no limits available, the Agilent 8702E transmits zeros.
This data is very useful when testing with limit lines. It provides a method of obtaining accurate frequency-stimulus values to correspond with the trace data. The other limit-related values may be discarded and the stimulus values used with the trace-data points.
1-17
Writing Programs

Data-Processing Chain

Data-Processing Chain
This section describes the manner in which the Agilent 8702E processes mea­surement data. It includes information on data arrays, common output com­mands, data levels, the learn string, and the calibration kit string.
Data arrays
Figure 1-1 on page 1-19 shows the different kinds of data available within the
instrument:
• raw measured data
• error-corrected data
• formatted data
• trace memory
• calibration coefficients
Trace memory can be directly output to a controller with cannot be directly transmitted back.
1-18
OUTPMEMO
, but it
Writing Programs
Data-Processing Chain
Figure 1-1. The data-processing chain
All the data-output commands are designed to ensure that the data transmit­ted reflects the current state of the instrument:
OUTPDATA, OUTPRAW
, and
OUTPFORM
will not transmit data until all format-
ting functions have completed.
OUTPLIML, OUTPLIMM
, and
OUTPLIMF
will not transmit data until the limit
test has occurred (if activated).
OUTPMARK
will activate a marker if a marker is not already selected. It will also insure that any current marker searches have been completed before transmit­ting data.
OUTPMSTA
ensures that the statistics have been calculated for the current trace before transmitting data. If the statistics are not activated, it will activate the statistics long enough to update the current values before deactivating the statistics.
OUTPMWID
ensures that a bandwidth search has been executed for the current trace before transmitting data. If the bandwidth-search function is not activat­ed, it will activate the bandwidth-search function long enough to update the
1-19
Writing Programs
Data-Processing Chain
current values before switching OFF the bandwidth-search functions.
Data levels
Different levels of data can be read out of the instrument. Refer to the data­processing chain in Figure 1-1 on page 1-19.
The following list describes the different types of data that are available from the Agilent 8702E.
Raw data
Error-corrected data
Formatted data
The basic measurement data, reflecting the stimulus parameters, averaging, and IF bandwidth are forms of raw data. If a full 2-port measurement calibra­tion is activated, there are actually four raw arrays kept: one for each raw S­parameter. The data can be output to a controller with the commands
OUTPRAW1, OUTPRAW2, OUTPRAW3, OUTPRAW4
. Normally, only raw format 1 is available, and it holds the current parameter. If a 2-port measurement cali­bration is active, the four arrays refer to S
, S21, S12, and S22 respectively. This
11
data is represented in real/imaginary pairs.
This is the raw data with error-correction applied. The array represents the currently measured parameter and is stored in real/imaginary pairs. The error­corrected data can be output to a controller with the
OUTPMEMO
The
command reads the trace memory, if available. The trace
OUTPDATA
command.
memory also contains error-corrected data. Note that neither raw nor error­corrected data reflect such post-processing functions as electrical-delay off­set, trace math, or time-domain gating.
This is the array of data actually being displayed. It reflects all post-processing functions such as electrical delay and time domain. The units of the array out­put depend on the current display format. Refer to Table 1-4, “Units as a Func-
tion of Display Format,” on page 1-13 for the various units defined as a
function of display format.
Calibration coefficients
The results of a measurement calibration are arrays containing calibration coefficients. These calibration coefficients are then used in the error-correc­tion routines. Each array corresponds to a specific error term in the error model. The
Agilent 8702E User’s Guide
details which error coefficients are used for specific calibration types as well as the arrays those coefficients can be found in. Not all calibration types use all 12 arrays. The data is stored as real/imaginary pairs.
1-20
Writing Programs
Data-Processing Chain
Generally, formatted data is the most useful of the four data levels because it is the same information the operator sees on the display. However, if post-pro­cessing is unnecessary (possibly in cases involving smoothing), error-cor­rected data may be more desirable. Error-corrected data also affords the user the opportunity to input the data to the Agilent 8702E and apply post-pro­cessing at another time.
Learn string and calibration-kit string
The learn string is a summary of the instrument state. It includes all the front­panel settings, the limit-test tables, and the list-frequency table for the cur­rent instrument state. It does not include calibration data or the information stored in the save/recall registers.
The learn string can be output to a controller with the
OUTPLEAS
executable which commands the Agilent 8702E to start transmitting the binary string. The string has a fixed length for a given firmware revision. It cannot be more than 3000 bytes in length. The array has the same header as in Form 1.
The calibration kit is a set of key characteristics of the calibration standards used to increase the calibration accuracy. There are default kits for several dif­ferent connector types. There is also space for a user-defined calibration kit. The command
OUTPCALK
outputs the currently active calibration kit as a binary string in Form 1. As with the learn string, the calibration-kit string has a fixed length for a given firmware revision. It cannot be longer than 1000 bytes.
1-21
Writing Programs

Controlling Command Execution

Controlling Command Execution
Some Agilent 8702E commands require relatively longer execution times due to measurement sweeps or other processes and, occasionally, there is a need to know when certain Agilent 8702E operations have been completed. There is an operation-complete function (OPC) that allows a synchronization of pro­grams with the execution of certain key commands. Table 1-6 on page 1-23 lists all the OPC-compatible commands for the instrument.
Synchronized program execution with OPC command
Issue an or ESR operation-complete bit will then be set after the execution of the OPC­compatible command. For example, issuing be set when the single sweep is finished. Issuing the Agilent 8702E to output a one (1) when the command execution is com­plete.
Addressing the Agilent 8702E to talk after issuing
addressed to talk without selecting output
Agilent 8702E will halt the computer by not transmitting the one (1) until the command has completed. For example, executing immediately interrogating the Agilent 8702E, causes the bus to halt until the instrument preset is complete and the Agilent 8702E outputs a one (1).
As another example, consider the timing of sweep completion. Send the com­mand string the Agilent 8702E sweep time to 3 seconds, and then waits for completion of a single sweep to respond with a one (1). The computer is programmed to read the one (1) response from the Agilent 8702E as the completion of the single sweep. The program then waits until the sweep is completed before continu­ing operation. At this point a valid trace exists and the trace data can be read into the computer.
OPC
OPC?
or
SWET 3 S;OPC?;SING;
prior to an OPC-compatible command. The status byte
OPC SING
to the Agilent 8702E. This string sets
causes the OPC bit to
OPC?
, in place of
OPC?;
will not cause an
error, but the
OPC?;PRES;
OPC
, causes
, and then
OPC-compatible commands delay execution of other commands
The Agilent 8702E cannot process other commands while executing OPC­compatible commands. Once an OPC-compatible command is received, the Agilent 8702E reads new commands into the input buffer, but it will not begin
1-22
Writing Programs
Controlling Command Execution
the execution of any commands until the completion of the OPC-compatible command. When the 15-character input buffer is full, the Agilent 8702E holds off the bus until it is able to process the commands in the buffer.
Table 1-6. OPC-Compatible Commands
CHAN HARM REFD
a
CLASS CLEARALL ISOD
DATI MANTRIG RST DONE NOOP SAV EDITDONE NUMG SAVC EXTTOFF PRES SAVE EXTTON RAID SAVEREG EXTTPOIN
FREQOFF
a
FWDI
a
FWDM
a. The CLASS commands are OPC-compatible if there is only one standard in the class.
INSM RESPDONE
a
REV
RAIRESP
RAIISOL
a
a
SING
STAN
RECA TRAD
RECAREG WAIT
1-23
Writing Programs

Calibrating for Measurements

Calibrating for Measurements
Measurement calibration over GPIB follows the same command sequence as a calibration from the front panel. Since different cal kits can have a different number of standards in a given class, any automated calibration sequence is valid only for a specific cal kit. Table 1-7 on page 1-25 indicates the relation- ship between calibration and classes. Table 1-8 on page 1-25 describes the cal­ibration arrays.
To calibrate the instrument
1
Select a calibration kit, such as 50 ohm type N (
CALKN50
over GPIB). Load a calibration standard definition from disk or enter the coefficients for O/E and E/O measurements.
2
Select a calibration type, such as S
3
Call each class used by the calibration type, such as
CLASS11A
(
over GPIB). During a 2-port calibration, the reflection,
1-port (
11
CALIS111
FORWARD: OPEN
over GPIB).
transmission, and isolation subsequences must be opened before the classes in the subsequence are called and then closed at the end of each subsequence.
4
If a class has more than one standard in it, select a standard from the menu presented (
5
The
STANA
STANA
STANG
to
STANG
to
over GPIB).
commands are all held commands because they trigger a sweep. If a class has only one standard, that means it will trigger a sweep when called. The class command will be held, also.
6
If, during a calibration, two standards are measured to satisfy one class, the class must be closed with
7
Declare the calibration done, such as with
DONE;
.
DONE 1-PORT CAL (SAV1
over
GPIB).
1-24
Table 1-7. Relationship Between Calibration and Classes
Writing Programs
Calibrating for Measurements
Response
Class Response
and Isolation
a
Reflection
: S11A, RE FW MTCH • S11B, LN FW MTCH • S11C, LN FW TRAN • S22A, LN RV MTCH • S22B, LN RV TRAN • S22C, LN RV TRAN
S11 1-port
S22 1-port
One path 2-port
Full 2­port
TRL*/ LRM*
•••
Response and Match E/O
Response and Match O/E
Transmission:
Forward match • Forward trans • Reverse match • Reverse trans
a.
Isolation:
Forward • • Reverse •
•••
Response • Response and isolation:
Response • Isolation •
a. These subheadings must be called when doing 2-port calibrations.
Table 1-8. Calibration Arraysa
Array Response
1ER or ET
2E
3 E
4E
5E
6E
7 E
8 E
b
Response and Isolation
d
E
(ED)
X
(ER)ESFE
T
Response and Match E/O
E
DF
RF
XF
TF
Response and Match O/E
E
DR
SR
E
RR
E
XF
E
LF
TF
1-port
E
D
E
S
E
R
2-port
E
DF
E
SF
E
RF
E
XF
E
LF
E
TF
DR
SR
c
TRL*/LRM*
EDF
ESF
ERF
E
XF
ELF
ETF
E
DR
ESR
1-25
Writing Programs
Calibrating for Measurements
Table 1-8. Calibration Arraysa
Array Response
9 E
10 E
11 E
12 E
a. Meaning of first subscript: D=directivity, S=source match, R=reflection tracking, X=crosstalk, L=load match, T=transmission tracking. b. Meaning of second subscript: F=forward, R=reverse. c. One path, 2-port cal duplicates arrays 1 to 6 in arrays 7 to 12. d. Response and isolation corrects for crosstalk and transmission tracking in transmission measurements, and for directivity and reflection
tracking in reflection measurements.
b
Response and Isolation
Response and Match E/O
Response and Match O/E
1-port
2-port
RR
XR
LR
TR
c
TRL*/LRM*
ERR
EXR
ELR
ETR
1-26
Loading...
+ 296 hidden pages