This reference applies directly to software revision code 3.00 and later.
Copyright Agilent Technologies 2010
All Rights Reserved.
90000A/90000X Series Infiniium
Oscilloscopes
In This Book
This book is your guide to programming the Infiniium 90000A and 90000X Series
Oscilloscopes.
Chapters 1 through 5 give you an introduction to programming the oscilloscopes,
along with necessary conceptual information. These chapters describe basic program
communications, interface, syntax, data types, and status reporting.
Chapter 6 shows example BASIC and C programs, and describes chunks of one
program to show you some typical applications. The BASIC and C example programs
are also shipped on a disk with the oscilloscope.
The next chapters describe the commands used to program the oscilloscopes. Each
chapter describes the set of commands that belong to an individual subsystem, and
explains the function of each command.
The last chapter describes error messages.
ii
Contents
1 Introduction to Programming
Communicating with the Oscilloscope1-3
Output Command1-4
Device Address1-4
Instructions1-4
Instruction Header1-4
White Space (Separator)1-5
Braces1-5
Ellipsis1-5
Square Brackets1-5
Command and Query Sources1-5
Program Data1-6
Header Types1-7
Duplicate Mnemonics1-9
Query Headers1-10
Program Header Options1-11
Character Program Data1-11
Numeric Program Data1-12
Embedded Strings1-13
Program Message Terminator1-13
Common Commands within a Subsystem1-14
Selecting Multiple Subsystems1-14
Programming Getting Started1-14
Initialization1-15
Example Program using HP Basic1-16
Using the DIGITIZE Command1-17
Receiving Information from the Oscilloscope1-19
String Variable Example1-20
Numeric Variable Example1-20
Definite-Length Block Response Data1-21
Multiple Queries1-22
Oscilloscope Status1-22
2 Connectivity
LAN Interface Connector2-3
GPIB Interface Connector2-3
Default Startup Conditions2-4
Interface Capabilities2-5
GPIB Command and Data Concepts2-6
Communicating Over the GPIB Interface2-7
Communicating Over the LAN Interface2-8
Communicating via Telnet and Sockets2-10
Bus Commands2-12
3 Message Communication and System Functions
Contents-1
Contents
Protocols3-3
4 Status Reporting
Status Reporting Data Structures4-5
Status Byte Register4-8
Service Request Enable Register4-10
Message Event Register4-10
Trigger Event Register4-10
Standard Event Status Register4-11
Standard Event Status Enable Register4-12
Operation Status Register4-13
Operation Status Enable Register4-14
Mask Test Event Register4-15
Mask Test Event Enable Register4-16
Acquisition Done Event Register4-17
Process Done Event Register4-17
Trigger Armed Event Register4-17
Auto Trigger Event Register4-17
Error Queue4-18
Output Queue4-18
Message Queue4-19
Clearing Registers and Queues4-19
5 Remote Acquisition Synchronization
Introduction5-2
Programming Flow5-2
Setting Up the Oscilloscope5-2
Acquiring a Waveform5-2
Retrieving Results5-3
Acquisition Synchronization5-3
Single Shot Device Under Test (DUT)5-5
Averaging Acquisition Synchronization5-6
6 Programming Conventions
Truncation Rule6-3
The Command Tree6-4
Infinity Representation6-12
Sequential and Overlapped Commands6-12
Response Generation6-12
EOI6-12
7 Sample Programs
Sample Program Structure 7-3
Sample C Programs 7-4
Listings of the Sample Programs 7-14
gpibdecl.h Sample Header7-15
Contents-2
learnstr.c Sample Program 7-17
sicl_IO.c Sample Program 7-21
natl_IO.c Sample Program 7-2 6
init.bas Sample Program7-30
lrn_str.bas Sample Program7-38
Execution Error 31-6
Device- or Oscilloscope-Specific Error 31-7
Query Error 31-8
List of Error Messages 31-9
Contents
Contents-17
Contents
Contents-18
1
Introduction to Programming
Introduction to Programming
This chapter introduces the basics for remote programming of an oscilloscope.
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 and an oscilloscope include:
• Set up the oscilloscope.
• Make measurements.
• Get data (waveform, measurements, and configuration) from the
oscilloscope.
• Send information, such as waveforms and configurations, to the
oscilloscope.
You can accomplish other tasks 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.
1-2
Introduction to Programming
Communicating with the Oscilloscope
Communicating with the Oscilloscope
Computers communicate with the oscilloscope by sending and receiving messages
over a remote interface, such as a GPIB card or a Local Area Network (LAN) card.
Commands for programming normally appear as ASCII character strings embedded
inside the output statements of a “host” language available on your computer. The
input commands of the host language are used to read responses from the oscilloscope.
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.
The following 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 on 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 chapter 3, "Message Communication and
System Functions."
1-3
Introduction to Programming
Output Command
Output Command
The 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 Address
The 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 oscilloscope and interface card are at GPIB
device address 707. When writing programs, the device address varies according to
how the bus is configured.
Instructions
Instructions, both commands and queries, normally appear as strings embedded in a
statement of your host language, such as 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 informatio n to clarify the meaning
of the instruction.
Instruction Header
The instruction header is one or more command mnemonics separated by colons (:).
They represent the operation to be performed by the oscilloscope. See the
“Programming Conventions” chapter 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-4
Introduction to Programming
White Space (Separator)
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.
Braces
When several items are enclosed by braces, { }, only one of these elements may be
selected. Vertical line ( | ) indicates "or". For example, {ON | OFF} indicates that
only ON or OFF may be selected, not both.
Ellipsis
... An ellipsis (trailing dots) indicates that the preceding element may be repeated one
or more times.
Square Brackets
Items enclosed in square brackets, [ ], are optional.
Command and Query Sources
Many commands and queries require that a source be specified. Depending on the
command or query and the model number of Infiniium oscilloscope being used, some
of the sources are not available. The following is a list of sources:
Program data is used to clarify the meaning of the command or query. It provides
necessary 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.
When there is more than one data parameter, they are s eparated by commas (,). You
can add spaces around the commas to improve readability.
1-6
Introduction to Programming
Header Types
Header Types
There 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 oscilloscope. 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: