No part of this manual may be reproduced in any form or by any means
(including electronic storage and
retrieval or translation into a foreign language) without prior agreement and written consent from Agilent Technologies,
Inc. as governed by United States and
international copyright lays.
Manual Part Number
86100-90065
Edition
First edition, February 2004
Printed in Malaysia
Agilent Technologies, Inc.
Digital Signal Analysis Division
1400 Fountaingrove Parkway
Santa Rosa, CA 95403, USA
Warranty
The material contained in this document
is provided “as is,” and is subject to being
changed, without notice, in future editions. Further, to the maximum extent
permitted by applicable law, Agilent disclaims all warranties, either express or
implied, with regard to this manual and
any information contained herein, including but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Agilent shall not be
liable for errors or for incidental or consequential damages in connection with the
furnishing, use, or performance of this
document or of any information contained herein. Should Agilent and the
user have a separate written agreement
with warranty terms covering the material in this document that conflict with
these terms, the warranty terms in the
separate agreement shall control.
Technology Licenses
The hardware and/or software described
in this document are furnished under a
license and may be used or copied only in
accordance with the terms of such
license.
Departments and Agencies of the U.S.
Government will receive no greater than
Restricted Rights as defined in FAR
52.227-19(c)(1-2) (June 1987). U.S. Government users will receive no greater
than Limited Rights as defined in FAR
52.227-14 (June 1987) or DFAR 252.2277015 (b)(2) (November 1995), as applicable in any technical data.
Safety Notices
CAUTION
Caution denotes a hazard. It calls attention
to a procedure which, if not correctly performed or adhered to, could result in
damage to or destruction of the product.
Do not proceed beyond a caution sign
until the indicated conditions are fully
understood and met.
WARNING
Warning denotes a hazard. It calls attention
to a procedure which, if not correctly 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.
LZW compression/decompression:
Licensed under U.S. Patent No. 4,558,302
and foreign counterparts. The purchase
or use of LZW graphics capability in a
licensed product does not authorize or
permit an end user to use any other product or perform any other method or activity involving use of LZW unless the end
user is separately licensed in writing by
Unisys.
Restricted Rights Legend
If software is for use in the performance
of a U.S. Government prime contract or
subcontract, Software is delivered and
licensed as “Commercial computer software” as defined in DFAR 252.227-7014
(June 1995), or as a “commercial item” as
defined in FAR 2.101(a) or as “Restricted
computer software” as defined in FAR
52.227-19 (June 1987) or any equivalent
agency regulation or contract clause. Use,
duplication or disclosure of Software is
subject to Agilent Technologies’ standard
commercial license terms, and non-DOD
2
Contents
1Introduction
Getting Started Programming 1-12
Interface Functions 1-17
Status Reporting 1-20
Message Communication and System Functions 1-34
Programming Conventions 1-37
Multiple Databases 1-47
Language Compatibility 1-50
New and Revised Commands 1-56
Commands Unavailable in Jitter Mode 1-58
Error Messages 1-60
2Sample Programs
Sample Program Structure 2-3
Sample C Programs 2-4
Listings of the Sample Programs 2-20
3 Common Commands
4 Root Level Commands
5 System Commands
6 Acquire Commands
7 Calibration Commands
8 Channel Commands
9 Clock Recovery Commands
10 Disk Commands
11 Display Commands
12 Function Commands
Contents-1
Contents
13 Hardcopy Commands
14 Histogram Commands
15 Limit Test Commands
16 Marker Commands
17 Mask Test Commands
18 Measure Commands
19 TDR/TDT Commands
20 Timebase Commands
21 Trigger Commands
22 Waveform Commands
23 Waveform Memory Commands
Contents-2
1
Getting Started Programming 1-12
Interface Functions 1-17
Status Reporting 1-20
Message Communication and System Functions 1-34
Programming Conventions 1-37
Multiple Databases 1-47
Language Compatibility 1-50
New and Revised Commands 1-56
Commands Unavailable in Jitter Mode 1-58
Error Messages 1-60
Introduction
Introduction
Introduction
This chapter introduces the basics for remote programming of an analyzer. The programming commands in this manual conform to the IEEE 488.2 Standard Digital Interface for Programmable Instrumentation. The programming commands provide the
means of remote control.
Basic operations that you can do with a computer (GPIB controller) and an analyzer
include:
• Set up the analyzer.
• Make measurements.
• Get data (waveform, measurements, configuration) from the analyzer.
• Send information, such as waveforms and configurations, to the analyzer.
Communicating
with the Analyzer
Other tasks are accomplished by combining these functions.
.
Example Programs are Written in HP BASIC and C
The programming examples for individual commands in this manual are written in HP BASIC and C.
Computers communicate with the analyzer by sending and receiving messages over a
remote interface, usually with GPIB programming. Commands for programming normally appear as ASCII character strings embedded in the output statements of a “host”
language available on your computer. The input commands of the host language are
used to read in responses from the analyzer.
For example, HP BASIC uses the OUTPUT statement for sending commands and queries. After a query is sent, the response is usually read using the HP BASIC ENTER
statement. The ENTER statement passes the value across the bus to the computer and
places it in the designated variable.
For the GPIB interface, messages are placed on the bus using an output command and
passing the device address, program message, and a terminator. Passing the device
address ensures that the program message is sent to the correct GPIB interface and
GPIB device.
This HP BASIC OUTPUT statement sends a command that sets the channel 1 scale
value to 500 mV:
The device address represents the address of the device being programmed. Each of
the other parts of the above statement are explained in the following pages.
Use the Suffix Multiplier Instead
Using "mV" or "V" following the numeric voltage value in some commands will cause
Error 138–Suffix not allowed. Instead, use the convention for the suffix multiplier as described in
“Message Communication and System Functions” on page 1-34.
Output CommandThe output command depends entirely on the programming language. Throughout this
book, HP BASIC and ANSI C are used in the examples of individual commands. If you
are using other languages, you will need to find the equivalents of HP BASIC commands like OUTPUT, ENTER, and CLEAR, to convert the examples.
Device AddressThe location where the device address must be specified depends on the programming
language you are using. In some languages, it may be specified outside the OUTPUT
command. In HP BASIC, it is always specified after the keyword OUTPUT. The examples in this manual assume that the analyzer and interface card are at GPIB device
address 707. When writing programs, the device address varies according to how the
bus is configured.
InstructionsInstructions, both commands and queries, normally appear as strings embedded in a
statement of your host language, such as HP BASIC, Pascal, or C. The only time a
parameter is not meant to be expressed as a string is when the instruction's syntax definition specifies <block data>, such as HP BASIC’s "learnstring" command. There are
only a few instructions that use block data.
Instructions are composed of two main parts:
• The header, which specifies the command or query to be sent.
• The program data, which provides additional information to clarify the meaning
of the instruction.
Instruction
Header
The instruction header is one or more command mnemonics separated by colons (:)
that represent the operation to be performed by the analyzer. See “Programming Conventions” on page 1-37 for more information.
Queries are formed by adding a question mark (?) to the end of the header. Many
instructions can be used as either commands or queries, depending on whether or not
you include the question mark. The command and query forms of an instruction usually have different program data. Many queries do not use any program data.
1-3
Introduction
White Space
(Separator)
White space is used to separate the instruction header from the program data. If the
instruction does not require any program data parameters, you do not need to include
any white space. In this manual, white space is defined as one or more spaces. ASCII
defines a space to be character 32, in decimal.
Program DataProgram data is used to clarify the meaning of the command or query. It provides nec-
essary information, such as whether a function should be on or off or which waveform
is to be displayed. Each instruction's syntax definition shows the program data, and the
values they accept. See “Numeric Program Data” on page 1-7 for more information
about general syntax rules and acceptable values.
When there is more than one data parameter, they are separated by commas (,). You
can add spaces around the commas to improve readability.
Header TypesThere are three types of headers:
• Simple Command headers
• Compound Command headers
• Common Command headers
Simple Command Header
Simple command headers contain a single mnemonic. AUTOSCALE and DIGITIZE are
examples of simple command headers typically used in this analyzer. The syntax is:
<program mnemonic><terminator>
or
OUTPUT 707;”:AUTOSCALE”
When program data must be included with the simple command header (for example,
:DIGITIZE CHAN1), white space is added to separate the data from the header. The
syntax is:
Compound command headers are a combination of two program mnemonics. The first
mnemonic selects the subsystem, and the second mnemonic selects the function
within that subsystem. The mnemonics within the compound message are separated by
colons. For example:
Common command headers, such as clear status, control the IEEE 488.2 functions
within the analyzer. The syntax is:
*<command header><terminator>
No space or separator is allowed between the asterisk (*) and the command header.
*CLS is an example of a common command header.
Duplicate
Mnemonics
Identical function mnemonics can be used for more than one subsystem. For example,
the function mnemonic RANGE may be used to change the vertical range or to change
the horizontal range.
To set the vertical range of channel 1 to 0.4 volts full scale:
:CHANNEL1:RANGE .4
To set the horizontal time base to 1 second full scale:
:TIMEBASE:RANGE 1
CHANNEL1 and TIMEBASE are subsystem selectors, and determine which range is
being modified.
Query HeadersCommand headers immediately followed by a question mark (?) are queries. After
receiving a query, the analyzer interrogates the requested subsystem and places the
answer in its output queue. The answer remains in the output queue until it is read or
until another command is issued. When read, the answer is transmitted across the bus
to the designated listener (typically a computer). For example, the query:
:TIMEBASE:RANGE?
places the current time base setting in the output queue.
In HP BASIC, the computer input statement:
ENTER < device address >;Range
1-5
Introduction
passes the value across the bus to the computer and places it in the variable Range.
You can use query commands to find out how the analyzer is currently configured.
They are also used to get results of measurements made by the analyzer.
For example, the command:
:MEASURE:RISETIME?
tells the analyzer to measure the rise time of your waveform and place the result in the
output queue.
The output queue must be read before the next program message is sent. For example,
when you send the query :MEASURE:RISETIME? you must follow it with an input
statement. In HP BASIC, this is usually done with an ENTER statement immediately
followed by a variable name. This statement reads the result of the query and places
the result in a specified variable.
Handling Queries Properly
If you send another command or query before reading the result of a query, the output buffer is
cleared and the current response is lost. This also generates a query-interrupted error in the error
queue. If you execute an input statement before you send a query, it will cause the computer to wait
indefinitely.
Program Header
Options
You can send program headers using any combination of uppercase or lowercase ASCII
characters. Analyzer responses, however, are always returned in uppercase.
You may send program command and query headers in either long form (complete
spelling), short form (abbreviated spelling), or any combination of long form and short
form. For example:
:TIMEBASE:DELAY 1E-6 is the long form.
:TIM:DEL 1E-6 is the short form.
Using Long Form or Short Form
Programs written in long form are easily read and are almost self-documenting.
The short form syntax conserves the amount of computer memory needed for program storage and
reduces I/O activity.
The rules for the short form syntax are described in “Programming Conventions” on
page 1-37.
1-6
Introduction
Character
Program Data
Numeric Program
Data
Character program data is used to convey parameter information as alpha or alphanumeric strings. For example, the :TIMEBASE:REFERENCE command can be set to left,
center, or right. The character program data in this case may be LEFT, CENTER, or
RIGHT. The command :TIMEBASE:REFERENCE RIGHT sets the time base reference
to right.
The available mnemonics for character program data are always included with the
instruction's syntax definition. Either the long form of commands, or the short form (if
one exists), may be sent. Uppercase and lowercase letters may be mixed freely. When
receiving responses, uppercase letters are used exclusively.
Some command headers require program data to be expressed numerically. For example, :TIMEBASE:RANGE requires the desired full scale range to be expressed numerically.
For numeric program data, you can use exponential notation or suffix multipliers to
indicate the numeric value. The following numbers are all equal:
28 = 0.28E2 = 280E-1 = 28000m = 0.028K = 28E-3K
When a syntax definition specifies that a number is an integer, it means that the number should be whole. Any fractional part is ignored and truncated. Numeric data
parameters that accept fractional values are called real numbers. For more information
see “Interface Functions” on page 1-17.
All numbers are expected to be strings of ASCII characters.
• When sending the number 9, you would send a byte representing the ASCII
code for the character “9” (which is 57).
Embedded Strings
Program Message
Terminator
• A three-digit number like 102 would take up three bytes (ASCII codes 49, 48,
and 50). The number of bytes is figured automatically when you include the entire instruction in a string.
Embedded strings contain groups of alphanumeric characters which are treated as a
unit of data by the analyzer. An example of this is the line of text written to the advisory line of the analyzer with the :SYSTEM:DSP command:
:SYSTEM:DSP ""This is a message.""
You may delimit embedded strings with either single (') or double (") quotation marks.
These strings are case-sensitive, and spaces act as legal characters just like any other
character.
The program instructions within a data message are executed after the program message terminator is received. The terminator may be either a NL (New Line) character,
an EOI (End-Or-Identify) asserted in the GPIB interface, or a combination of the two.
Asserting the EOI sets the EOI control line low on the last byte of the data message.
The NL character is an ASCII linefeed (decimal 10).
1-7
Introduction
New Line Terminator Functions Like EOS and EOT
The NL (New Line) terminator has the same function as an EOS (End Of String) and EOT (End Of Text)
terminator.
Common
Commands within
a Subsystem
Selecting Multiple
Subsystems
Common commands can be received and processed by the analyzer whether they are
sent over the bus as separate program messages or within other program messages. If
you have selected a subsystem, and a common command is received by the analyzer,
the analyzer remains in the selected subsystem. For example, if the program message
":ACQUIRE:AVERAGE ON;*CLS;COUNT 1024"
is received by the analyzer, the analyzer turns averaging on, then clears the status
information without leaving the selected subsystem.
If some other type of command is received within a program message, you must reenter the original subsystem after the command. For example, the program message
turns averaging on, completes the autoscale operation, then sets the acquire average
count. In this example, :ACQUIRE must be sent again after the AUTOSCALE command
to re-enter the ACQUIRE subsystem and set count.
You can send multiple program commands and program queries for different subsystems on the same line by separating each command with a semicolon. The colon following the semicolon lets you enter a new subsystem. For example:
Multiple commands may be any combination of compound and simple commands.
File Names and
Types
When specifying a file name in a remote command, enclose the name in double quotation marks, such as "filename". If you specify a path, the path should be included in the
quotation marks.
You can use the full path name, a relative path name, or no path. For example, you can
specify:
• a full path name: "D:\User Files\waveforms\channel2.wfm"
• a relative path name: "..\myfile.set" or “.\screen1.jpg”
• a simple file name: "Memory1.txt"
1-8
Introduction
All files stored using remote commands have file name extensions.The following table
shows the file name extension used for each file type.
If you do not specify an extension when storing a file, or specify an incorrect extension,
it will be corrected automatically according to the following rules:
• No extension specified: add the extension for the file type.
• Extension does not match file type: retain the filename, (including the current
extension) and add the appropriate extension.
You do not need to use an extension when loading a file if you use the optional destination parameter. For example, :DISK:LOAD "STM1_OC3",SMASK will automatically add
.msk to the file name.
Note
For .gif and .tif file formats, this instrument uses LZW compression/decompression
licensed under U.S. patent No 4,558,302 and foreign counterparts. End user should not
modify, copy, or distribute LZW compression/decompression capability.
For .jpg file format, this instrument uses the .jpg software written by the Independent JPEG Group.
1-9
Introduction
The following table shows the rules used when loading a specified file.
Table 1-2. Rules for Loading Files
File Name ExtensionDestinationRule
No extensionNot specifiedDefault to internal waveform format; add .wfm
extension
Extension does not match
file type
Extension matches file typeNot specifiedUse file name with no alterations; destination is
No extensionSpecifiedAdd extension for destination type; default for
Extension does not match
destination file type
Extension matches
destination file type
Not specifiedDefault to internal waveform format; add .wfm
extension
based on extension file type
waveforms is internal format (.wfm)
SpecifiedRetain file name; add extension for destination
type. Default for waveforms is internal format
(.wfm)
SpecifiedRetain file name; destination is as specified
Note
ASCII waveform files can be loaded only if the file name explicitly includes the .txt extension.
File LocationsIf you don’t specify a directory when storing a file, the location of the file will be based
on the file type. The following table shows the default locations for storing files. On
86100C instruments, files are stored on the D: drive. On 86100A/B instruments, files
are stored on the C: drive.
Table 1-3. Default File Locations for Storing Files (1 of 2)
File TypeDefault Location
Waveform - internal formatD:\User Files\waveforms
Waveform - text format (Verbose or Y values)D:\User Files\waveforms
SetupD:\User Files\setups
Color Grade - Gray ScaleD:\User Files\colorgrade-grayscale
Jitter MemoryD:\User Files\jitter data
Screen ImageD:\User Files\screen images
MaskC:\Scope\masks (standard masks)
D:\User Files\masks (user-defined masks)
1-10
Introduction
Table 1-3. Default File Locations for Storing Files (2 of 2)
When loading a file, you can specify the full path name, a relative path name, or no path
name. The following table shows the rules for locating files, based on the path specified.
Table 1-4. File Locations (Loading Files)
File NameRule
Full path nameUse file name and path specified
Relative path nameFull path name is formed relative to the present
working directory, set with the command
:DISK:CDIR. The present working directory can be
read with the query :DISK:PWD?
File name with no preceding pathAdd the file name to the default path
(D:\User Files) based on the file type.
Standard masks loaded from C:\Scope\masks. Files may be stored to or loaded from
any path external drive or on any mapped network drive.
1-11
Introduction
Getting Started Programming
Getting Started Programming
The remainder of this chapter discusses how to set up the analyzer, how to retrieve
setup information and measurement results, how to digitize a waveform, and how to
pass data to the computer. Chapter 18, “Measure Commands” describes sending measurement data to the analyzer.
InitializationTo make sure the bus and all appropriate interfaces are in a known state, begin every
program with an initialization statement. For example, HP BASIC provides a CLEAR
command which clears the interface buffer:
CLEAR 707 ! initializes the interface of the analyzer
When you are using GPIB, CLEAR also resets the analyzer's parser. The parser is the
program that reads in the instructions you send.
After clearing the interface, initialize the analyzer to a preset state:
OUTPUT 707;"*RST" ! initializes the analyzer to a preset state
Initializing the analyzer
The commands and syntax for initializing the analyzer are discussed in Chapter 3, “Common Commands”. Refer to your GPIB manual and programming language reference manual for information on
initializing the interface.
Autoscale
The AUTOSCALE feature of Agilent Technologies digitizing analyzers performs a very
useful function on unknown waveforms by automatically setting up the vertical channel, time base, and trigger level of the analyzer.
The syntax for the autoscale function is:
:AUTOSCALE<terminator>
Setting Up the Analyzer
A typical analyzer setup configures the vertical range and offset voltage, the horizontal
range, delay time, delay reference, trigger mode, trigger level, and slope.
A typical example of the commands sent to the analyzer are:
This example sets the time base at 1 ms full-scale (100 µs/div), with delay of 100 µs.
Vertical is set to 16 V full-scale (2 V/div), with center of screen at 1 V, and probe attenuation of 10.
Example ProgramThis program demonstrates the basic command structure used to program the ana-
lyzer.
10 CLEAR 707 ! Initialize analyzer interface
20 OUTPUT 707;"*RST" !Initialize analyzer to preset state
30 OUTPUT 707;":TIMEBASE:RANGE 5E-4"! Time base to 500 us full scale
40 OUTPUT 707;":TIMEBASE:DELAY 25E-9"! Delay to 25 ns
50 OUTPUT 707;":TIMEBASE:REFERENCE CENTER"! Display reference at center
60 OUTPUT 707;":CHANNEL1:RANGE .16"! Vertical range to 160 mV full scale
70 OUTPUT 707;":CHANNEL1:OFFSET -.04"! Offset to -40 mV
80 OUTPUT 707;":TRIGGER:LEVEL,-.4"! Trigger level to -0.4
90 OUTPUT 707;":TRIGGER:SLOPE POSITIVE"! Trigger on positive slope
100 OUTPUT 707;":SYSTEM:HEADER OFF"<terminator>
110 OUTPUT 707;":DISPLAY:GRATICULE FRAME"! Grid off
120 END
Overview of the Program
• Line 10 initializes the analyzer interface to a known state.
• Line 20 initializes the analyzer to a preset state.
Using the
DIGITIZE
Command
• Lines 30 through 50 set the time base, the horizontal time at 500
µs full scale,
and 25 ns of delay referenced at the center of the graticule.
• Lines 60 through 70 set the vertical range to 160 millivolts full scale and the
center screen at
• Lines 80 through 90 configure the analyzer to trigger at
−40 millivolts.
−0.4 volts with normal
triggering.
• Line 100 turns system headers off.
• Line 110 turns the grid off.
The DIGITIZE command is a macro that captures data using the acquisition
(ACQUIRE) subsystem. When the digitize process is complete, the acquisition is
stopped. The captured data can then be measured by the analyzer or transferred to the
computer for further analysis. The captured data consists of two parts: the preamble
and the waveform data record.
After changing the analyzer configuration, the waveform buffers are cleared. Before
doing a measurement, the DIGITIZE command should be sent to ensure new data has
been collected.
You can send the DIGITIZE command with no parameters for a higher throughput.
Refer to the DIGITIZE command in Chapter 4, “Root Level Commands” for details.
1-13
Introduction
Getting Started Programming
When the DIGITIZE command is sent to an analyzer, the specified channel’s waveform
is digitized with the current ACQUIRE parameters. Before sending the :WAVEFORM:DATA? query to get waveform data, specify the WAVEFORM parameters.
The number of data points comprising a waveform varies according to the number
requested in the ACQUIRE subsystem. The ACQUIRE subsystem determines the number of data points, type of acquisition, and number of averages used by the DIGITIZE
command. This allows you to specify exactly what the digitized information contains.
The following program example shows a typical setup:
This setup places the analyzer to acquire eight averages. This means that when the
DIGITIZE command is received, the command will execute until the waveform has
been averaged at least eight times.
After receiving the :WAVEFORM:DATA? query, the analyzer will start passing the waveform information when queried.
Digitized waveforms are passed from the analyzer to the computer by sending a numerical representation of each digitized point. The format of the numerical representation
is controlled with the :WAVEFORM:FORMAT command and may be selected as BYTE,
WORD, or ASCII.
The easiest method of entering a digitized waveform depends on data structures, available formatting, and I/O capabilities. You must scale the integers to determine the voltage value of each point. These integers are passed starting with the leftmost point on
the analyzer's display. For more information, refer to Chapter 22, “Waveform Commands”.
When using GPIB, a digitize operation may be aborted by sending a Device Clear over
the bus (for example, CLEAR 707).
Receiving
Information from
the Analyzer
Note
The execution of the DIGITIZE command is subordinate to the status of ongoing limit tests. (See
commands ACQuire:RUNTil on page 6-5, MTEST:RUNTil on page 17-10, and LTEST:RUNTil on page
15-5.) The DIGITIZE command will not capture data if the stop condition for a limit test has been
met.
After receiving a query (command header followed by a question mark), the analyzer
places the answer in its output queue. The answer remains in the output queue until it
is read or until another command is issued. When read, the answer is transmitted
across the interface to the computer. The input statement for receiving a response
1-14
Introduction
Getting Started Programming
message from an analyzer's output queue typically has two parameters; the device
address and a format specification for handling the response message. For example, to
read the result of the query command :CHANNEL1:RANGE? you would execute the
HP BASIC statement:
ENTER <device address>;Setting$
The device address parameter represents the address of the analyzer. This would enter
the current setting for the range in the string variable Setting$.
All results for queries sent in a program message must be read before another program
message is sent. For example, when you send the query :MEASURE:RISETIME?, you
must follow that query with an input statement. In HP BASIC, this is usually done with
an ENTER statement.
Handling Queries Properly
If you send another command or query before reading the result of a query, the output buffer will be
cleared and the current response will be lost. This will also generate a query-interrupted error in the
error queue. If you execute an input statement before you send a query, it will cause the computer to
wait indefinitely.
The format specification for handling response messages depends on both the computer and the programming language.
String Variable
Example
Numeric Variable
Example
The output of the analyzer may be numeric or character data, depending on what is
queried. Refer to the specific commands for the formats and types of data returned
from queries.
For the example programs, assume that the device being programmed is at device
address 707. The actual address depends on how you have configured the bus for your
own application.
In HP BASIC 5.0, string variables are case-sensitive, and must be expressed exactly the
same way each time they are used. This example shows the data being returned to a
string variable:
10 DIM Rang$[30]
20 OUTPUT 707;":CHANNEL1:RANGE?"
30 ENTER 707;Rang$
40 PRINT Rang$
50 END
After running this program, the computer displays:
+8.00000E-01
This example shows the data being returned to a numeric variable:
10 OUTPUT 707;":CHANNEL1:RANGE?"
20 ENTER 707;Rang
1-15
Introduction
Getting Started Programming
30 PRINT Rang
40 END
After running this program, the computer displays:
.8
Definite-Length
Block Response
Data
Definite-length block response data allows any type of device-dependent data to be
transmitted over the system interface as a series of 8-bit binary data bytes. This is particularly useful for sending large quantities of data or 8-bit extended ASCII codes. The
syntax is a pound sign (#) followed by a non-zero digit representing the number of digits in the decimal integer. After the non-zero digit is the decimal integer that states the
number of 8-bit data bytes being sent. This is followed by the actual data.
For example, for transmitting 4000 bytes of data, the syntax would be:
#44000 <4000 bytes of data> <terminator>
The leftmost “4” represents the number of digits in the number of bytes, and “4000”
represents the number of bytes to be transmitted.
Multiple QueriesYou can send multiple queries to the analyzer within a single program message, but you
must also read them back within a single program message. This can be accomplished
by either reading them back into a string variable or into multiple numeric variables.
For example, you could read the result of the query :TIMEBASE:RANGE?;DELAY? into
the string variable Results$ with the command:
ENTER 707;Results$
When you read the result of multiple queries into string variables, each response is separated by a semicolon. For example, the response of the query :TIMEBASE:RANGE?;DELAY? would be:
<range_value>;<delay_value>
Use the following program message to read the query :TIMEBASE:RANGE?;DELAY?
into multiple numeric variables:
ENTER 707;Result1,Result2
Analyzer StatusStatus registers track the current status of the analyzer. By checking the analyzer sta-
tus, you can find out whether an operation has completed, is receiving triggers, and
more. “Status Reporting” on page 1-20 explains how to check the status of the analyzer.
1-16
Introduction
Interface Functions
Interface Functions
The interface functions deal with general bus management issues, as well as messages
that can be sent over the bus as bus commands. In general, these functions are defined
by IEEE 488.1.
GPIB Interface
Connector
The analyzer is equipped with a GPIB interface connector on the rear panel. This
allows direct connection to a GPIB equipped computer. You can connect an external
GPIB compatible device to the analyzer by installing a GPIB cable between the two
units. Finger tighten the captive screws on both ends of the GPIB cable to avoid accidentally disconnecting the cable during operation.
A maximum of fifteen GPIB compatible instruments (including a computer) can be
interconnected in a system by stacking connectors. This allows the analyzers to be connected in virtually any configuration, as long as there is a path from the computer to
every device operating on the bus.
CAUTIONAvoid stacking more than three or four cables on any one connector. Multiple
connectors produce leverage that can damage a connector mounting.
GPIB Default
Startup
Conditions
The following default GPIB conditions are established during power-up: 1) The
Request Service (RQS) bit in the status byte register is set to zero. 2) All of the event
registers, the Standard Event Status Enable Register, Service Request Enable Register,
and the Status Byte Register are cleared.
1-17
Introduction
Interface Functions
Interface
Capabilities
The interface capabilities of this analyzer, as defined by IEEE 488.1, are listed in the
following table.
Table 1-5. Interface Capabilities
CodeInterface FunctionCapability
SH1Source HandshakeFull Capability
AH1Acceptor HandshakeFull Capability
T5Talker Basic Talker/Serial Poll/Talk Only Mode/
Unaddress if Listen Address (MLA)
L4Listener Basic Listener/
Unaddresses if Talk Address (MTA)
SR1Service RequestFull Capability
RL1Remote LocalComplete Capability
PP1Parallel PollRemote Configuration
DC1Device ClearFull Capability
DT1Device TriggerFull Capability
C0ComputerNo Capability
E2Driver ElectronicsTri State (1 MB/SEC MAX)
Command and
Data Concepts
Communicating
Over the Bus
The GPIB has two modes of operation, command mode and data mode. The bus is in
the command mode when the Attention (ATN) control line is true. The command
mode is used to send talk and listen addresses and various bus commands such as
group execute trigger (GET).
The bus is in the data mode when the ATN line is false. The data mode is used to convey device-dependent messages across the bus. The device-dependent messages
include all of the analyzer specific commands, queries, and responses found in this
manual, including analyzer status information.
Device addresses are sent by the computer in the command mode to specify who talks
and who listens. Because GPIB can address multiple devices through the same interface card, the device address passed with the program message must include the correct interface select code and the correct analyzer address.
The examples in this manual assume that the analyzer is at device address 707.
Interface Select Code
Each interface card has a unique interface select code. This code is used by the computer to direct commands and communications to the proper interface. The default is
typically “7” for GPIB interface cards.
Analyzer Address
Each analyzer on the GPIB must have a unique analyzer address between decimal 0
and 30. This analyzer address is used by the computer to direct commands and communications to the proper analyzer on an interface. The default is typically “7” for this
analyzer. You can change the analyzer address in the Utilities, Remote Interface dialog
box.
Do Not Use Address 21 for an Analyzer Address
Address 21 is usually reserved for the Computer interface Talk/Listen address and should not be
used as an analyzer address.
Bus Commands
The following commands are IEEE 488.1 bus commands (ATN true). IEEE 488.2
defines many of the actions that are taken when these commands are received by the
analyzer.
Device Clear
The device clear (DCL) and selected device clear (SDC) commands clear the input
buffer and output queue, reset the parser, and clear any pending commands. If either
of these commands is sent during a digitize operation, the digitize operation is aborted.
Group Execute Trigger
The group execute trigger (GET) command arms the trigger. This is the same action
produced by sending the RUN command.
Interface Clear
The interface clear (IFC) command halts all bus activity. This includes unaddressing all
listeners and the talker, disabling serial poll on all devices, and returning control to the
system computer.
1-19
Introduction
Status Reporting
Status Reporting
An overview of the analyzer's status reporting structure is shown in the following figure. The status reporting structure shows you how to monitor specific events in the
analyzer. Monitoring these events allows determination of the status of an operation,
the availability and reliability of the measured data, and more.
• To monitor an event, first clear the event, then enable the event. All of the
events are cleared when you initialize the analyzer.
• To generate a service request (SRQ) interrupt to an external computer, enable
at least one bit in the Status Byte Register.
The Status Byte Register, the Standard Event Status Register group, and the Output
Queue are defined as the Standard Status Data Structure Model in IEEE 488.2-1987.
IEEE 488.2 defines data structures, commands, and common bit definitions for status
reporting. There are also analyzer-defined structures and bits.
Status Reporting
Data Structures
The different status reporting data structures, descriptions, and interactions are shown
in the following figure. To make it possible for any of the Standard Event Status Register bits to generate a summary bit, the corresponding bits must be enabled. These bits
are enabled by using the *ESE common command to set the corresponding bit in the
Standard Event Status Enable Register.
To generate a service request (SRQ) interrupt to the computer, at least one bit in the
Status Byte Register must be enabled. These bits are enabled by using the *SRE common command to set the corresponding bit in the Service Request Enable Register.
These enabled bits can then set RQS and MSS (bit 6) in the Status Byte Register.
For more information about common commands, see Chapter 3, “Common Commands”.
1-20
Introduction
Status Reporting
Figure 1-1. Status Reporting Overview Block Diagram
The status reporting structure consists of the registers shown in this figure.
The following table lists the bit definitions for each bit in the status reporting data
structure.
Table 1-6. Status Reporting Bit Definition (1 of 3)
BitDescriptionDefinition
PONPower OnIndicates power is turned on.
1-21
Introduction
Status Reporting
Table 1-6. Status Reporting Bit Definition (Continued) (2 of 3)
BitDescriptionDefinition
URQNot used. Permanently set to zero.
CMECommand ErrorIndicates if the parser detected an error.
EXEExecution ErrorIndicates if a parameter was out of range or was
inconsistent with the current settings.
DDEDevice Dependent ErrorIndicates if the device was unable to complete an
operation for device dependent reasons.
QYEQuery ErrorIndicates if the protocol for queries has been violated.
RQLRequest ControlIndicates if the device is requesting control.
OPCOperation CompleteIndicates if the device has completed all pending
operations.
OPEROperation Status
Register
RQSRequest ServiceIndicates that the device is requesting service.
MSSMaster Summary StatusIndicates if a device has a reason for requesting service.
ESBEvent Status BitIndicates if any of the enabled conditions in the Standard
MAV Message AvailableIndicates if there is a response in the output queue.
MSGMessageIndicates if an advisory has been displayed.
USRUser Event RegisterIndicates if any of the enabled conditions have occurred
TRGTriggerIndicates if a trigger has been received.
LCLLocalIndicates if a remote-to-local transition occurs.
FAILFailIndicates the specified test has failed.
COMPCompleteIndicates the specified test has completed.
LTESTLimit TestIndicates that one of the enabled conditions in the Limit
MTESTMask TestIndicates that one of the enabled conditions in the Mask
Indicates if any of the enabled conditions in the
Operation Status Register have occurred.
Event Status Register have occurred.
in the User Event Register.
Test Register has occurred.
Test Register has occurred.
1-22
Introduction
Status Reporting
Table 1-6. Status Reporting Bit Definition (Continued) (3 of 3)
BitDescriptionDefinition
ACQAcquisitionIndicates that acquisition test has completed in the
Acquisition Register.
CLCKCloCkIndicates that one of the enabled conditions in the Clock
Recovery Register has occurred.
UNLKUNLoCKedIndicates that an unlocked or trigger loss condition has
occurred in the Clock Recovery Module.
LOCKLOCKedIndicates that a locked or trigger capture condition has
occurred in the Clock Recovery Module.
NSPR1No Signal Present
Receiver 1
SPR1Signal Present
Receiver 1
NSPR2No Signal Present
Receiver 2
SPR2Signal Present
Receiver 2
LOSSTime Reference LossIndicates the Precision Timebase (provided by the
PTIMEPrecision TimebaseIndicates that one of the enabled conditions in the
Indicates that the Clock Recovery Module has detected
the loss of an optical signal on receiver one.
Indicates that the Clock Recovery Module has detected
an optical signal on receiver one.
Indicates that the Clock Recovery Module has detected
the loss of an optical signal on receiver two.
Indicates that the Clock Recovery Module has detected
an optical signal on receiver two.
Agilent 86107A module) has detected a time reference
loss due to a change in the reference clock signal.
Precision Timebase Register has occurred.
1-23
Introduction
Status Reporting
Figure 1-2. Status Reporting Data Structures
1-24
Introduction
Status Reporting
Status Reporting Data Structures (continued)
1-25
Introduction
Status Reporting
Status Byte
Register
The Status Byte Register is the summary-level register in the status reporting structure. It contains summary bits that monitor activity in the other status registers and
queues. The Status Byte Register is a live register. That is, its summary bits are set and
cleared by the presence and absence of a summary bit from other event registers or
queues.
If the Status Byte Register is to be used with the Service Request Enable Register to
set bit 6 (RQS/MSS) and to generate an SRQ, at least one of the summary bits must be
enabled, then set. Also, event bits in all other status registers must be specifically
enabled to generate the summary bit that sets the associated summary bit in the Status
Byte Register.
The Status Byte Register can be read using either the *STB? common command query
or the GPIB serial poll command. Both commands return the decimal-weighted sum of
all set bits in the register. The difference between the two methods is that the serial
poll command reads bit 6 as the Request Service (RQS) bit and clears the bit which
clears the SRQ interrupt. The *STB? query reads bit 6 as the Master Summary Status
(MSS) and does not clear the bit or have any affect on the SRQ interrupt. The value
returned is the total bit weights of all of the bits that are set at the present time.
The use of bit 6 can be confusing. This bit was defined to cover all possible computer
interfaces, including a computer that could not do a serial poll. The important point to
remember is that, if you are using an SRQ interrupt to an external computer, the serial
poll command clears bit 6. Clearing bit 6 allows the analyzer to generate another SRQ
interrupt when another enabled event occurs.
The only other bit in the Status Byte Register affected by the *STB? query is the Message Available bit (bit 4). If there are no other messages in the Output Queue, bit 4
(MAV) can be cleared as a result of reading the response to the *STB? query.
If bit 4 (weight = 16) and bit 5 (weight = 32) are set, a program would print the sum of
the two weights. Since these bits were not enabled to generate an SRQ, bit 6 (weight =
64) is not set.
Example 1
This HP BASIC example uses the *STB? query to read the contents of the analyzer’s
Status Byte Register when none of the register's summary bits are enabled to generate
an SRQ interrupt.
10 OUTPUT 707;":SYSTEM:HEADER OFF;*STB?"!Turn headers off
20 ENTER 707;Result!Place result in a numeric variable
30 PRINT Result!Print the result
40 End
The next program prints 132 and clears bit 6 (RQS) of the Status Byte Register. The
difference in the decimal value between this example and the previous one is the value
of bit 6 (weight = 64). Bit 6 is set when the first enabled summary bit is set, and is
cleared when the Status Byte Register is read by the serial poll command.
1-26
Loading...
+ 388 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.