This guide describes how to program the HP 53150A, 53151A, and 53152A
Microwave Frequency Counters. The information in this guide applies to
instruments having the number prefix listed below, unless accompanied
by a “Manual Updating Changes” package indicating otherwise.
SERIAL PREFIX NUMBER:3735A and above (53150A)
3736A and above (53151A)
3737A and above (53152A)
HP 53150A/151A/152A Microwave
Frequency Counter
y
y
y
y
y
WARNING
CAUTION
y
WARNING
Copyright Hew le tt-Packard
Company 1996
All Rights Reserved.
Reproduction, adaptation, or
translations without prior
written permission is
prohibited, except as allowed
under the copyright laws.
Printed: November 1997
Printed in USA
Manual part number
53150-90002
Certification
and Warrant
Certification
Hewlett-Packard Company
certifies that this product met
its published specification at the
time of shipment from the
factory. Hewlett-Packard
further certifies that its
calibration measurements are
traceable to the United States
National Institute of Standards
and Technology (formerly
National Bureau of Standards),
to the extent allowed by the
Institute’s calibration facility,
and to the calibration facilities
of other International
Standards Organization
members.
Warrant
HP warrants HP hardware,
accessories and supplies against
defects in materials and
workmanship for a period of one
year from date of shipment. If
HP receives notice of such
defects during the warranty
period, HP will, at its option,
either repair or replace products
which prove to be defective.
Replacement products may be
either new or like-new.
HP warrants that HP software
will not fail to execute its
programming instructions, for
the period specified above, due
to defects in material and
workmanship when properly
installed and used. If HP
receives notice of such defects
during the warranty period, HP
will replace software media
which does not execute its
programming instructions due
to such defects.
For detailed warranty
information, see back matter.
Considerations
Safet
General
This product and related
documentation must be
reviewed for familiarization
with this safety markings and
instructions before operation.
Before Cleaning
Disconnect the product from
operating power before
cleaning.
Warning S
Be Used In This Book
Instruction manual symbol; the
product will be marked with
this symbol when it is necessary
for the user to refer to the
instruction manual.
Indicates hazardous voltages.
Indicates earth (ground)
terminal.
or
Indicates terminal is connected
to chassis when such connection
is not apparent.
Indicates Alternating current.
Indicates Direct current.
mbols That May
Considerations
Safet
(contd)
BODILY INJURY OR DEATH
MAY RESULT FROM
FAILURE TO HEED A
WARNING. DO NOT
PROCEED BEYOND A
WARNING UNTIL THE
INDICATED CONDITIONS
ARE FULLY UNDERSTOOD
AND MET .
Damage to equipment, or
incorrect measurement data,
may result from failure to
heed a caution. Do not
proceed beyond a
until the indic ated conditio ns
are fully understood and met.
Earth Ground
Safet
An uninterruptible safety earth
ground must be maintaine d
from the mains power source to
the product’s ground circuitry.
WHEN MEASURING POWER
LINE SIGNALS, BE
EXTREMELY CAREFUL AND
ALWAYS USE A
STEP-DOWN ISOLATION
TRANSFORMER WHICH
OUTPUT IS COMPATIBLE
WITH THE INPUT
MEASUREMENT
CAPABILITIES OF THIS
PRODUCT. THIS PRODUCT’S
FRONT AND REAR PANELS
ARE TYPCIALLY AT EARTH
GROUND.
TO MEASURE AC POWER
LINE SIGNALS WITHOUT AN
ISOLATION TRANSFORMER.
For additional safety and
acoustic noise information, see
back matter.
CAUTION
THUS, NEVER TRY
Hewlett-Packard Company8.NC.NL.A.11.03.97.R1.P.CW1C3NC
Santa Clara Divisio n
5301 Stevens Creek Boulevard
Santa Clara, California 95052-8059
Contents
y
1Before You Start ...
Introduction1-2
Getting Started1-3
How to Use This Guide1-3
New Users1-4
Experienced Programmers1-5
Applications1-5
Programming Guide Contents1-6
Assumptions1-7
Related Documentation1-8
2Command Summar
Introduction2-2
Chapter Summary2-2
Front Panel to SCPI Command Map2-3
HP 53150A/151A/152A Command Summary2-8
SCPI Conformance Information2-8
IEEE 488.2 Common Commands2-9
HP 53150A/151A/152A SCPI Subsystem Commands2-12
Std/New Column2-12
Parameter Form Column2-12
*RST Response2-19
3Programming Your Counter
for Remote Operation
Introduction3-2
Chapter Summary3-3
Where to Find Some Specific Information3-4
Programming Examples3-4
Programming Guidev
Contents
Connecting the Counter to a Computer3-5
To Connect With the HP-IB3-5
IEEE 488.1 Interface Capabilities3-6
To Connect With the RS-232 Serial Interface3-7
Remote/Local Operation3-11
Overview of Command Types and Formats3-12
Common Command Format3-12
SCPI Command and Query Format3-12
Response Messages3-21
Response Message Syntax3-21
Response Message Data Types3-23
Status Reporting3 -25
Status Byte Register and
Service Request Enable Register3-27
Standard Event Status Register Group3-30
The Operation and Questionable Data Status Register
Groups3-33
viProgramming Guide
Contents
Programming the Counter
for Status Reporting3-41
Determining the Condition of the Counter3-41
Resetting the Counter and Clearing
the Remote Interface—Exa mple 13-42
Using the Standard Event Status Register to
Trap an Incorrect Command—Example 23-42
Using the Operation Status Register to Alert the Computer
When Measuring has
Completed—Example 33-43
Programming the Counter
to Display Results3-46
Configuring the Counter's Display3-46
Commands for Displaying Results3-47
Command for Displaying Raw Results3-47
Commands for Displaying Relative Results3-47
Commands for Enabling and Disabling the Display3-47
Programming the Counter to
Synchronize Measurements3-48
Synchronizing Measurement Completion3-48
Resetting the Counter and Clearing the Inte rface3-48
Using the *WAI Command3-49
Using the *OPC? Command3-49
Using the *OPC Command to Assert SRQ3-50
Writing SCPI Programs3-52
Programming Guidevii
Contents
Programming Examples3-54
Using HP BASIC3-54
Using C3-55
List of the Programming Examples3-55
Making a Frequency Measurement (HP BASIC)3-56
Making a Frequency Measurement (QuickBASIC)3-57
Making a Frequency Measurement (C)3-58
4Command Reference
Introduction4-2
:ABORt Command4-4
:DISPlay Subsystem4-5
Group Execute Trigger
(GET)4-7
:INITiate Subsystem4 -8
:INPut Sub s ys tem4-9
:MEASure Subsystem4-10
Introduction5-2
Reading an Error5-3
Error Queue5-4
Error Types5-5
No Error5-5
Command Error5-6
Execution Error5-6
Device- or Counter-Specific Error5-7
Query Error5-7
Error List5-7
Programming Guideix
Contents
xProgramming Guide
1
Before You Start ...
Chapter 1 Before You Start ...
Introduction
Introduction
1
This programming guide contains programming information for the
HP 53150A, 53151A, and 53152A Microwave Frequency Counters.
This guide assumes you are familiar with the front-panel operation of the
Counter. See the
information about front-panel operation. You should use this
programming guide together with the operating guide. Knowing how to
control the Counter from the front panel and understanding the
measurements you want to perform makes the programming task much
easier. The operating guide provides explanations and procedures for all
of the Counter's measurement functions and contains the specifications
for the Counter.
By sending Standard Commands for Programmable Instruments (SCPI)
commands, you can remotely operate many of the Counter's front-panel
functions via the Hewlett-Packard Interface Bus (HP-IB) or the RS-232
serial interface. These programming commands conform to the
Commands for Programmable Instruments (SCPI) Standard Version
1992.0
instruments over the Hewlett-Packard Interface Bus (HP-IB) or the
RS-232 serial interface. However, it does standardize the structure and
content of an instrument's command set to reflect the best programming
practices developed by people using HP-IB. It also establishes standard
command mnemonics for similar functions in all of the instruments that
conform to the SCPI standard.
. The SCPI standard does not completely redefine how to program
HP 53150A/151A/152A Operating Guide
for detailed
Standard
If you have programmed any HP instruments that have been released
over the last few years, you ha ve probably se en a general trend t oward the
techniques specified in the SCPI standard. For example, several
instruments are already using a hierarchy of commands that is similar to
the command structure defined by the SCPI standard.
1-2Programming Guide
Chapter 1 Before You Start ...
Getting Started
Getting Started
NOTE
Before attempting to program the Counter, take some time to familiarize
yourself with the content of this guide. The remainder of this chapter
contains the following information:
•An explanation of how you should use the programming guide
based on your experience programming instruments and your
testing requirements.
•A description of the guide contents.
•A statement of assumptions that are made in the guide.
•A list of related documentation.
How to Use This Guide
How you use this guide depends upon how much you already know about
programming instruments and how complex your measurement
requirements are. Let's start by establishing your programming
background and then discuss the type of mea surements you want to
perform.
With two minor exceptions, the only differen ce between programming the
Counter using the HP-IB interface and the RS-232 serial interface is the
manner in which you connect the Counter to the computer. These
exceptions are:
1
1. The Counter sends a command prompt over the RS-232 interface (but
not the HP-IB) after receiving and executing each command.
2. When an error is detected ( during the Self-Test or during o peration),
the Counter automatically sends an error message (or messages) over
the RS-232 interface (error messages must be requested over the
HP-IB). For additional information on error messages, see Appendix B
of the
HP 3150A/151A/152A Operating Guide
Programming Guide1-3
.
Chapter 1 Before You Start ...
How to Use This Guide
New Users
1
What You Should Un de rs t a nd
As a new user, you must have some understanding of a high-level
language, such as BASIC or C, before you can use the command set
defined in this guide to control the Counter. (In Chapter 3, “Programming
Your Counter for Remote Operation,” there are programming examples
provided in HP BASIC, Microsoft QuickBASIC, and Borland Turbo C.)
However, whatever language you use, the command strings that control
the Counter remain the same.
Learning to Program the Co un te r
To learn how to program the Counter, perform the following:
•Scan the summary tables in Chapter 2, “Command Summary,”
to get a feeling for the number and structure of commands
available to you.
•Read and study map drawings in the s ection t itled “F ront Panel to
SCPI Command Map” in Chapter 2.
•Read Chapter 3, “Programming Your Counter for Remote
Operation,” for an overview of SCPI concepts as they relate to the
HP 53150A, 53151A, and 53152A Frequency Counters. Look at
the flowcharts, which illustrate some of the decisions you must
make when programming the Counter.
•Read the section at the end of Chapter 3 titled “Programming
Examples.”
•Modify some of the programming examples to select speci f ic
measurement functions. If the programs work, consider yourself
an experienced programmer and use Chapter 4, “Command
Reference,” as a reference for detailed information of all the
Counter's SCPI commands.
1-4Programming Guide
Chapter 1 Before You Start ...
How to Use This Guide
Experienced Programmers
If you have programmed other HP-IB instruments, you are probably
familiar with many of the concepts and techniques discussed in this guide.
Using the SCPI commands is also very similar to using the earlier HP-IB
commands. The main difference between the two command sets is the
hierarchy of the subsystem commands. (However, this type of structure
has previously been used on other instruments.)
Because the SCPI command set and some of the status reporting
techniques are new, we advise you to use the following sequence to learn
the Counter programming requirements:
•Look over the steps for a new user, and perform any that you
think are applicable to your current level of knowledge. In
particular, look at the measurement techniques and examples
provided in Chapter 3, “Programming Your Counter for Remote
Operation.”
•Review the summary tables in Chapter 2, “Command Summary.”
If this chapter contains sufficient information to get you started,
write some test programs to explore the Counter's capabilities. If
you need additional information on any command, refer to the
applicable command description in Chapter 4, “Command
Reference .”
1
•Review the remaining information in this guide to determine what
is applicable to your programming requirements.
If you need more information than is contained in this guide, see the
section in this chapter titled “Related Documentation.”
Applications
After you have read the appropriate information and written some
measurement programs, you may want to expand the scope of your
applications. The following two techniques are explained in detail:
•If you are going to write interrupt-driven programs (or if you just
want to determine the status of the Counter), read the sect ion
titled “Status Reporting” in Chapter 3.
•If you are going to write programs to transfer data between the
Counter and an external computer, read the section titled
“Overview of Response Message Formats” in Chapter 3.
Programming Guide1-5
Chapter 1 Before You Start ...
Programming Guide Contents
1
Programming Guide Contents
The following information is contained in this guide:
•Table of Contents
•Chapter 1 (this chapter),“Before You Start ...,” is a preface that
introduces you to the programming guide.
•Chapter 2, “Command Summary,” is a quick reference that
summarizes the Counter's programming commands. It provides
you with front-panel to SCPI command maps, SCPI conformance
information, and command-summary tables.
•Chapter 3, “Programming Your Counter for Remote Operation,”
describes how to connect and set up the Counter for remote
operation, briefly explains the SCPI elements and formats,
describes status reporting, describes how to write programs, and
provides programming examples for each of the main tasks that
you want the Counter to perform.
•Chapter 4, “Command Reference,” is a command dictionary that
describes the SCPI subsystems and IEEE 488.2 Common
commands.
•Chapter 5, “Errors,” lists all of the error messages the Counter
generates and the cause(s) for each error.
•Index
1-6Programming Guide
Chapter 1 Before You Start ...
Assumptions
Assumptions
This guide assumes the Counter is correctly installed and interfaced to an
external computer. If it is not, and you intend to use the HP-IB, see the
IEEE HP-IB Interconnection information in
Tutorial Description of the Hewlett-Packard Interface Bus, 1987.
section in this chapter titled “Related Documentation” for ordering
information.) If you intend to use the RS-232 serial interface, see the
section in Chapter 3 titled “To Connect With the RS-232 Serial Interface.”
As previously mentioned, this guide also assumes you are familiar with
the front-panel opera tion of th e Counte r . See th e
Operating Guide
Knowing how to control the Counter from the front panel and
understanding the measurements yo u need to perform makes the
programming task much easier.
for detailed information about front-panel operation.
Hewlett-Packard Company,
(See the
HP 53150A/151A/152A
1
Programming Guide1-7
Chapter 1 Before You Start ...
Related Documentation
Related Documentation
1
This section contains a list of documentation that relates to the use of the
Counter. Additional information that may be useful is contained in the
following publications:
1.
HP 53150A/151A/152A Microwave Frequency Counter Operating
(HP Part Number 53150-90001)
Guide
2.
Beginner's Guide to SCPI
Edition).
3.
Beginner's Guide to SCPI
Addison-Wesley Publishing Co. 1991).
4.
Standard Commands for Programmable Instruments (SCPI)
version).
This standard is a guide for the selection of messages to be included in
programmable instrumentation. It is primarily intended for
instrument firmware engineers. Howe ver, you may find it useful if y ou
are programming more than one instrument that claims conformance
to the SCPI standard. You can verify the use of standard SCPI
commands in different instruments.
To obtain a copy of this standard, contact:
SCPI Consortium
8380 Hercules, Suite P3
La Mesa, CA 91942
Phone: (619) 697-8790
FAX: (619) 697-5955
(HP Part Number H2325-90002, July 1990
, Barry Eppler (Hewlett-Packard Press,
, (latest
5. The International Institute of Electrical Engineers and Electronic
Engineers,
Interface for Programmable Instrumentation
1-8Programming Guide
IEEE Standard 488.1-1987, IEEE Standard Digital
.
Chapter 1 Before You Start ...
Related Documentation
This standard defines the technical details required to design and
build an HP-IB (IEEE 488.1) interface. This standard contains
electrical specifications and information on protocol that is beyond the
needs of most programmers. However, it can be useful to clarify
formal definitions of certain terms used in related documents.
To obtain a copy of this standard, write to:
Institute of Electrical and Electronic Engineers Inc.
345 East 47th Street
New York, NY 10017 USA
6. The International Institute of Electrical Engineers and Electronic
Engineers, IEEE Standard 488.2-1987, IEEE Standard Codes,
Formats, Protocols, and Common Commands for Use with
ANSI/IEEE Std 488.1-1987 Programmable Instrumentation.
This standard defines the underl ying message forma ts and dat a types
used in SCPI. It is intended more for firmware engineers than for
instrument users/programmers. However, it can be useful if you need
to know the precise definition of specific message formats, data types,
or common commands.
1
To obtain a copy of this standard, write to:
The Institute of Electrical and Electronic Engineers Inc.
345 East 47th Street
New York, NY 10017 USA
This HP BASIC manual contains a good non-technical description of
the HP-IB (IEEE 488.1) interface in Chapter 12, “The HP-IB
Interface.” Subsequent revisions o f HP BASI C may use a slightly
different title for this manual or chapter. This manual is the best
reference on I/O for HP BASIC programmers.
To obtain a copy of this manual, contact your nearest Hewlett-Packard
Sales office.
8. Hewlett-Packard Company, Tutorial Description of the Hewlett-Packard Interface Bus, 1987.
To obtain a copy of this manual, contact your nearest Hewlett-Packard
Sales office.
Programming Guide1-9
Chapter 1 Before You Start ...
Related Documentation
1
1-10Programming Guide
2
Command Summary
A Quick Reference
Chapter 2 Command Summary
Introduction
Introduction
This chapter is a quick reference that summarizes the Counter's
programming commands.
Chapter Summary
Front Panel to SCPI Command Map
•
HP 53150A/151A/152A Command Summary
•
SCPI Conformance Informationpg. 2-8
2
–
IEEE 488.2 Common Commandspg. 2-9
–
HP 53150A/151A/152A SCPI Subsystem Commandspg. 2-12
–
*RST Response
•
3
1
pg. 2-3
2
pg. 2-8
pg. 2-19
1 The section titled “Front Panel to SCPI Command Map” provides maps that show the front-panel keys and their
corresponding (or related) SCPI commands.
2 The section titled “HP 53150A/151A/152A Command Summary” lists the IEEE 488.2 Common Commands
and SCPI Subsystem commands in Table 2-1 and Table 2-2, respectively.
3 The section titled “*RST Response,” lists the states of all of the commands that are affected by the *RST
command in Table 2-3. This section also lists commands that are unaffected by *RST in Table 2-4.
2-2Programming Guide
Chapter 2 Command Summary
y
Front Panel to SCPI Command Map
Front Panel to SCPI Command Map
Figures 2-1 and 2-2 are command maps that shows the relationships
between the front-panel keys and the SCPI commands. This map should
help you to identify commands, if you are already familiar with the front
panel.
NOTE
Some SCPI S
[ ] An element inside brackets is optional. Note, the
1 | 2 Means use either 1 or 2.
<numeric_value> Means enter a number.
SENSe Means you
When you see quotation marks in a command’s parameter (shown in the
Parameter Form column in Table 2-2), you must send the quotation marks
with the command. Refer to the section titled “Using HP BASIC” on
page 3-54 of this guide for details on how to use double quotes or single
quotes to enclose the string parameter of a command.
ntax Conventions:
brackets are
be sent to the Counter.
the entire word. The lo wer case letters are opt ional . For
example, SENS and SENSE are both valid. However,
SEN is not valid. (Note SENSe is used here as an
example, but this conven t io n applie s to all SCP I
commands.)
part of the command and should
not
use either all the upper case letters or
must
not
2
Programming Guide2-3
Chapter 2 Command Summary
Front Panel to SCPI Command Map
Shift + Freq OffsetShift + Pwr Offset
3
RateAvg
2
MODIFY
Rate
Clear
On/Off
Pwr
Offset
Avg
+/-
HPIB
Resol
Enter
Reset/
Local
Shift
Freq
Offset
Reset/Local
2
1
Menu
Shift + HPIB
Resolution
Chan Select
12
Freq Offset On/Off
11
FREQ
Chan
Select
Rel Freq
Offset
On/Off
Gate
Shift + On/Off
POWER
Channel 2
dBm/ W
Display
Power
Rel Pwr
Offset
On/Off
8
Display Power
Power Offset On/Off
4
5
6
7
9
10
Figure 2-1. Front Panel Control to SCPI Command Map
(Part 1 of 2)
Figure 2-2. Front Panel Menu to SCPI Command Map
(Part 2 of 2)
2
Programming Guide2-7
Chapter 2 Command Summary
HP 53150A/151A/152A Command Summary
HP 53150A/151A/152A Command Summary
This section summarizes both the IEEE 488.2 Common and
HP 53150A/151A/152A Standard Commands for Programmable
Instruments (SCPI) commands in tabular format. IEEE 488.2 Common
Commands are listed first, followed by SCPI commands.
SCPI Conformance Information
The SCPI commands used in the HP 53150A/151A/152A Counters are in
2
conformance with the SCPI Standard Version 1995.0. The SCPI command
set consists of the followi n g:
•Common Commands as defined in IEEE 488.2-1987—listed and
summarized in Table 2-1.
•SCPI Subsystem commands as confirmed (and listed) in the SCPI
Standard—the commands defined in Table 2-2 as “Std.”
•SCPI Subsystem commands designed for the instrument in
conformance with SCPI standards but not yet listed in the SCPI
Standard—the commands defined in Table 2-2 as “New.”
•Details of all HP 53150A/151A/152A commands can be found in
Chapter 4, “Command Reference.”
Information on the SCPI commands format, syntax, parameter, and
response types is provided in Chapter 3, “Programming Your Counter for
Remote Operation.”
2-8Programming Guide
Chapter 2 Command Summary
HP 53150A/151A/152A Command Summary
IEEE 488.2 Common Commands
The Common Commands are general-purpose commands that are
common to all instruments (as defined in IEEE 488.2). Common
Commands are easy to recognize because they all begin with an “*” (for
example, *RST, *IDN?, *OPC). These commands are generally not related
to measurement configuration. They are used for functions like resetting
the instrument, identification, or synchronization.
Table 2-1 lists the IEEE 488.2 Common Commands supported by the
HP 53150A/151A/152A in alphabetical order by mnemonic, name, and
function. More information concerning the operation of IEEE 488.2
status-reporting commands and structure can be found i n the “Status
Reporting” section of Chapter 3. Standard explanations of the IEEE 488.2
Common Commands can be found in the ANSI/IEEE Std. 488.2-1987, IEEE Standard Codes, Formats, Protocols, and Common Commands
document.
2
Programming Guide2-9
Chapter 2 Command Summary
HP 53150A/151A/152A Command Summary
Table 2-1. IEEE 488.2 Common Commands
Mnemonic Command NameFunction
*CLSClear StatusClears all event status registers summarized in the
status byte and empt ies the Error Queue.
*DDT <arbitrary block>Defi ne Device Trigger
Command
*DDT?Define Device Trigger
Query
*ESE <NRf>Standard Event Statu s
Enable
*ESE?Standard Event Statu s
2
*ESR?Event Status Register
*IDN?Identification QueryQueries the Counter identification.
*IST?Instrument Status
*OPCOperation CompleteCauses Counter to set the operation compl ete bit in
*OPC?Operation Complete
*PRE <NRf>Parallel Poll Enable
*PRE?Parallel Poll Enable
*RCL <NRf>RecallRestores the state of the Counter’s user settings from
*RSTResetResets the Counter to a known state, as defined in
*SAV <NRf>SaveStores the current state of the Counter’s user settings
*SRE <NRf>Service Request Enable Sets the Service Request Enable register.
Enable Query
Query
Query
Query
Register
Register Query
Defines which command is executed when the
Counter receives a GET or *TRG command.
Queries which command is executed when the
Counter receives a GET or *TRG command.
Sets the Standard Event Status Enable Register.
Queries the Standard Event Status Enable Register.
Queries and then clears the Standard Event Status
Register.
Queries the current state of the parallel poll response
(Instrument Status).
the Standard Event Status Register when all pending
operations (see Note at the end of table) are finished.
Places an ASCII "1" in the Output Queue when all
pending operation s (see Note at the end of table) are
completed.
Sets the value of the Parallel Poll Enable register.
Queries the value of the Parallel Poll Enable register.
a copy stored in local no n-vol atile me mory (0 throug h
9 are valid memory registers).
this manual.
in local non-vo latile memory (0 through 9 are valid
memory registers).
2-10Programming Guide
Loading...
+ 156 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.