Agilent-54621a-programmers-guide.pdf

(1226 KB) Pobierz
Programmer’s Guide
Publication Number 54622-97027
November 2001
For Safety information, Warranties, and Regulatory information,
see the pages behind the Index.
©
Copyright Agilent Technologies 2000-2001
All Rights Reserved
54621A/22A/24A Oscilloscopes
and 54621D/22D
Mixed-Signal Oscilloscopes
Programming the Oscilloscope
When you attach an interface module to the rear of the oscilloscope, it
becomes programmable. That is, you can hook a controller (such as a
PC or workstation) to it, and write programs on that controller to
automate oscilloscope setup and data capture.
The following figure shows the basic structure of every program you will
write for the oscilloscope.
Initialize
To ensure consistent, repeatable performance, you need to start the
program, controller, and oscilloscope in a known state. Without correct
initialization, your program may run correctly in one instance and not in
another. This might be due to changes made in configuration by previous
program runs or from the front panel of the oscilloscope.
• Program initialization defines and initializes variables, allocates
memory, or tests system configuration.
• Controller initialization ensures that the interface to the oscilloscope
(either GPIB or RS-232) is properly set up and ready for data transfer.
• Oscilloscope initialization sets the channel configuration and labels,
threshold voltages, trigger specification and mode, timebase, and
acquisition type.
ii
Capture
Once you initialize the oscilloscope, you can begin capturing data for
analysis. Remember that while the oscilloscope is responding to
commands from the controller, it is not performing acquisitions. Also,
when you change the oscilloscope configuration, any data already
captured will most likely be rendered.
To collect data, you use the :DIGitize command. This command clears
the waveform buffers and starts the acquisition process. Acquisition
continues until acquisition memory is full, then stops. The acquired data
is displayed by the oscilloscope, and the captured data can be measured,
stored in trace memory in the oscilloscope, or transferred to the
controller for further analysis. Any additional commands sent while
:DIGitize is working are buffered until :DIGitize is complete.
You could also put the oscilloscope into run mode, then use a wait loop
in your program to ensure that the oscilloscope has completed at least
one acquisition before you make a measurement. HP does not
recommend this because the needed length of the wait loop may vary,
causing your program to fail. :DIGitize, on the other hand, ensures that
data capture is complete. Also, :DIGitize, when complete, stops the
acquisition process so that all measurements are on displayed data, not
on a constantly changing data set.
Analyze
After the oscilloscope has completed an acquisition, you can find out
more about the data, either by using the oscilloscope measurements or
by transferring the data to the controller for manipulation by your
program. Built-in measurements include frequency, duty cycle, period,
and positive and negative pulse width.
Using the :WAVeform commands, you can transfer the data to your
controller. You may want to display the data, compare it to a known good
measurement, or simply check logic patterns at various time intervals in
the acquisition.
iii
In This Book
This
Programmer’s Guide
is your introduction to programming the
oscilloscope using an instrument controller. This book, with the
Programmer’s
Reference,
provides a comprehensive description of the oscilloscope’s
programmatic interface. The
Programmer’s Reference
is supplied as a
Microsoft Windows Help file on a 3.5" diskette.
The oscilloscope has a built-in RS-232-C port for programming. To program the
oscilloscope over GPIB, you need the N2757A GPIB Interface Module. You also
need an instrument controller that supports either the IEEE-488 or RS-232-C
interface standards, and a programming language capable of communicating
with these interfaces.
This book contains the following information:
Chapter 1
Introduction to Programming, gives a general overview of
oscilloscope programming.
Chapter 2
Programming Getting Started, shows a simple program, explains
its operation, and discusses considerations for data types.
Chapter 3
GPIB, discusses the general considerations for programming the
instrument over an GPIB interface.
Chapter 4
Programming over RS-232-C, discusses the general considerations
for programming the instrument over an RS-232-C interface.
Chapter 5
Programming and Documentation Conventions, describes the
conventions used in representing the syntax of commands throughout this book
and the Programmer’s Reference, and gives an overview of the oscilloscope
command set.
Chapter 6
Status Reporting, discusses the oscilloscope status registers and
how to use them in your programs.
Chapter 7
Installing and Using the Programmer’s Reference, tells how to
install the Programmer’s Reference online help file in Microsoft Windows, and
explains help file navigation.
Chapter 8
Programmer’s Quick Reference, lists all the commands and queries
available for programming the oscilloscope.
For information on oscilloscope operation, see the
User’s Guide.
For
information on interface configuration, see the documentation for the
oscilloscope interface module and the interface card used in your controller (for
example, the HP82350A interface for IBM PC-compatible computers).
iv
Contents
1 Introduction to Programming
Talking to the Instrument 1-3
Program Message Syntax 1-4
Combining Commands from the Same Subsystem 1-7
Duplicate Mnemonics 1-8
Query Command 1-9
Program Header Options 1-10
Program Data Syntax Rules 1-11
Program Message Terminator 1-13
Selecting Multiple Subsystems 1-14
2 Programming Getting Started
Initialization 2-3
Autoscale 2-4
Setting Up the Instrument 2-5
Example Program 2-6
Using the DIGitize Command 2-7
Receiving Information from the Instrument 2-9
String Variables 2-10
Numeric Variables 2-11
Definite-Length Block Response Data 2-12
Multiple Queries 2-13
Instrument Status 2-13
3 Programming over GPIB
Interface Capabilities 3-3
Command and Data Concepts 3-3
Addressing 3-4
Communicating Over the Bus 3-5
Lockout 3-6
Bus Commands 3-6
4 Programming over RS-232-C
Interface Operation 4-3
Cables 4-3
Minimum Three-Wire Interface with Software Protocol 4-4
Extended Interface with Hardware Handshake 4-5
Configuring the Interface 4-6
Interface Capabilities 4-7
Lockout Command 4-8
Contents-1
Zgłoś jeśli naruszono regulamin