Agilent 8702D Programmers Guide

Programmer’s Guide
HP 8702D Lightwave Component Analyzer
© Copyright Hewlett-Packard Company 1997 All Rights Reserved. Repro­duction, adaptation, or trans­lation without prior written permission is prohibited, except as allowed under copy­right laws.
HP Part No. 08702-90042 Printed in USA April 1997
Hewlett-Packard Company Lightwave Operations 1400 Fountaingrove Parkway Santa Rosa, CA 95403-1799, USA (707) 577-1400
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. Hewlett-Packard 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. 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.
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.
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.
WARNING
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.
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
The HP 8702D—At a Glance
The HP 8702D—At a Glance
HP 8702D Programmer’s Guide
The ment. The programming syntax conforms to the
tal Interface for Programmable Instrumentation
Chapter 1, “Writing Programs” provides information on addressing the instru­ment, debugging programs, and other important tasks. Each programming command is documented in Chapter 3, “Language Reference”. Chapter 4, “Graphics Language Reference” documents graphics commands for drawing objects on the display. Refer to Chapter 2, “Examples” for a list of practical examples using common measurement tasks.
shows you how to program the instru-
IEEE 488.2 Standard Digi-
.
iii
The HP 8702D—At a Glance
iv
The HP 8702D—At a Glance iii
1 Writing Programs
General Information 1-4 Selecting the HP-IB Device Mode 1-9 Making Measurements 1-11 Reading Data 1-14 Data-Processing Chain 1-21 Controlling Command Execution 1-25 Calibrating for Measurements 1-27 Debugging Programs 1-30 Understanding File Names 1-31 Drawing Graphics on the Display 1-33 Monitoring the Instrument 1-34 Response to IEEE-488 Universal Commands 1-40

Contents

2 Examples
Preparing Measurement Settings 2-4 Verifying Measurement Settings 2-6 S11 1-Port Measurement Calibration 2-8 Full 2-Port Measurement Calibration 2-13 Data Transfer Using Markers 2-18 Data Transfer Using ASCII Format 2-22 Data Transfer Using Floating-Point Numbers 2-25 Data Transfer Using Frequency-Array Information 2-28 Data Transfer Using Internal Binary Format 2-32 Using Error Queue 2-34 Generating Interrupts 2-37 Power Meter Calibration 2-41 Using the Learn String 2-45 Reading Calibration Data 2-48 Using Instrument States 2-52 Setting a List Frequency Sweep 2-56 Selecting a Single Segment 2-61 Setting up Limit Lines 2-65 Performing Pass/Fail Tests 2-69 Operation Using Talker/Listener Mode 2-73
Contents-1
Contents
Controlling Peripherals 2-76 Printing Via the Serial Port 2-80 Plotting Data 2-83 Reading Plot Files from Disk 2-86 Reading ASCII Instrument Files 2-94
3 Language Reference
4 Graphics Language Reference
5 Tables and Charts
HP-IB Requirements 5-3 Programming Commands by Functional Group 5-8 Key Definitions 5-26
Contents-2
1

Writing Programs

Writing Programs
Writing Programs
Writing Programs
This chapter provides a general introduction to programming the HP 8702D. 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 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-26 to locate the equivalent programming command.
NOTE:
HP 8702D User’s Guide
. Once you
The HP 8702D conforms to IEEE 488.1 and IEC-625 standards for interfacing instruments.
1-2
What you’ll find in this chapter
General Information 1-4
To select the communication mode 1-8 To change the HP-IB address 1-8
Selecting the HP-IB Device Mode 1-9
To change the HP-IB device mode 1-10 Making Measurements 1-11 Reading Data 1-14 Data-Processing Chain 1-21 Controlling Command Execution 1-25 Calibrating for Measurements 1-27
To calibrate the instrument 1-27 Debugging Programs 1-30
To start debugging mode 1-30 Understanding File Names 1-31 Drawing Graphics on the Display 1-33 Monitoring the Instrument 1-34 Response to IEEE-488 Universal Commands 1-40
Writing Programs
Writing Programs
1-3
Writing Programs

General Information

General Information
The HP 8702D occupies two HP-IB 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-33. These addresses are stored in short-term, non-volatile memory and are not affected when you
PRESET
press 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 HP 8702D is being used in pass-control mode. This is the address that control is passed back to when the HP 8702D-controlled opera­tion is complete.
You can change the HP-IB address from the front panel as described in “To change the HP-IB address” on page 1-8.
or cycle the power. The default address for the HP 8702D is
HP-IB status lights
When the HP 8702D is connected to the HP-IB, the front-panel HP-IB status lights indicate the current status of the HP 8702D. These lights have the fol­lowing definitions:
R = Remote operation
L = Listen mode
T = Talk mode
S = Service request (SRQ) asserted by the HP 8702D
Remote mode and front-panel lockout
Whenever the instrument is controlled by a computer, the front-panel HP-IB remote status light, R, is turned on, and the instrument keys are disabled. Press 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 HP 8702D commands; they control HP-IB control lines and do not send any characters to the HP 8702D.
1-4
LOCAL
key to restore front panel control of the instrument.
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 HP-IB address. Pressing the
PRE-
defined preset state.
Rules for writing commands
The HP 8702D accepts letters, changing lowercase to uppercase, numbers, 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 HP 8702D 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 lowercase letters are acceptable.
1-5
Writing Programs
General Information
Table 1-1. Terminator Codes
S Seconds HZ Hertz
MS Milliseconds KHZ Kilohertz
US Microseconds MHZ Megahertz
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 HP 8702D to recover to the next command in the event of a syntax error. The semicolon (;) is the recommended command terminator. The line-feed charac­ter (LF) and the HP-IB EOI line can also be used as terminators. Again, the HP 8702D will ignore the carriage-return character (CR).
1-6
General Information
.
Table 1-2. HP-IB 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.
Writing Programs
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-7
Writing Programs
General Information

To select the communication mode

1
Press the
2
Press
LOCAL
key.
TALKER/LISTENER
so that this softkey is underlined.

To change the HP-IB address

1
Press the
2
Press
3
Press
4
Use the front-panel knob or keys to enter the new HP-IB address.
LOCAL
key.
SET ADDRESSES.
ADDRESS: 8702
.
1-8
Writing Programs

Selecting the HP-IB Device Mode

Selecting the HP-IB Device Mode
Three different device modes are possible for the HP 8702D:
• 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.
Tal k er /li st e ne r mo d e
This is the mode that is normally used for remote programming of the HP 8702D. In talker/listener mode, the HP 8702D and all peripheral devices are controlled from an external instrument controller. The controller can com­mand the HP 8702D to talk and other devices to listen. The HP 8702D and peripheral devices cannot talk directly to each other unless the computer sets up a data path between them. This mode allows the HP 8702D to act as either a talker or a listener, as required by the controlling computer for the particular operation in progress.
While in this mode, the HP 8702D can make a plot or print using the
PLOT;
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 HP 8702D will wait until it is
PRINALL;
and
require control to be passed to another
OUTP-
System-controller mode
Do not attempt to use this mode for programming. This mode allows the HP 8702D to control peripherals directly in a stand-alone environment (with­out an external controller). This mode can only be selected manually from the HP 8702D’s front panel. It can only be used if no active computer or instru­ment controller is connected to the system via HP-IB. If an attempt is made to set the HP 8702D to the system-controller mode when another controller is
1-9
Writing Programs
Selecting the HP-IB Device Mode
connected to the interface, the following message is displayed on the HP 8702D’s display screen:
ON HP-IB"
The HP 8702D must be set to the system-controller mode in order to access peripherals from the front panel. In this mode, the HP 8702D can directly con­trol peripherals (for example, plotters, printers, disk drives, and power meters) and the HP 8702D may plot, print, store on disk or perform power meter functions.
Pass-control mode
This mode allows the computer to control the HP 8702D via HP-IB (as with the talker/listener mode), but also allows the HP 8702D to take control of the interface in order to plot, print, or access a disk. During an HP 8702D-con­trolled peripheral operation, the host computer is free to perform other inter­nal tasks (for example, data or display manipulation) while the HP 8702D is controlling the bus. After the HP 8702D-controlled task is completed, the HP 8702D returns control to the system controller.
In pass-control mode, the HP 8702D can request control from the system con­troller and take control of the bus if the controller addresses it to take control. This allows the HP 8702D to take control of printers, plotters, and disk drives on an as-needed basis. The HP 8702D sets event-status-register bit 1 when it needs control of the interface, and the HP 8702D will transfer control back to the system controller at the completion of the operation. It will pass control back to its controller address, specified by ADDRCONT.
.
"CAUTION: ANOTHER SYSTEM CONTROLLER

To change the HP-IB device mode

1
Press the
2
Press
1-10
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
• IF 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-45.
1-11
Writing Programs
Making Measurements
Step 2. Calibrating the test setup
After you have defined an instrument state, you should perform a measure­ment calibration. Although it is not required for the measurement of O/E and E/O devices, a measurement calibration is required to obtain useful measure­ments.
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-13.
• Transfer the calibration data from a previous calibration back into the analyzer, as discussed in “Using Instrument States” on page 2-52.
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 insure a valid sweep. When you use this command, the analyzer completes all stimulus changes before starting the sweep, and does not release the HP-IB 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 completed.
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.
1-12
Writing Programs
Making Measurements
Step 5. Post-processing the measurement data
Figure 1-1 on page 1-22 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 toensure that the data transmitted reflects the current state of the instru­ment.
1-13
Writing Programs

Reading Data

Reading Data
Output queue
Whenever a output-data command is received, the HP 8702D puts the data into the output queue (or buffer) where it is held until the system controller 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 HP 8702D.
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 HP 8702D’s front panel. The computer can ascertain the new power level using the HP 8702D’s command­interrogate function. If a question mark is appended to the root of a command, the HP 8702D will output the value of that function. For instance,
POWE 7 DB;
RF source power at the test port. When the HP 8702D receives prepares to transmit the current RF source power level. This condition illumi­nates the HP 8702D front-panel talk light (T). In this case, the HP 8702D 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 HP 8702D 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 the HP 8702D. If dual-channel display is switched ON, the HP 8702D will return a one (1) to the instrument controller.
sets the source power to 7 dB, and
POWE?;
outputs the current
POWE?;
, it
DUAC?;
to
1-14
Writing Programs
Reading Data
Similarly, to determine if phase is being measured and displayed, send the command string
PHAS?;
to the HP 8702D. In this case, the HP 8702D 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 HP 8702D 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-15
Writing Programs
Reading Data
Marker data
The HP 8702D offers several options for outputting trace-related data. Trace information can be read out of the HP 8702D 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 HP 8702D can be programmed to choose the stimulus value by using the or bandwidths search can be automatically determined with
MARKER SEARCH
function. Maximum, minimum, target value,
MARKER SEARCH
To continually update the search, switch the marker tracking ON. The 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 HP 8702D. This set of commands causes the HP 8702D 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 fre­quency. Refer to “Units as a Function of Display Format” on page 1-17 for a complete listing of all the possibilities for values 1 and 2. The three possibili­ties for the third parameter are:
•frequency
• time (as in time domain)
• CW time
1-16
Table 1-4. Units as a Function of Display Format
OUTPMARK OUTPFORM Marker Readout
Display Format Marker Mode
Value 1 Value 2 Value 1 Value 2 Value
Writing Programs
Reading Data
AUX
Value
LOG MAG dB dB dB
PHASE degrees degrees
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
Siemens
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.
imag
Siemens
real imag real
degrees
seconds
Siemens
imag
Siemens
1-17
Writing Programs
Reading Data
Array-data formats
The HP 8702D can transmit and receive arrays in the HP 8702D’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, or non-array transfers, such as com­mand interrogate, or output marker values. A transmitted array will be output in the current format, and the HP 8702D 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 HP 8702D’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 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 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.
"#A"
,
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 HP 8702D 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-15. There is no header. The HP 8702D uses FORM 4 to transfer data that is not related to array transfers (for example, 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 HP 8702D terminates each transmission by asserting the EOI interface line with the last byte transmitted. Table 1-5 on page 1-19 offers a comparative overview of the five array-data formats.
1-18
Table 1-5. HP 8702D/Option 011 Array-Data Formats
Writing Programs
Reading Data
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 10,050
5 PC-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
Point
a
Bytes per 201
Point Trace
Trace-data transfers
Transferring trace data from the HP 8702D using an instrument controller can be divided into three steps:
1
allocating an array to receive and store the data
2
commanding the HP 8702D to transmit the data
3
accepting the transferred data
Total Bytes
with Header
b
Data residing in the HP 8702D 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 HP 8702D 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 HP 8702D can transmit data over HP-IB in five dif­ferent 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 trans­ferred. “Data Transfer Using Markers” on page 2-18 illustrates an ASCII trans­fer using Form 4. For more information on the various data formats, refer to “Array-data formats” on page 1-18. 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-23.
1-19
Writing Programs
Reading Data
Frequency-related arrays
Frequency-related values are calculated for the HP 8702D 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 easily calculated because the trace 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-18.
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-28 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 HP 8702D 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-20
Writing Programs

Data-Processing Chain

Data-Processing Chain
This section describes the manner in which the HP 8702D processes measure­ment data. It includes information on data arrays, common output commands, data levels, the learn string, and the calibration kit string.
Data arrays
Figure 1-1 on page 1-22 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.
OUTPMEMO;
, but it
1-21
Writing Programs
Data-Processing Chain
Figure 1-1. The data-processing chain
All the data-output commands are designed to insure 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
insures 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 sta­tistics.
1-22
Writing Programs
Data-Processing Chain
OUTPMWID
insures 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 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-22.
The following list describes the different types of data that are available from the HP 8702D.
Raw data
Error-corrected data
Formatted data
The basic measurement data, reflecting the stimulus parameters, IF averag­ing, and IF bandwidth. If a full 2-port measurement calibration 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
OUTPRAW3, OUTPRAW4
. Normally, only raw 1 is available, and it holds the cur-
OUTPRAW1, OUTPRAW2
rent parameter. If a 2-port measurement calibration is active, the four arrays refer to S
, S21, S12, and S22 respectively. This data is represented in real/
11
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 mand. The
OUTPMEMO;
command reads the trace memory, if available. The
OUTPDATA;
com-
trace memory also contains error-corrected data. Note that neither raw nor error-corrected data reflect such post-processing functions as electrical-delay offset, 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-17 for the various units defined as a function of display format.
,
1-23
Writing Programs
Data-Processing Chain
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
HP 8702D 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.
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 HP 8702D and apply post-processing 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;
execut­able, which commands the HP 8702D to start transmitting the binary string. The string has a fixed length for a given firmware revision. It can not 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 can not be longer than 1000 bytes.
1-24
Loading...
+ 354 hidden pages