Agilent 1A Programming Datasheet

Page 1
HP 53181A Frequency Counter
Programming Guide
Page 2
Page 3
Programming Guide
This guide describes how to program the HP 53181A 225 MHz Frequency Counter. The information in this guide applies to instruments having the number prefix listed below, unless accompanied by a “Manual Updating Changes” package indicating otherwise.
HP 53181A 225 MHz Frequency Counter
Page 4
Copyright Hewlett-Packard
Santa Clara, California 95052-8059
Company 1994, 1995,1997
All Rights Reserved. Reproduction, adaptation, or translations without prior written permission is prohibited, except as allowed under the copyright laws.
Printed: June 1997
Printed in USA
Manual part number 53181-90002
Certification and Warranty
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.
Warranty
This Hewlett-Packard instrument product is warranted against defects in material and workmanship for a period of three years from date of shipment. During the warranty period, Hewlett-Packard Company will, at its option, either repair or replace products which prove to be defective.
For detailed warranty information, see back matter.
Safety Considerations General
This product and related documentation must be reviewed for familiarization with this safety markings and instructions before operation.
This product is a safety Class I instrument (provided with a protective earth terminal).
Before Cleaning
Disconnect the product from operating power before cleaning.
Before Applying Power
Verify that the product is set to match the available line voltage and the correct fuse is installed. Refer to instructions in Chapter 1 (page 1-11) of the Manual.
Safety Earth Ground
An uninterruptible safety earth ground must be provided from the mains power source to the product input wiring terminals or supplied power cable.
Warning Symbols That May Be Used In This Book
Safety Considerations (contd)
Indicates earth (ground) terminal.
or
Indicated terminal is connected to chassis when such connection is not apparent.
Indicates Alternating current.
Indicates Direct current.
WARNING
BODILY INJURY OR DEATH MAY RESULT FROM FAILURE TO HEED A WARNING. DO NOT PROCEED BEYOND A WARNING SIGN UNTIL THE INDICATED CONDITIONS ARE FULLY UNDERSTOOD AND MET.
Hewlett-Packard Company Santa Clara Division 5301 Stevens Creek Boulevard
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.
CAUTION
Damage to equipment, or incorrect measurement data, may result from failure to heed a caution. Do not proceed beyond a CAUTION sign until the indicated conditions are fully understood and met.
For additional safety and acoustic noise information, see back matter.
Page 5
Contents
1 Before You Start . . .
Introduction 1-2 Getting Started 1-3 How to Use This Guide 1-3
New Users 1-3
What You Should Understand 1-3
Learning to Program the Counter 1-4 Experienced Programmers 1-4 Applications 1-5
Programming Guide Contents 1-6 Assumptions 1-6 Related Documentation 1-7
2 Commands Summary
Introduction 2-2
Chapter Summary 2-2
Front Panel to SCPI Command Maps 2-3 HP 53181A Command Summary 2-16
SCPI Conformance Information 2-16 IEEE 488.2 Common Commands 2-17 HP 53181A SCPI Subsystem Commands 2-20 Std/New Column 2-20 Parameter Form Column 2-20
*RST Response 2-32
3 Programming Your Counter for Remote Operation
Introduction 3-2
Chapter Summary 3-2 Where to Find Some Specific Information 3-2 Where to Find HP BASIC Programming Examples 3-3 Where to Find QuickBASIC Programming Examples 3-3 Where to Find Turbo C Programming Examples 3-3
iii
Page 6
Contents
Configuring the HP-IB 3-4
To Set the HP-IB Mode and Address 3-4 To Connect the Counter to a Computer 3-6 Remote/Local Operation 3-6
Overview of Command Types and Formats 3-7
Common Command Format 3-7 SCPI Command and Query Format 3-7
Elements of SCPI Commands 3-8
Subsystem Command Syntax 3-8 Common Command Syntax 3-8 Abbreviated Commands 3-9 Keyword Separator 3-9 Optional Keyword 3-10 Parameter Types 3-11 Parameter Separator 3-12 Query Parameters 3-12 Suffixes 3-12
Suffix Elements 3-12
Suffix Multipliers 3-13 Command Terminator 3-13
Using Multiple Commands 3-14
Program Messages 3-14 Program Message Syntax 3-14
Overview of Response Message Formats 3-16
Response Messages 3-16 Response Message Syntax 3-16 Response Message Data Types 3-18
Status Reporting 3-20
Status Byte Register and Service Request Enable Register 3-22
Status Byte Register 3-22
Service Request Enable Register 3-24 Standard Event Status Register Group 3-25
Standard Event Status Register 3-25
Standard Event Status Enable Register 3-28
iv
Page 7
Contents
Operation Status Register Group and Questionable Data/Signal
Status Register Group 3-28
Condition Register 3-30
Transition Filter 3-30
Event Register 3-31
Event Enable Register 3-31
Operation Status Register Group 3-32
Questionable Data/Signal Status Register Group 3-34
Command Settings for Optimizing Throughput 3-37
Commands to Set Counter for Optimal Throughput 3-37 Typical Optimizing Throughput Results for Different Computers 3-39
How to Program the Counter for Status Reporting 3-40
Determining the Condition of the Counter 3-40 Resetting the Counter and Clearing the HP-IB Interface—
Example 1 3-40
Using the Standard Event Status Register to Trap an Incorrect
HP-IB command—Example 2 3-41
Event Status Register 3-41 Using the Questionable Data/Signal Status Register to Alert the Computer When
Automatic Interpolator Calibration is Disabled—Example 3 3-41
Questionable Data Status Register 3-42 Using the Operation Status Register to Alert the Computer When Measuring has
Completed—Example 4 3-42
Operation Status Register 3-42
How to Program the Counter to Display Results 3-45
Configuring the Counter's Display 3-45 Commands for Displaying Non-Scaled/Offset Results 3-45 Commands for Displaying Scaled/Offset Results 3-46 Commands for Displaying the Limit Graph 3-46 Commands for Displaying Statistics Results 3-46 Commands for Enabling and Disabling the Display 3-47
How to Program the Counter to Synchronize Measurements 3-48
Synchronizing Measurement Completion 3-48 Resetting the Counter and Clearing the HP-IB Interface 3-48 Using the *WAI Command 3-48 Using the *OPC? Command 3-49 Using the *OPC Command to Assert SRQ 3-50
v
Page 8
Contents
How to Program the Counter for Math/Limit Operations 3-51
Updating Math and Limit Results Over HP-IB 3-51 Using the Scale and Offset Over HP-IB 3-52
How to Program the Counter to Define Macros 3-54 Writing SCPI Programs 3-57 Programming Examples 3-60
Using HP BASIC 3-60
To Send a Double-Quoted String 3-60
To Send a Single-Quoted String 3-60 Using QuickBASIC 3-61 Using Turbo C 3-61 List of the Programming Examples 3-61 Easiest Way to Make a Measurement (HP BASIC) 3-62 To Make a Frequency Measurement (HP BASIC) 3-64 To Perform Limit Testing (HP BASIC) 3-65 To Measure the Statistics of 50 Measurements(HP BASIC) 3-66 To Use Limits to Filter Data Before Measuring Stats (HP BASIC) 3-68 To Read and Store Calibration Information (HP BASIC) 3-70 To Optimize Throughput (HP BASIC) 3-71 To Use Macros (HP BASIC) 3-73 To Make a Frequency Measurement (QuickBASIC) 3-75 To Perform Limit Testing (QuickBASIC) 3-76 To Measure the Statistics of 50 Measurements (QuickBASIC) 3-78 To Use Limits to Filter Data Before Measuring Stats
(QuickBASIC) 3-80 To Read and Store Calibration Data (QuickBASIC) 3-82 To Optimize Throughput (QuickBASIC) 3-83 To Use Macros (QuickBASIC) 3-85 To Make a Frequency Measurement (Turbo C) 3-88 To Use Limits to Filter Data Before Measuring Statistics
(Turbo C) 3-90 To Optimize Throughput (Turbo C) 3-93
vi
Page 9
Contents
4 Commands Reference
Introduction 4-2 :ABORt 4-4 :CALCulate Subsystems 4-5 :CALCulate[1] Subsystem 4-7
:CALCulate[1]:DATA? 4-7 :CALCulate[1]:FEED "[:]SENSe[1]" 4-8 :CALCulate[1]:IMMediate 4-8 :CALCulate[1]:IMMediate:AUTO 4-9 :CALCulate[1]:MATH Subtree 4-9
:CALCulate[1]:MATH[:EXPRession]:CATalog? 4-9 :CALCulate[1]:MATH[:EXPRession][:DEFine]? 4-10 :CALCulate[1]:MATH[:EXPRession]:NAME
SCALE_OFFSET 4-10
:CALCulate[1]:MATH[:EXPRession]:SELect
SCALE_OFFSET 4-10
:CALCulate[1]:MATH:STATe 4-10
:CALCulate2 Subsystem 4-11
:CALCulate2:FEED "[:]CALCulate[1]" 4-11 :CALCulate2:IMMediate 4-11 :CALCulate2:IMMediate:AUTO 4-12 :CALCulate2:LIMit Subtree 4-12
:CALCulate2:LIMit:CLEar:AUTO 4-13 :CALCulate2:LIMit:CLEar[:IMMediate] 4-13 :CALCulate2:LIMit:DISPlay 4-13 :CALCulate2:LIMit:FAIL? 4-14 :CALCulate2:LIMit:FCOunt:LOWer? 4-15 :CALCulate2:LIMit:FCOunt[:TOTal]? 4-15 :CALCulate2:LIMit:FCOunt:UPPer? 4-15 :CALCulate2:LIMit:LOWer[:DATA] 4-16 :CALCulate2:LIMit:PCOunt[:TOTal]? 4-17 :CALCulate2:LIMit:STATe 4-17 :CALCulate2:LIMit:UPPer[:DATA] 4-18
vii
Page 10
Contents
:CALCulate3 Subsystem 4-19
:CALCulate3:AVERage Subtree 4-19
:CALCulate3:AVERage:ALL? 4-19 :CALCulate3:AVERage:CLEar 4-20 :CALCulate3:AVERage:COUNt 4-20 :CALCulate3:AVERage:COUNt:CURRent? 4-21 :CALCulate3:AVERage[:STATe] 4-21
:CALCulate3:AVERage:TYPE 4-22 :CALCulate3:DATA? 4-22 :CALCulate3:FEED "[:]CALCulate[1]" 4-23 :CALCulate3:LFILter Subtree 4-23
:CALCulate3:LFILter:LOWer[:DATA] 4-23
:CALCulate3:LFILter:STATe 4-24
:CALCulate3:LFILter:UPPer[:DATA] 4-24 :CALCulate3:PATH? 4-25
:CALibration Subsystem 4-26
:CALibration[:ALL]? 4-26 :CALibration:COUNt? 4-26 :CALibration:DATA 4-27 :CALibration:SECurity Subtree 4-28
:CALibration:SECurity:CODE 4-28
:CALibration:SECurity:STATe 4-28
:CONFigure Subsystem 4-30 Device Clear 4-31 :DIAGnostic Subsystem 4-32
:DIAGnostic:CALibration:INPut[1]:GAIN:AUTO 4-32 :DIAGnostic:CALibration:INPut[1]:OFFSet:AUTO 4-33 :DIAGnostic:CALibration:INTerpolator:AUTO 4-33 :DIAGnostic:CALibration:ROSCillator:AUTO 4-34 :DIAGnostic:CALibration:STATus? 4-34 :DIAGnostic:MEASure:RESolution? 4-35
viii
Page 11
Contents
:DISPlay Subsystem 4-36
:DISPlay:ENABle 4-36 :DISPlay:MENU[:STATe] OFF 4-36 :DISPlay[:WINDow]:TEXT:FEED "[:]CALCulate2" |
"[:]CALCulate3" 4-37 :DISPlay[:WINDow]:TEXT:MASK 4-38 :DISPlay[:WINDow]:TEXT:RADix 4-39
:FETCh Subsystem 4-40 :FORMat Subsystem 4-41
:FORMat[:DATA] 4-41
Group Execute Trigger(GET) 4-42 :HCOPy Subsystem 4-43
:HCOPy:CONTinuous 4-43
:INITiate Subsystem 4-44
:INITiate:AUTO 4-44 :INITiate:CONTinuous 4-44 :INITiate[:IMMediate] 4-46
:INPut[1] Subsystem 4-48
:INPut[1]:ATTenuation 4-48 :INPut[1]:COUPling 4-48 :INPut[1]:FILTer[:LPASs][:STATe] 4-48 :INPut[1]:FILTer[:LPASs]:FREQuency? 4-49 :INPut[1]:IMPedance 4-49
:INPut2 Subsystem 4-50
:INPut2:COUPling? 4-50 :INPut2:IMPedance? 4-50
:MEASure Subsystem 4-51 Measurement Instructions 4-52
:CONFigure 4-53 :CONFigure? 4-54 :FETCh 4-55 :MEASure 4-56
ix
Page 12
Contents
:READ 4-57
:MEASure[:SCALar][:VOLTage]:FREQuency? 4-59 :MEASure[:SCALar][:VOLTage]:FREQuency:RATio? 4-61 :MEASure[:SCALar][:VOLTage]:MAXimum? 4-62 :MEASure[:SCALar][:VOLTage]:MINimum? 4-62 :MEASure[:SCALar][:VOLTage]:PERiod? 4-63 :MEASure[:SCALar][:VOLTage]:PTPeak? 4-64 Using :MEAsure 4-65 Using :CONFigure with :READ? 4-66 Using :CONFigure with :INITiate and :FETCh? 4-66
:MEMory Subsystem 4-68
:MEMory:DELete:MACRo 4-68 :MEMory:FREE:MACRo? 4-68 :MEMory:NSTates? 4-68
[:SENSe] Subsystem 4-69
[:SENSe]:DATA? ["[:]SENSe[1]"] 4-69 [:SENSe]:EVENt[1] Subtree 4-69
[:SENSe]:EVENt[1]:HYSTeresis:RELative 4-69 [:SENSe]:EVENt[1]:LEVel[:ABSolute] 4-70 [:SENSe]:EVENt[1]:LEVel[:ABSolute]:AUTO 4-71 [:SENSe]:EVENt[1]:LEVel:RELative 4-71 [:SENSe]:EVENt[1]:SLOPe 4-72
[:SENSe]:EVENt2 Subtree 4-72
[:SENSe]:EVENt2:LEVel[:ABSolute]? 4-72 [:SENSe]:EVENt2:SLOPe? 4-73
[:SENSe]:FREQuency Subtree 4-73
[:SENSe]:FREQuency:ARM Subtree 4-73 [:SENSe]:FREQuency:ARM[:STARt]:SLOPe 4-73 [:SENSe]:FREQuency:ARM[:STARt]:SOURce 4-74 [:SENSe]:FREQuency:ARM:STOP:DIGits 4-74 [:SENSe]:FREQuency:ARM:STOP:SLOPe 4-75 [:SENSe]:FREQuency:ARM:STOP:SOURce 4-75
[:SENSe]:FREQuency:ARM:STOP:TIMer 4-75 [:SENSe]:FREQuency:EXPected[1|2] 4-76 [:SENSe]:FREQuency:EXPected[1|2]:AUTO 4-77 [:SENSe]:FUNCtion[:ON] 4-77
x
Page 13
Contents
[:SENSe]:ROSCillator Subtree 4-79
[:SENSe]:ROSCillator:EXTernal:CHECk 4-79
[:SENSe]:ROSCillator:EXTernal:FREQuency? 4-79
[:SENSe]:ROSCillator:SOURce 4-80
[:SENSe]:ROSCillator:SOURce:AUTO 4-80
:STATus Subsystem 4-82
:STATus:OPERation Subtree 4-82
:STATus:OPERation:CONDition? 4-82
:STATus:OPERation:ENABle 4-83
:STATus:OPERation[:EVENt]? 4-83
:STATus:OPERation:NTRansition 4-84
:STATus:OPERation:PTRansition 4-84 :STATus:PRESet 4-85 :STATus:QUEStionable Subtree 4-86
:STATus:QUEStionable:CONDition? 4-86
:STATus:QUEStionable:ENABle 4-87
:STATus:QUEStionable[:EVENt]? 4-87
:STATus:QUEStionable:NTRansition 4-88
:STATus:QUEStionable:PTRansition 4-88
:SYSTem Subsystem 4-90
:SYSTem:COMMunicate Subtree 4-90
:SYSTem:COMMunicate:SERial:CONTrol:DTR 4-90
:SYSTem:COMMunicate:SERial:TRANsmit:BAUD 4-91
:SYSTem:COMMunicate:SERial:TRANsmit:PARity[:TYPE] 4-92
:SYSTem:COMMunicate:SERial:TRANsmit:PACE 4-92 :SYSTem:ERRor? 4-92 :SYSTem:KEY 4-94 :SYSTem:KEY:LOG? 4-95 :SYSTem:VERSion? 4-95
:TRACe Subsystem 4-96
:TRACe:CATalog? 4-96 :TRACe[:DATA] OFFSET 4-96 :TRACe[:DATA]? OFFSET 4-96 :TRACe[:DATA] SCALE 4-97 :TRACe[:DATA]? SCALE 4-97
:TRIGger Subsystem 4-98
:TRIGger:COUNt:AUTO 4-98
xi
Page 14
Contents
*CAL?(Calibration Query) 4-99 *CLS(Clear Status Command) 4-100 *DDT(Define Device Trigger Command) 4-101 *DMC(Define Macro Command) 4-102 *EMC(Enable Macro Command) 4-103 *EMC?(Enable Macro Query) 4-103 *ESE(Standard Event Status Enable Command) 4-104 *ESE?(Standard Event Status Enable Query) 4-104 *ESR?(Event Status Register Query) 4-106 *GMC?(Get Macro Contents Query) 4-107 *IDN?(Identification Query) 4-108 *LMC?(Learn Macro Query) 4-109 *OPC(Operation Complete Command) 4-110 *OPC?(Operation Complete Query) 4-111 *OPT?(Option Identification Query) 4-112 *PMC(Purge Macro Command) 4-113 *RCL(Recall Command) 4-114 *RST(Reset Command) 4-116 *SAV(Save Command) 4-117 *SRE(Service Request Enable Command) 4-119 *SRE?(Service Request Enable Query) 4-119 *STB?(Status Byte Query) 4-120 *TRG(Trigger Command) 4-121 *TST?(Self-Test Query) 4-122 *WAI(Wait-to-Continue Command) 4-123
xii
Page 15
Contents
5 Errors
Introduction 5-2 Displaying Errors 5-2 Reading an Error 5-2 Error Queue 5-3 Error Types 5-4
No Error 5-4 Command Error 5-4 Execution Error 5-5 Device- or Counter-Specific Error 5-5 Query Error 5-6
Index
xiii
Page 16
Contents
xiv
Page 17
1
Before You Start ...
Page 18
Before You Start ...
Introduction
Introduction
This programming guide contains programming information for the HP 53181A Frequency Counter.
This guide assumes you are familiar with the front-panel operation of the Counter. See the HP 53181A Operating Guide for detailed 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 wish to perform makes the programming task much easier. The operating guide provides explanations and task 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, all of the Counter's front-panel functions can be remotely operated via the Hewlett­Packard Interface Bus (HP-IB), as well as the additional throughput optimizing function not available from the front panel.
This Counter programming commands conform to the Standard Commands for Programmable Instruments (SCPI) Standard Version 1992.0. The SCPI standard does not completely redefine how to program instruments over the Hewlett-Packard Interface Bus (HP-IB). 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.
If you have programmed any HP instruments that have been released over the last few years, you will have seen a general trend toward 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-2
Page 19
Before You Start ...
Getting Started
Getting Started
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 measurements you want to perform.
New Users
What You Should Understand
As a new user, you should understand that you must have some understanding of a high-level language such as Pascal, BASIC, C, or FORTRAN 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, command strings that control the Counter remain the same.
1-3
Page 20
Before You Start ...
How to Use This Guide
Learning to Program the Counter
To learn how to program the Counter, perform the following:
• Scan the summary tables in Chapter 2, “Commands Summary,”
to get a feeling for the number and structure of commands available to you.
• Read and study map drawings in the section titled “Front Panel to SCPI
Command Maps” in Chapter 2.
• Read Chapter 3, “Programming Your Counter for Remote Operation,” for an
overview of the SCPI concepts as they relate to the HP 53181A Frequency Counter. 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 title d “Programming Examples for
Making Common Measurements,” which provides programming examples.
• Modify some of the programming examples to select specific measurement
functions. If the programs work, consider yourself an experienced programmer and use Chapter 4, “Commands Reference,” as a reference for detailed information of all the Counter's SCPI commands.
Experienced Programmers
If you have programmed other HP-IB instruments, you will probably be familiar with many of the concepts and techniques discussed in this guide. Also, you will find that using the SCPI commands is very similar to using the older HP-IB commands. The main difference is the hierarchy of the subsystem commands. (However, this type of structure has been previously used on other instruments.)
Because the SCPI command set and some of the status reporting techniques are new, you may want to use the following sequence to learn the Counter programming requirements:
• Look ov er 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 provide in Chapter 3, “Programming Your Counter for Remote Operation.”
1-4
Page 21
Before You Start ...
How to Use This Guide
• Review the summary tables in Chapter 2, “Commands Summary.” If this
chapter contains sufficient information to get you started, write some programs to explore the Counter's capabilities. If you need additional information on any command, refer to the applicable command description in Chapter 4, “Commands Reference.”
• 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 section 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 sections titled “Overview of Response Message Formats,” and “Command Settings for Optimizing Throughput” in Chapter
3.
1-5
Page 22
Before You Start ...
Programming Guide Contents
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, “Commands 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 setup 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 will want your Counter to perform.
• Chapter 4, “Commands Refer ence,” is a dictionary that describes the SCPI
subsystems and IEEE 488.2 Common commands.
• Chapter 5, “Errors,” lists all the error messages the Counter can generate and
what caused the error.
• Index
Assumptions
This guide assumes the Counter is correctly installed and interfaced to an external computer. If it is not, see IEEE HP-IB Interconnection information in Hewlett-
Packard Company, Tutorial Description of the Hewlett-Packard Interface Bus,
1987. (See the following section in this chapter titled “Related Documentation” for
ordering information.) As previously mentioned, this guide also assumes you are familiar with the front-
panel operation of the Counter. See the HP 53181A Operating Guide for detailed information about front-panel operation. Knowing how to control the Counter from the front panel and understanding the measurements you wish to perform makes the programming task much easier.
1-6
Page 23
Before You Start ...
Related Documentation
Related Documentation
This section contains a list of documentation related to the use of the Counter. Additional information that you may find useful can be found in the following publications:
1. HP 53181A 225 MHz Frequency Counter Operating Guide (HP Part Number 53181-90001)
2. Beginner's Guide to SCPI (HP Part Number H2325-90001 , July 1990 Edition).
3. Beginner's Guide to SCPI, Barry Eppler (Hewlett-Packard Press, Addison-
Wesley Publishing Co. 1991).
4. Standard Commands for Programmable Instruments (SCPI), Version
1992.0.
This standard is a guide for the selection of messages to be included in programmable instrumentation . It is primarily intended for instrument firmware engineers. However, you may find it useful if you 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
5. The International Institute of Electrical Engineers and Electronic Engineers, IEEE Standard 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumentation.
This standard defines the technical details required to design and build an HP-IB (IEEE 488.1) interface. This standard contains electrical specification and information on protocol that is beyond the need 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:
1-7
Page 24
Before You Start ...
Related Documentation
The 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 underlying message formats and data 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 type, or common commands.
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
7. Hewlett-Packard Company, BASIC 5.0/5.1 Interfacing Techniques Vol 2., Specific Interfaces, 1987.
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 of HP BASIC 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.
1-8
Page 25
2
Commands Summary
A Quick Reference
Page 26
Commands Summary
Introduction
Introduction
This chapter is a quick reference that summarizes the Counter's programming commands.
Chapter Summary
• Front Panel to SCPI Command Maps
1
pg. 2- 3
• HP 53181A Command Summary
2
pg. 2- 16 – SCPI Conformance Information pg. 2- 16 – IEEE 488.2 Common Commands pg. 2- 17 – HP 53181A SCPI Subsystem Commands pg. 2- 20
• *RST Response
3
pg. 2- 32
_______________________________
1
The section titled “Front Panel to SCPI Command Maps,” provides maps that show the
front-panel keys and their corresponding (or related) SCPI commands.
2
The section titled “HP 53181A Command Summary,” lists the IEEE 488.2 Common and the SCPI
Subsystem commands in Tables 2-1 and 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-2
Page 27
Commands Summary
Front Panel to SCPI Command Maps
Front Panel to SCPI Command Maps
Figures 2-1 through 2-6 provide maps that show the one-to-one relationship of the front-panel keys and the SCPI commands. These maps should help with identifying commands if you are already familiar with the front panel.
Some SCPI Syntax Conventions:
[ ] An element inside brackets is optional. Note, the brackets
are NOT part of the command and should NOT be sent to the Counter.
1 | 2 Means use either 1 or 2.
<numeric_value> Means enter a number.
SENSe Means you MUST use either all the upper case letters or
the entire word. The lower case letters are optional. For example, SENS and SENSE are both valid. However, SEN is not valid. (Note SENSe is used here as an example, but this convention is true for all SCPI commands.)
NOTE
When you see quotation marks in the 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” in Chapter 3 (page 3-
60) of this guide for details on how to use double quotes or single quotes to enclose the string parameter of a command.
2-3
Page 28
Commands Summary
Front Panel to SCPI Command Maps
__________________________
*Channel 2 is optional.
Figure 2-1. Input Channels Conditioning Keys to SCPI Command Map (Part 1 of 2)
2-4
Page 29
Commands Summary
Front Panel to SCPI Command Maps
1 a. [:SENSe]:EVENt:LEVel[:ABSolute]:AUTO ON|OFF
b1. [:SENSe]:EVENt:LEVel[:ABSolute] <numeric_value> [V] b2. [:SENSe]:EVENt:LEVel:RELative <numeric_value> [PCT]
c. [:SENSe]:EVENt:SLOPe POSitive | NEGative
d1. [:SENSe]:EVENt:HYSTeresis:RELative 100 d2. [:SENSe]:EVENt:HYSTeresis:RELative 50 d3. [:SENSe]:EVENt:HYSTeresis:RELative 0
2 :INPut:IMPedance <numeric_value> [OHM] 3 :INPut:COUPling AC|DC 4 a
. :INPut:ATTenuation 1
1
a2. :INPut:ATTenuation 10
5 :INPut:FILTer ON | OFF 6 :INPut2:COUPling?
:INPut2:IMPedance?
Figure 2-1. Input Channels Conditioning Keys to SCPI Command Map (Part 2 of 2)
2-5
Page 30
Commands Summary
Front Panel to SCPI Command Maps
Figure 2-2. Instrument Control, Utility, Recall, and Save & Print Keys to SCPI Command Map (Part 1 of 2)
2-6
Page 31
Commands Summary
Front Panel to SCPI Command Maps
1 a. *IDN?
b. No command c1. [:SENSe]:ROSCillator:SOURce INTernal
c2. [:SENSe]:ROSCillator:SOURce EXTernal c3. [:SENSe]:ROSCillator:SOURce:AUTO ON
d. No command (See Calibration menu, Figure 2-6) e. No command
f. No command g. *TST?
h. :SYSTem:COMMunicate:SERial:TRANsmit:BAUD <numeric_value> i. :SYSTem:COMMunicate:SERial:TRANsmit:PARity[:TYPE]
EVEN | ODD | NONE
j. :SYSTem:COMMunicate:SERial:TRANsmit:PACE XON | NONE k1. :SYSTem:COMMunicate:SERial:CONTrol:DTR LIMit
k2. :SYSTem:COMMunicate:SERial:CONTrol:DTR IBFull k3. :SYSTem:COMMunicate:SERial:CONTrol:DTR ON
l1. :DISPlay[:WINDow]:TEXT:RADix DPOint l2. :DISPlay[:WINDow]:TEXT:RADix COMMa
2 *SAV <NRf> 3 :INITiate:CONTinuous OFF (if running)
OR
:ABORt (if single measurement in progress)
4 *RCL <NRf> 5 :HCOPy:CONTinuous ON | OFF 6 :INITiate:CONTinuous ON (if in single)
OR
:ABORt (if running)
7 :INITiate[:IMMediate]
Figure 2-2. Instrument Control, Utility, Recall, and Save & Print Keys to SCPI Command Map (Part 2 of 2)
2-7
Page 32
Commands Summary
Front Panel to SCPI Command Maps
Figure 2-3. MEASURE Keys to SCPI Command Map (Part 1 of 2)
1 [:SENSe]:FUNCtion[:ON] "[:][XNONe:]FREQuency [1]"
2-8
Page 33
Commands Summary
Front Panel to SCPI Command Maps
2 a. [:SENSe]:FUNCtion[:ON] "[:][XNONe:]PERiod [1]"
b. [:SENSe]:FUNCtion[:ON] "[:][XNONe:]FREQuency:RATio [1,2]" c. [:SENSe]:FUNCtion[:ON] "[:][XNONe:]FREQuency:RATio 2,1" d. [:SENSe]:FUNCtion[:ON] "[:][XNONe:]VOLTage:MINimum [1]"
OR
[:SENSe]:FUNCtion[:ON] "[:][XNONe:]VOLTage:MAXimum [1]"
3 [:SENSe]:FUNCtion[:ON] "[:][XNONe:]FREQuency 2"
Since the primary purpose of these front-panel keys is to change the function, the corresponding [:SENSe]:FUNCtion[:ON] command is listed in the menu map above. The front-panel keys, however, invoke couplings which affect other settings, whereas the [:SENSe]:FUNCtion[:ON] command does not.
Figure 2-3. MEASURE Keys to SCPI Command Map (Part 1 of 2)
2-9
Page 34
Commands Summary
Front Panel to SCPI Command Maps
Frequency, Period, Ratio
Auto Arming:
a. GATE: AUTO
Digits Arming:
b. GATE: DIGITS c. DIGITS: <digits>
Time Arming:
d. GATE: TIME e. TIME: <time>
External Arming:
f. GATE: EXTERNL g. START: POS
NEG
h1. STOP: AUTO h2. STOP: NEG
POS
h3. STOP: TIME i. TIME: <time>
Figure 2-4. Gate & ExtArm Key to SCPI Command Map (Part 1 of 2)
2-10
Page 35
Commands Summary
Front Panel to SCPI Command Maps
1
Frequency, Period, Ratio
Auto Arming:
a. [:SENSe]:FREQuency:ARM[:STARt]:SOURce IMMediate
[:SENSe]:FREQuency:ARM:STOP:SOURce IMMediate
Digits Arming:
b. [:SENSe]:FREQuency:ARM[:STARt]:SOURce IMMediate
[:SENSe]:FREQuency:ARM:STOP:SOURce DIGits
c. [:SENSe]:FREQuency:ARM:STOP:DIGits <numeric_value>
Time Arming:
d. [:SENSe]:FREQuency:ARM[:STARt]:SOURce IMMediate
[:SENSe]:FREQuency:ARM:STOP:SOURce TIMer
e. [:SENSe]:FREQuency:ARM:STOP:TIMer <numeric_value> [S]
External Arming:
f. [:SENSe]:FREQuency:ARM[:STARt]:SOURce EXTernal
g. [:SENSe]:FREQuency:ARM[:STARt]:SLOPe POSitive | NEGative
h1. [:SENSe]:FREQuency:ARM:STOP:SOURce IMMediate h2. [:SENSe]:FREQuency:ARM:STOP:SOURce EXTernal
[:SENSe]:FREQuency:ARM:STOP:SLOPe POSitive | NEGative
h3. [:SENSe]:FREQuency:ARM:STOP:SOURce TIMer
i. [:SENSe]:FREQuency:ARM:STOP:TIMer <numeric_value> [S]
Figure 2-4. Gate & ExtArm Key to SCPI Command Map (Part 2 of 2)
2-11
Page 36
Commands Summary
Front Panel to SCPI Command Maps
Figure 2-5. LIMITS and MATH Keys to SCPI Command Map (Part 1 of 2)
2-12
Page 37
Commands Summary
Front Panel to SCPI Command Maps
1 a. :CALCulate2:LIMit:UPPer[:DATA] <numeric_value> [HZ | S]
b. :CALCulate2:LIMit:LOWer[:DATA] <numeric_value> [HZ | S]
2 a. :CALCulate2:LIMit:STATe OFF | ON
b1. :INITiate:AUTO OFF b2. :INITiate:AUTO ON
c. :CALCulate2:LIMit:DISPlay GRAPh | NUMBer
3 a. :DISPlay[:WINDow]:TEXT:FEED "CALC3" *
:CALCulate3:AVERage:TYPE MAXimum | MINimum | SDEViation | MEAN
*
OR
:DISPlay[:WINDow]:TEXT:FEED "CALC2" *
b. :CALCulate3:AVERage:COUNt <numeric_value> c. :CALCulate3:AVERage[:STATe] OFF | ON d1. :CALCulate3:LFILter:STATe OFF d2. :CALCulate3:LFILter:STATe ON
e1. :TRIGger:COUNt:AUTO OFF e2. :TRIGger:COUNt:AUTO ON
4 a. :TRACe[:DATA] SCALE, <numeric_value>
b. :TRACe[:DATA] OFFSET, <numeric_value> [HZ | S] c. :CALCulate:MATH:STATe OFF | ON
________________________
*Use CALC3:AVER:TYPE and :DISP[:WIND]:TEXT:FEED "CALC3" to specify SHOW: STD DEV, MEAN, MAX, or MIN. Use DISP[:WIND]:TEXT:FEED "CALC2" to specify SHOW: MEAS.
Figure 2-5. LIMITS and MATH Keys to SCPI Command Map (Part 2 of 2)
2-13
Page 38
Commands Summary
Front Panel to SCPI Command Maps
Figure 2-6. Display Digits and Calibration Menu to SCPI Command Maps
2-14
Page 39
Commands Summary
Front Panel to SCPI Command Maps
1 :DISPlay[:WINDow]:TEXT:MASK <numeric_value> 2 a. :CALibration:SECurity:STATe?
b. :DIAGnostic:CALibration:INPut1:OFFSet:AUTO ONCE
:DIAGnostic:CALibration:INPut1:GAIN:AUTO ONCE :DIAGnostic:CALibration:ROSCillator:AUTO ONCE
c1. :CALibration:SECurity:CODE <new_code>
OR
:CALibration:SECurity:STATe ON, <present_code>
c2. :CALibration:SECurity:STATe OFF, <present_code> d. :CALibration:COUNt? e. No command
NOTE
The Calibration Menu is accessed by holding the Scale & Offset key and cycling POWER key.
Figure 2-6. Display Digits and Calibration Menu to SCPI Command Maps (Continued)
2-15
Page 40
Commands Summary
HP 53181A Command Summary
HP 53181A Command Summary
This section summarizes both the IEEE 488.2 Common and HP 53181A 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 53181A are in conformance with the SCPI Standard Version 1992.0. The SCPI command set consists of the following:
• 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 53181A commands can be found in Chapter 4, “Commands Reference” of this programming guide.
Information on the SCPI commands format, syntax, parameter, and response types is provided in Chapter 3, “Programming Your Counter for Remote Operation,” of this programming guide.
2-16
Page 41
Commands Summary
HP 53181A 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 Common Commands 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 in 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-17
Page 42
Commands Summary
HP 53181A Command Summary
Table 2-1. IEEE 488.2 Common Commands
Mnemonic Command Name Function *CAL?
Calibration
Causes the Counter to perform an internal interpolator self­calibration and returns a response that indicates whether or not the instrument completed the self-calibration without error.
*CLS
*DDT <arbitrary block>
*DMC <string>, <arbitrary block>
*EMC <NRf>
*EMC?
*ESE <NRf>
*ESE?
*ESR?
*GMC? <string>
*IDN?
*LMC?
*OPC
*OPC?
Note: Pending operations include measurements in progress.
Clear Status
Define Device Trigger Command
Define Macro Command
Enable Macro Command
Enable Macro Query
Standard Event Status Enable
Standard Event Status Enable Query
Event Status Register Query
Get Macro Contents Query
Identification Query
Learn Macro Query
Operation Complete
Operation Complete Query
Clears Status data structures (Event Registers and Error Queue).
Defines either INIT, FETC?, READ?, or nothing to be executed when the Counter receives a GET or *TRG command.
Assigns a sequence of zero or more commands/queries to a macro label. No query form.
Enables and disables expansion of macros. Non-zero value enables; zero value disables.
Queries whether macros are enabled.
Sets the Standard Event Status Enable Register.
Queries the Standard Event Status Enable Register.
Queries the Standard Event Status Register.
Queries the current definition of a currently defined macro label.
Queries the Counter identification.
Queries the currently defined macro labels.
Causes Counter to set the operation complete bit in the Standard Event Status Register when all pending operations (see Note) are finished.
Places an ASCII “1” in the Output Queue when all pending operations (see Note) are completed.
2-18
Page 43
Commands Summary
HP 53181A Command Summary
Table 2-1. IEEE 488.2 Common Commands (Continued)
Mnemonic Command Name Function
*OPT?
*PMC
*RCL <NRf>
*RST
*SAV <NRf>
*SRE <NRf>
*SRE?
*STB?
*TRG
Option Identification Query
Purge Macro Command
Recall
Reset
Save
Service Request Enable
Service Request Enable Query
Status Byte Query
Trigger
Identifies the options installed in the Counter.
Deletes all macros previously defined using the *DMC command.
Restores the state of the Counter from a copy stored in local non-volatile memory (0 through 20 are valid memory registers).
Resets the Counter to a known state.
Stores the current state of the Counter in local non­volatile memory (1 through 20 are valid memory registers).
Set the Service Request Enable register.
Queries the Service Request Enable register.
Queries the Status Byte and Master Summary Status bit.
This trigger command is the device-specific analog of the IEEE 488.1 defined GET. It initiates measurement, unless *DDT was used to redefine device trigger.
*TST?
*WAI
Note: Pending operations include measurements in progress.
Self-Test Query
Wait-to-Continue
Executes an internal self-test and reports the results.
Makes Counter wait until all pending operations (see Note) are completed before executing commands following *WAI command.
2-19
Page 44
Commands Summary
HP 53181A Command Summary
HP 53181A SCPI Subsystem Commands
SCPI Subsystem commands include all measurement functions and some general purpose functions. SCPI Subsystem Commands use a hierarchy relationship between keywords that is indicated by a “:” (colon). For example, in the SYST:ERR? query, the “:” between SYST and ERR? indicates ERR? is subordinate to SYST.
Table 2-2 lists the SCPI Subsystem Commands in alphabetical order by the command keyword. The table shows the Subsystem commands hierarchical relationship, related parameters (if any), and any associated information and comments.
Not all commands have a query form. Unless a command is specified as “No Query” or “Query Only” in the “Comments” column of Table 2-2, it has both a command and a query form. Any command in the table that is shown with a “?” at the end, is a “Query Only” command.
Std/New Column
The Std/New column in Table 2-2 gives the status of the command with respect to the SCPI standard. The “Std” commands operate as defined in the SCPI standard and as defined in this guide.
The category of “New” consists of commands that could be:
• SCPI approved but are not yet in the SCPI manual
• HP approved and submitted for SCPI approval.
• Not approved at all.
The “New” commands operate as defined in this guide.
Parameter Form Column
Refer to the section titled “Parameter Types” on page 3-11 in Chapter 3, “Programming Your Counter for Remote Operation,” for descriptions of the different parameter types (such as <Boolean>, <NRf>, <arbitrary block>, etc.).
2-20
Page 45
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary
Keyword/Syntax Parameter Form Std/
Comments
New
:ABORt Std Event; no query. Aborts measurement in progress. :CALCulate[1]
:DATA? :FEED
:IMMediate :AUTO
:MATH [:EXPRession] :CATalog?
[:DEFine]? :NAME | :SELect :STATe
:CALCulate2
:FEED
:IMMediate :AUTO :LIMit
:CLEar :AUTO [:IMMediate] :DISPlay
:FAIL?
"[:]SENSe[1]"
<Boolean>
SCALE_OFFSET <Boolean>
"[:]CALCulate[1]"
<Boolean>
<Boolean> GRAPh | NUMBer
Std
Std Std
Std Std
Std Std New
New New Std
Std Std
Std Std Std
Std Std Std New
Std
Subsystem. Performs post-aquisition math processing (scale and offset) and data transfer on the data acquired by a SENSe function. Query only. Returns scaled/offset measurement result. Sets the data flow to be fed into the CALCulate block. Event or query; causes the Counter to recalulate existing data without re-acquiring. Enables/disables automatic post-processing. Subtree. Subtree. Returns the name of the defined equation, SCALE_OFFSET. Returns the expression (equation) used for math (scale/offset) processing. Sets the name of selected math expression (equation). Enables/disables math (scale/offset) processing. Note that this setting must be enabled for any of the other :CALC[1] settings to be used.
Subsystem. Performs post-aquisition limit testing and data transfer. Sets the data flow to be fed into the CALCulate2 block. Event; no query. Causes the Counter to recalculate existing data without re-acquiring. Enables/disables automatic post-processing. Subtree. Collects together the commands associated with controlling and getting reports from a single LIMit test. Subtree. Enables the automatic clearing of limit test results. Event; no query. Clears the limit test results. Sets whether the measurement display is numeric or symbolic (on a graph). Query only. Returns a 0 or 1 to indicate if the last tested measurement passed or failed the limit test. 0 = pass; 1 = fail.
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
Comments
2-21
Page 46
Commands Summary
HP 53181A Command Summary
:CALCulate2 (Cont.)
:LIMit (Cont.) :FCOunt :LOWer?
:UPPer? [:TOTal]? :LOWer
[:DATA]
<numeric_value> [HZ | S]
Std New
New New Std
Std
Subtree. An abbreviation for Fail COunt. Query only. Returns the number of limit test failures at the lower limit. Query only. Returns the number of limit test failures at the upper limit. Query only. Returns the total number of measurements that failed the limit test. Subtree. Sets lower limit used in limit testing.
:STATe
:UPPer [:DATA]
:PCOunt [:TOTal]?
:CALCulate3
:AVERage :ALL? :CLEar :COUNt :CURRent? [:STATe]
:TYPE
:DATA? :FEED
<Boolean>
<numeric_value> [HZ | S]
<numeric_value>
<Boolean>
MAXimum | MINimum | SDEViation | SCALar or MEAN
"[:]CALCulate[1]"
Std
Std Std
New New
Std Std New Std Std New Std
Std
Std Std
Sets the limit test enable. Note that this setting must be enabled for any of the other :CALC2 settings can be used. Subtree. Sets upper limit used in limit testing.
Subtree. An abbreviation for Pass COunt. Query only. Returns the total number of measurements that passed the limit test.
Subsystem. Performs post-aquisition statistics computation and data transfer. Subtree. Collects together the commands associated with the Statistics capabilities. Returns all four Statistics reults (i.e., mean, standard deviation, maximum, and minimum). Event; no query. Clears the statistics results and statistics count. Selects number of measurements to combine for statistics. Query only. Returns the current number of data values collected, thus far. Enables/disables statistics post-processing. Note that this setting must be enabled for any of the other :CALC3 settings to be used. Selects which statistic will be in :CALC3:DATA?,and on the front-panel display.
Query only. Returns statistic result specified by :CALC3:AVER:TYPE. Sets the data flow to be fed into the CALCulate3 block.
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
2-22
Comments
Page 47
:CALCulate3 (Cont.)
:LFILter :LOWer [:DATA]
Commands Summary
HP 53181A Command Summary
New
<numeric_value> [HZ | S]
New New
Subtree. Limit FILter for statistics. Subtree. Sets the statistics filter lower limit.
:STATe :UPPer [:DATA]
:PATH?
:CALibration
[:ALL]? :COUNt? :DATA :SECurity
:CODE :STATe
:CONFigure Std See Measurement Instructions in this table. :DIAGnostic
:CALibration :INPut :GAIN :AUTO :OFFSet :AUTO :INTerpolator :AUTO
<Boolean> <numeric_value> [HZ | S]
<arbitrary block>
<NRf> <Boolean>, <NRf>
ONCE | OFF ONCE | OFF ONCE | OFF | ON
New New New
Std Std
Std New Std New
New New
Std New New New New New New New New
Sets the statistics filter enable. Subtree. Sets the statistics filter upper limit.
Query only. Returns LFIL, AVER. Subsystem.
Query only. Causes an internal interpolator self-calibration. Query only. Returns value indicating number of times the Counter has been calibrated. Transfers the calibration data (input gain, input offset, and reference oscillator).
No query. Sets the calibration security code. Enables or prevents calibration of the Counter. Query returns security status. 0 = unsecure; calibration allowed. 1 = secure; calibration disallowed.
Subsystem. Subtree. Subtree. Subtree. ONCE calibrates channel 1 input gain. Subtree. ONCE calibrates channel 1 input offset. Subtree. ONCE calibrates the interpolators.
2-23
Page 48
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
:DIAGnostic
:CALibration (Cont.) :ROSCillator
:AUTO
:STATus? :MEASure
:RESolution?
:DISPlay
:ENABle :MENU [:STATe]
[:WINDow] :TEXT
:FEED
:MASK :RADix
ONCE | OFF
<Boolean> OFF
"[:]CALCulate2" | "[:]CALCulate3"
<numeric_value> COMMa | DPOint
New New
New New
New
Std Std
Std Std
Std Std
Std
New New
Comments
Subtree. ROSCillator is an abbreviation for Reference OSCillator. ONCE calibrates the timebase. This command is usable only if the instrument contains the medium or high stability oscillator option. Query only. Returns status of last calibration. 0 = pass; 1 = fail. Subtree. Query only. Returns the resolution of the current measurement. HIGH = the Counter is using the continuous count technology to produce a high-resolution result. NORM = the Counter is using the same resolution as a traditional counter.
Subsystem. Controls the selection and presentation of textual information on the display. Controls whether the whole display is visible. Subtree. Sets the Counter to switch from the menu display to the result display. Subtree. Subtree. Allows for the display of textual information. Sets which data flow is fed into the display. “CALC2” specifies the raw measurement, scaled/offset measurement, or Limit Graph display. “CALC3” specifies the statistics result display. Sets the number of least significant display digits “masked” from the measurement result display. Sets the character used to separate integral and fractional portions of a number. (USA numerical convention is Decimal POint.)
:FETCh Std See Measurement Instructions in this table. :FORMat
[:DATA] ASCii | REAL
:HCOPy
:CONTinuous <Boolean>
Std Std
New New Enables or disables printing results.
Subsystem. Sets a data format for transferring numeric information. Sets the data format.
2-24
Page 49
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
Comments
New
:INITiate
:AUTO
:CONTinuous [:IMMediate]
:INPut
:ATTenuation :COUPling :FILTer
[:LPASs] [:STATe] :FREQuency?
:IMPedance
:INPut2
:COUPling? :IMPedance?
:MEASure Std See Measurement Instructions in this table.
<Boolean>
<Boolean>
1 | 10 AC | DC
<Boolean>
<numeric_value> [OHM]
Std New
Std Std
Std Std
Std Std
Std Std Std
Std Std
Std Std
Subsystem. Controls the initiation of measurements. AUTO ON enables the Counter to automatically stop measuring on a limit test failure. AUTO OFF disables the automatic stop. Sets the enable for continuously initiated measurements. Event; no query. Causes the instrument to initiate the number of measurements specified by :TRIGger:COUNt:AUTO.
Subsystem. Controls the characteristics of the instrument's channel 1 input port. Sets input attenuation. Sets input coupling. Subtree. Allows a low pass filter to be inserted in the path of the measurement signal. Subtree. Controls the Low PASs filter. Sets the Low PASs filter enable. Query only. Returns the cutoff frequency of the low pass filter. Units are Hertz. Sets input impedance (50 Ω or 1 MΩ ).
Subsystem. Queries the characteristics of the Counter's input channel 2. Query only. Returns channel 2 input coupling. Query only. Returns channel 2 input impedance.
2-25
Page 50
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
Comments
New
Measurement Instructions* :CONFigure[:SCALar]:<function>
:CONFigure? :MEASure[:SCALar]:<function>?
:READ[[:SCALar]:<function>]? :FETCh[[:SCALar]:<function>]?
*The <function> and corresponding <parameters> and <source list> are defined by the following listing in this table.
<function> *
[:VOLTage]:FREQuency [:VOLTage]:FREQuency:RATio
[:VOLTage]:MAXimum [:VOLTage]:MINimum
[:VOLTage]:PERiod [:VOLTage]:PTPeak
See <parameters> and <source_list> in table on the next page.
See <parameters> and <source_list> in table on the next page.
<parameters>
[<expected_value>[,<resolution>]] [<expected_value>[,<resolution>]]
[<expected_value>[,<resolution>]]
Std
Std Std
Std Std
Configures instrument to perform specified measurement.
Returns function configured by the last :CONF or :MEAS command. Configures instrument, initiates measurement, and queries for the result (i.e., provides complete measurement sequence).
Initiates measurement, and queries for the result. (Performs a :FETCh? on “fresh” data.) Queries the result.
[,<source_list>] **
[ (@1) | (@2) ] [ (@1), (@2) | (@2), (@1) ]
[ (@1) ] [ (@1) ]
[ (@1) | (@2) ] [ (@1) ]
Std/ New
Std New
Std Std
Std Std
______________________________ * The only functions which can be derived (using FETC? or READ?) from the stored data are
period to/from frequency, maximum to/from minimum, maximum to/from peak-to-peak, and minimum to/from peak-to-peak. Ratio results require an acquisition of the ratio function.
** <source_list> has the same syntax as SCPI <channel _list> syntax. For example, a
single-channel function (e.g., frequency, period, etc.) would use (@1) to specify channel 1, whereas a two-channel function (e.g., frequency ratio) would use (@1), (@2) to specify a measurement between channel 1 and channel 2.
2-26
Page 51
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
Comments
New
:MEMory
:DELete :MACRo
:FREE :MACRo?
:NSTates?
:READ Std See Measurement Instructions in this
[:SENSe]
:DATA?
:EVENt :HYSTeresis
:RELative :LEVel
[:ABSolute] :AUTO
:RELative
:SLOPe
<string>
["[:]SENSe[1]"]
<numeric_value> [PCT]
<numeric_value> [V] <Boolean>
<numeric_value> [PCT]
POSitive | NEGative
Std Std
New
Std Std
Std
Std Std
New New
New New
New New
New
New
Subsystem. Manages instrument memory. Subtree. Event; no query. Deletes the macro with the name specified by the string parameter. Subtree. Query only. Returns memory usage and availability corresponding to macro data. Query only. Returns the number of available *SAV/*RCL states in the instrument.
table. Subsystem setup commands.
Query only. Returns the current measurement result data of the SENSe subsystem (no scale or offset applied). Subtree. Defines the channel 1 “trigger event.” Subtree. Sets the size of the hysteresis window as a percentage of allowable hysteresis. Subtree. Sets the level at the center of the hysteresis window. Sets the “auto-trigger” enable. Sets the percentage of the peak-to-peak range of the signal at which the instrument will auto trigger. 0-100%. Sets which edge of the input signal will be considered an event.
2-27
Page 52
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
[:SENSe] (Cont.)
:EVENt2 :LEVel
[:ABSolute]? :SLOPe?
:FREQuency :ARM [:STARt]
:SLOPe
:SOURce :STOP
:DIGits
:SLOPe
:SOURce :TIMer
:EXPected[1|2] :AUTO
POSitive | NEGative
IMMediate | EXTernal
<numeric_value>
POSitive | NEGative
IMMediate | EXTernal | TIMer | DIGits <numeric_value> [S]
<numeric_value> [HZ] ON
New New
New New
Std New New
New
New New
New
New
New New
New New
Comments
Subtree. Queries the characteristics of the “trigger event” for channel 2 input. Subtree. Query only. Returns the channel 2 input trigger level. Query only. Returns the edge of the channel 2 input that will be considered an event.
Subtree. Controls the frequency, frequency ratio, and period measuring capabilities of the instrument. Subtree. Synchronizes the frequency start and stop arm with events. Subtree. Sets the slope of the external start arm signal used in external arming frequency, frequency ratio, and period measurements. Only applies when [:SENS]:FREQ:ARM[:STAR]:SOUR EXT is selected. Sets the start arm for frequency, frequency ratio, and period measurements. Subtree. Sets the resolution in terms of digits used in arming frequency, frequency ratio, and period measurements.Only applies when [:SENS]:FREQ:ARM:STOP:SOUR DIG is selected. Sets the slope of the external stop arm signal used in external arming frequency, frequency ratio, and period measurements. Only applies when [:SENS]:FREQ:ARM:STOP:SOUR EXT is selected. Sets the stop arm for frequency, frequency ratio, and period measurements. Sets the gate time used in arming frequency, frequency ratio, and period measurements. Only applies when [:SENS]:FREQ:ARM:STOP:SOUR TIM is selected. Specifies the approximate frequency of a signal you expect to measure at channel 1 or 2. Configures Counter to perform a pre-measurement step to automatically determine the approximate frequency of the measurement signal(s).
2-28
Page 53
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
[:SENSe] (Cont.)
:FUNCtion [:ON]
:ROSCillator :EXTernal :CHECk
:FREQuency? :SOURce
:AUTO
<sensor_function> (See below) "[:][XNONe:]FREQuency [1 | 2]"
"[:][XNONe:]FREQuency:RATio [1,2 | 2,1]" "[:][XNONe:]PERiod [1 | 2]" "[:][XNONe:]VOLTage:MAXimum [1]" "[:][XNONe:]VOLTage:MINimum [1]" "[:]{XNONe:]VOLTage:PTPeak [1]
ON | OFF | ONCE
INTernal | EXTernal <Boolean>
Std Std Std
Std Std New New New Std Std New
Std Std
Std
Comments
Subtree. Selects the <sensor function> to be sensed by the instrument. Sets the <sensor function> to be sensed by the instrument. Frequency on channel 1 or 2. Frequency Ratio 1 to 2, or 2 to 1. Period on channel 1 or 2. Voltage Maximum on channel 1. Voltage Minimum on channel 1. Voltage Peak to Peak on channel 1. Subtree. Controls the Reference OSCillator. Subtree. Set the enable for checking the validity and presence of the external reference. Query only. Returns the frequency value of the external reference oscillator. Sets the selection of a reference timebase. Sets the enable for automatically selecting a reference timebase.
2-29
Page 54
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
:STATus
:OPERation :CONDition?
:ENABle [:EVENt]?
:NTRansition :PTRansition :PRESet
:QUEStionable :CONDition?
:ENABle [:EVENt]? :NTRansition :PTRansition
<non-decimal numeric> | <NRf>
<non-decimal numeric> | <NRf> <non-decimal numeric> | <NRf>
<non-decimal numeric> | <NRf>
<non-decimal numeric> | <NRf> <non-decimal numeric> | <NRf>
Std Std
Std Std
Std Std Std Std
Std Std
Std Std Std Std
Comments
Subsystem. Controls the SCPI-defined (Operation and Questionable) status-reporting structures. Subtree. Query only.Queries the Operation Condition Status Register. Sets the Operation Event Status Enable Register. Query only. Queries the Operation Event Status Register. Sets the negative transition filter for the Operation status reporting structure. Sets the positive transition filter for the Operation status reporting structure. Event; No query. Presets the enable registers and transition filters associated with the Operation and Questionable status reporting structures. Subtree. Query only. Queries the Questionable Data Condition Status Register. Sets the Questionable Data Event Status Enable Register. Query only. Queries the Questionable Data Event Status Register. Sets the positive transition filter for the Questionable Data status reporting structure. Sets the negative transition filter for the Questionable Data status reporting structure.
2-30
Page 55
Commands Summary
HP 53181A Command Summary
Table 2-2. HP 53181A SCPI Command Summary (Continued)
Keyword/Syntax Parameter Form Std/
New
:SYSTem
:COMMunicate :SERial :TRANsmit :BAUD
:PARity [:TYPE] :PACE :CONTrol :DTR
:ERRor?
:KEY :LOG?
:VERSion?
:TRACe
:CATalog? [:DATA] [:DATA] [:DATA]? [:DATA]?
:TRIGger
:COUNt :AUTO <Boolean>
<numeric_value> EVEN | ODD | NONE
XON | NONE IBFull | ON | LIMit
<numeric_value>
OFFSET, <numeric_value> [HZ | S] SCALE, <numeric_value> OFFSET SCALE
Std Std Std Std Std
Std Std Std Std Std
Std
Std New
Std
Std Std Std Std Std Std
Std Std New
Comments
Subsystem. Collects the functions that are not related to instrument performance. Subtree. Collects together configuration of control/communication interfaces. Subtree. Controls the physical configuration of the RS-232C port. Subtree. Affects parameters associated with transmission. Sets the baud rate. Subtree. Controls the parity of the channel. Sets the parity scheme. Sets the software pacing scheme. Subtree. Sets the usage of the DTR line of the RS-232 port. Query only. Queries the oldest error in the Error Queue and removes the error from the queue (first in, first out). Simulates the pressing of a front-panel key. Query only. Returns a comma-separated list of integers representing all of the entries in the Key Queue. Query only. Returns the SCPI version number with which the Counter complies.
Subsystem. Query only. Returns list of intrinsic constants. Sets the offset value. Sets the scale value. Queries the offset value. Queries the scale value.
Subsystem. Subtree. Controls the number of measurements to be made when :INIT[:IMM] is performed.
2-31
Page 56
Commands Summary
*RST Response
RST Response
*
The IEEE 488.2 *RST command returns the instrument to a specified state optimized for remote operation. (Use *CLS to clear the status event registers and the SCPI error queue.)
The states of commands affected by the *RST command are described in Table 2-3. Table 2-4 lists commands that are unaffected by *RST.
Table 2-3. HP 53181A *RST State
Command Header Parameter State
:CALCulate[1]:FEED :CALCulate[1]:IMMediate:AUTO :CALCulate[1]:MATH[:EXPRession]:NAME :CALCulate[1]:MATH:STATe
:CALCulate2:FEED :CALCulate2:IMMediate:AUTO :CALCulate2:LIMit:CLEar:AUTO :CALCulate2:LIMit:DISPlay :CALCulate2:LIMit:LOWer[:DATA] :CALCulate2:LIMit:STATe :CALCulate2:LIMit:UPPer[:DATA]
:CALCulate3:AVERage:COUNt :CALCulate3:AVERage[:STATe] :CALCulate3:AVERage:TYPE
:CALCulate3:FEED :CALCulate3:LFILter:LOWer[:DATA] :CALCulate3:LFILter:STATe :CALCulate3:LFILter:UPPer[:DATA]
DDT
*
:DIAGnostic:CALibration:INTerpolator:AUTO ON | OFF | ONCE ON :DISPlay:ENABle
:DISPlay:MENU[:STATe] :DISPlay[:WINDow]:TEXT:FEED
:DISPlay[:WINDow]:TEXT:MASK
EMC
*
:FORMat[:DATA] ASCii | REAL ASCii
"[:]SENSe[1]" <Boolean> SCALE_OFFSET <Boolean>
"[:]CALCulate[1]" <Boolean> <Boolean> GRAPh | NUMBer <numeric_value> <Boolean> <numeric_value>
<numeric_value> <Boolean> MAXimum | MINimum | SDEViation | MEAN "[:]CALCulate[1]" <numeric_value> <Boolean> <numeric_value>
<arbitrary block> #14INIT
<Boolean> OFF "[:]CALCulate2" | "[:]CALCulate3" <numeric_value>
<NRf> 0 (i.e., disabled)
"SENSe[1]" OFF SCALE_OFFSET OFF
"CALCulate[1]" OFF ON NUMBer
0.0000000000 OFF
0.0000000000 100
OFF MEAN
"CALCulate[1]"
0.0000000000 OFF
0.0000000000
ON OFF "CALCulate2"
0
2-32
Page 57
Commands Summary
*RST Response
Table 2-3. HP 53181A *RST State (Continued)
Command Header Parameter State
:HCOPy:CONTinuous <Boolean> OFF :INITiate:AUTO
:INITiate:CONTinuous :INPut:ATTenuation
:INPut:COUPling :INPut:FILTer[:LPASs]:STATe :INPut:IMPedance
[:SENSe]:EVENt:HYSTeresis:RELative
<Boolean> <Boolean>
1 | 10 AC | DC <Boolean> <numeric_value> [OHM]
<numeric_value> [PCT]
OFF OFF
1 AC OFF 1E6 OHM
100 PCT
[:SENSe]:EVENt:LEVel[:ABSolute]:AUTO [:SENSe]:EVENt:LEVel:RELative [:SENSe]:EVENt:LEVel:SLOPe
[:SENSe]:FREQuency:ARM[:STARt]:SLOPe [:SENSe]:FREQuency:ARM[:STARt]:SOURce
[:SENSe]:FREQuency:ARM:STOP:DIGits [:SENSe]:FREQuency:ARM:STOP:SLOPe [:SENSe]:FREQuency:ARM:STOP:SOURce [:SENSe]:FREQuency:ARM:STOP:TIMer [:SENSe]:FREQuency:EXPected[1|2]:AUTO
[:SENSe]:FUNCtion[:ON] [:SENSe]:ROSCillator:EXTernal:CHECk
[:SENSe]:ROSCillator:SOURce:AUTO :SYSTem:KEY? :SYSTem:KEY:LOG? :TRACe[:DATA]
:TRACe[:DATA] :TRIGger:COUNt:AUTO <Boolean> OFF
<Boolean> <numeric_value> [PCT] POSitive | NEGative
POSitive | NEGative IMMediate | EXTernal
<numeric_value> POSitive | NEGative IMMediate | EXTernal | TIMer | DIGits <numeric _value> [S] ON
<sensor_function> ON | OFF | ONCE
<Boolean>
__________ __________
OFFSET, <numeric_value> SCALE, <numeric_value>
ON 50 PCT POSitive
POSitive IMMediate
4 NEGative TIMer 100E−3 S ON
"FREQuency 1" ON
ON Key Queue cleared Key Queue cleared
0.0000000000
1.000000
2-33
Page 58
Commands Summary
*RST Response
Table 2-4. Unaffected by *RST
Item
ESE
*
OPC?
*
SRE
*
WAI
*
:CALibration:COUNt? :CALibration:DATA :CALibration:SECurity:CODE :CALibration:SECurity:STATe :DISPlay[:WINDow]:TEXT:RADix :STATus:OPERation:ENABle :STATus:OPERation:NTRansition :STATus:OPERation:PTRansition :STATus:QUEStionable:ENABle :STATus:QUEStionable:NTRansition :STATus:QUEStionable:PTRansition :SYSTem:COMMunicate:SERial:CONTrol:DTR :SYSTem:COMMunicate:SERial:TRANsmit:BAUD :SYSTem:COMMunicate:SERial:TRANsmit:PACE :SYSTem:COMMunicate:SERial:TRANsmit:PARity[:TYPE] :SYSTem:ERRor? (Error Queue) HP-IB Address
2-34
Page 59
3
Programming Your Counter for Remote Operation
Page 60
Programming Your Counter for Remote Operation
Introduction
Introduction
This chapter provides remote operation setup, and programming information that helps you operate the Counter as a remote device.
Chapter Summary
• Configuring the HP-IB pg. 3- 4
• Overview of Command Types and Formats pg. 3- 7
• Elements of SCPI Commands pg. 3- 8
• Using Multiple Commands pg. 3-13
• Overview of Response Message Formats pg. 3-15
• Status Reporting pg. 3-18
• Command Settings for Optimizing Throughput pg. 3-21
• How to Program the Counter for Status Reporting pg. 3-40
• How to Program the Counter to Display Results pg. 3-45
• How to Program the Cou nter to Synchronize
Measurements pg. 3- 48
• How to Program the Counter for Math/Limit
Operation pg. 3- 51
• How to Program the Counter to Define Macros pg. 3- 53
• Writing SCPI Programs pg. 3- 56
• Programming Examples pg. 3- 59
Where to Find Some Specific Information
• To Set the HP-IB Mode and Address pg. 3- 4
• To Connect the Counter to a Computer pg. 3- 6
• Remote/Local Operation pg. 3- 6
• Common Command Format pg. 3- 7
• SCPI Command and Query Format pg. 3-7
• Abbreviated Commands, Keyword Separator pg. 3-9
• Optional Keyword pg. 3- 10
• Implied Channel (Optional Numeric Keyword Suffix) pg. 3- 10
• Parameter Types pg. 3- 11
• Parameter Separator, Query Parameters, Suffixes pg. 3-12
• Command Terminator pg. 3- 13
• Program Messages pg. 3- 14
• Response Messages, Response Message Syntax pg. 3- 16
3-2
Page 61
Programming Your Counter for Remote Operation
Introduction
Where to Find HP BASIC Programming Examples
• Easiest Way to Make a Measurement pg. 3- 61
• To Make a Frequency Measurement pg. 3- 63
• To Perform Limit Testing pg. 3- 64
• To Measure the Statistics of 50 Measurements pg. 3-65
• To Use Limits to Filter Data Before Measuring Stats pg. 3- 67
• To Read and Store Calibration Data pg. 3-69
• To Optimize Throughput pg. 3-70
• To Use Macros pg. 3- 73
Where to Find QuickBASIC Programming Examples
• To Make a Frequency Measurement pg. 3- 76
• To Perform Limit Testing pg. 3- 77
• To Measure the Statistics of 50 Measurements pg. 3-79
• To Use Limits to Filter Data Before Measuring Stats pg. 3-81
• To Read and Store Calibration Data pg. 3-85
• To Optimize Throughput pg. 3-86
• To Use Macros pg. 3- 88
Where to Find Turbo C Programming Examples
• To Make a Frequency Measurement pg. 3-91
• To Use Limits to Filter Data Before Measuring Stats pg. 3-94
• To Optimize Throughput pg. 3-97
3-3
Page 62
Programming Your Counter for Remote Operation
Configuring the HP-IB
Configuring the HP-IB
This section gives information on connecting and configuring the HP-IB to enable remote operation of the Counter .
The Counter has two HP-IB operating modes :
• Addressed (talk/listen) —This mode is for bi-directional communication. The
Counter can receive commands and setups from the computer, and can send data and measurement results.
To select the talk/listen operating mode, set the Counter's HP-IB address from 0 to 30. Refer to the following section titled “To Set the HP-
IB Mode and Address” for instructions on how to set an HP-IB address from the front-panel.
• Talk-only—In this mode, the Counter can send data to a printer. It cannot
receive commands or setups from the computer.
To select the talk-only operating mode, set the Counter's HP-IB mode to “TALK”. Refer to the following section titled “To Set the HP-IB Mode
and Address” for instructions on how to set the talk-only mode from the front-panel.
When the Counter is shipped from the factory, it is configured as addressed (talk/listen) with the address set to “3.”
To Set the HP-IB Mode and Address
1 Press and hold Recall (Utility) key, then cycle POWER.
2 Press Recall (Utility) key until HP-IB: is displayed.
To best demonstrate how to set the address, let's assume that HP-IB: 3 is currently being displayed.
3a To set the address to “15”, perform the following:
a. Press s key.
HP-IB: 03 is displayed. Note that “0” digit appears and is highlighted, indicating that this digit will change when the d or f arrow key is pressed.
3-4
Page 63
Programming Your Counter for Remote Operation
Configuring the HP-IB
b. Press the appropriate arrow keys until HP-IB: 15 is displayed. c. Go on to step 4.
3b To set the HP-IB mode to “TALK,” perform the following:
a. Press s key.
HP-IB: 03 is displayed. Note that “0” digit appears and is highlighted, indicating that this digit will change when the d or f arrow key is pressed.
b. Press d key until HP-IB: TALK is displayed. c. Go on to step 4.
4 Press Enter key.
NOTE
BE SURE to press the Enter key to complete the entry.
The address/mode is now stored in non-volatile memory, and does not change when power is cycled or after a remote interface reset.
3-5
Page 64
Programming Your Counter for Remote Operation
Configuring the HP-IB
To Connect the Counter to a Computer
Connect the Counter to a computer by simply installing an HP-IB cable (such as an HP 10833A cable) between the two units as shown in Figure 3-1.
Figure 3-1. HP-IB Interconnection
Remote/Local Operation
While in remote, the front-panel Remote indicator is on, and the Counter settings cannot be affected by the front-panel controls. The Save & Print key may be used to manually return to local control (only if local-lockout is off).
If an error occurs while the Counter is in remote, the front -panel Remote indicator flashes until the controller has read or cleared the error queue, or until the front panel returns to local control.
While in local, the front-panel Remote indicator is off.
3-6
Page 65
Programming Your Counter for Remote Operation
Overview of Command Types and Formats
Overview of Command Types and Formats
There are two types of HP 53181A programming commands: IEEE 488.2 Common Commands and Standard Commands for Programmable Instruments (SCPI). The IEEE 488.2 Common Commands control and manage communications between the HP 53181A and the controller or personal computer. The SCPI commands control instrument functions. The format of each type of command is described in the following paragraphs. (Refer to Chapter 2, “Commands Summary,” for SCPI conformance information.)
Common Command Format
The IEEE 488.2 Standard defines the Common commands as commands that perform functions like reset, self-test, status byte query, and identification. Common commands always begin with the asterisk (*) character, and may include parameters. The command keyword is separated from the first parameter by a space character. Some examples of Common commands are as follows:
*RST *IDN? *RCL 1
SCPI Command and Query Format
SCPI commands perform functions like instrument setup. A subsystem command has a hierarchical structure that usually consists of a top level (or root) keyword, one or more lower-level keywords, and parameters. The following example shows a command and its associated query:
:INPut:COUPling AC :INPut:COUPling?
INPut is root-level keyword with COUPling the second level keyword, and AC is the command parameter.
3-7
Page 66
Programming Your Counter for Remote Operation
Elements of SCPI Commands
Elements of SCPI Commands
A program command or query is composed of functional elements that include a header (or keywords with colon separators), program data, and terminators . These elements are sent to the Counter over the HP-IB as a sequence of ASCII data messages. Examples of a typical Common Command and Subsystem Command are:
OUTPUT 712;"*CLS" OUTPUT 712;":INP:COUP AC;IMP 1.0 MOHM"
Subsystem Command Syntax
Figure 3-2 shows the simplified syntax of a Subsystem Command. You must use a space (SP) between the last command mnemonic and the first parameter in a Subsystem Command. Note that if you send more than one parameter with a single command, you must separate adjacent parameters with a comma .
NOTE: sp = space. ASCII character decimal 32
Figure 3-2. Simplified Program Command Syntax Diagram
Common Command Syntax
Figure 3-3 shows the simplified syntax of a Common Command . You must use a space (SP) between the command mnemonic and the parameter in a Common Command.
3-8
Page 67
Programming Your Counter for Remote Operation
Elements of SCPI Commands
NOTE: sp = space. ASCII character decimal 32
Figure 3-3. Simplified Common Command Syntax Diagram
Abbreviated Commands
The command syntax shows most keywords as a mixture of upper and lower case letters. Upper case letters indicate the abbreviated spelling for the command. For better program readability, you may send the entire keyword. The HP 53181A accepts either command form and is not case sensitive.
For example, if the command syntax shows CALCulate, then CALC and CALCULATE are both acceptable forms. Other forms of CALCulate, such as CALCU or CALCULA will generate an error. You may use upper and/or lower case letters. Therefore, CALCULATE, calculate, and CaLcUlAtE are all acceptable.
Keyword Separator
A colon (:) always separates one keyword from the next lower-level keyword as shown below:
:INPut:COUPling?
3-9
Page 68
Programming Your Counter for Remote Operation
Elements of SCPI Commands
Optional Keyword
Optional keywords are those which appear in square brackets ([ ]) in the command syntax. (Note that the brackets are not part of the command and are not sent to the Counter.)
Suppose you send a second level keyword without the preceding optional keyword. In this case, the Counter assumes you intend to use the optional keyword and responds as if you had sent it.
Examine the portion of the [:SENSe] subsystem shown below:
[:SENSe] :FREQuency :ARM :STOP :SOURce EXTernal
The root-level keyword [:SENSe] is an optional keyword. To set the Counter's frequency stop arm to external, you can use either of the following:
:SENS:FREQ:ARM:STOP:SOUR EXT
or
:FREQ:ARM:STOP:SOUR EXT
3-10
Page 69
Programming Your Counter for Remote Operation
Elements of SCPI Commands
Parameter Types
Table 3-1 contains explanations and examples of parameter types. Parameter types may be numeric value, Boolean , literal, NRf, string , non-decimal numeric , or arbitrary block.
Table 3-1. Command and Query Parameter Types
TYPE EXPLANATIONS AND EXAMPLES
<numeric value>
<Boolean>
<literal> <NRf> <string>
<non-decimal numeric>
<arbitrary block>
Accepts all commonly used decimal representation of numbers including optional signs, decimal points, and scientific notation: 123, 123e2, -123, −1.23e2, .123, 1.23e−2, 1.23000E−01.
Special cases include MINimum and MAXimum as follows: MINimum selects minimum value available. MAXimum selects maximum value available.
Queries using MINimum or MAXimum return the associated numeric value. Represents a single binary condition that is either true or false:
1 or ON, 0 or OFF (Query response returns only 1 or 0.) An <NRf> is rounded to an integer. A non-zero value is interpreted as 1. Selects from a finite number of choices. These parameters use mnemonics to represent each
valid setting. An example is the INPut:COUPling AC | DC command parameters (AC | DC). Flexible numeric representation. Only positive integers are used for NRf parameters in the
Counter. A string parameter is delimited by either single quotes or double quotes. Within the quotes, any
characters in the ASCII 7-bit code may be specified. The following HP BASIC program statement sends a command containing a <string> parameter:
OUTPUT 703;"FUNC ‘FREQ’"
Format for specifying hexadecimal (#H1F), octal (#Q1077), and binary (#B10101011) numbers using ASCII characters. May be used in :STATus subsystem commands.
The syntax is a pound sign (#) followed by a non-zero digit representing the number of digits in the subsequent decimal integer. The decimal integer specifies the number of 8-bit data bytes being sent. This is followed by the actual data. The terminator is a line feed asserted with EOI. For example, for transmitting 8 bytes of data, the format could be:
The “2” indicates the number of digits that follow and the two digits “08” indicate the number of data bytes to be transmitted.
A zero-length block has the format: #0<new line>^EOI <new line> is defined as a single ASCII-encoded byte corresponding to 10 decimal.
3-11
Page 70
Programming Your Counter for Remote Operation
Elements of SCPI Commands
Parameter Separator
If you send more than one parameter with a single command, you must separate adjacent parameters with a comma .
Query Parameters
All selectable <numeric value> parameters can be queried to return the minimum or maximum values they are capable of being set to by sending a MINimum or MAXimum parameter after the “?.” For example, consider the INPut:IMPedance? query.
If you send the query without specifying a parameter (INP:IMP?), the present impedance value is returned. If you send the MIN parameter (using INP:IMP? MIN), the command returns the minimum level currently available. If you send the MAX parameter, the command returns the maximum level currently available. Be sure to place a space between the question mark and the parameter.
Suffixes
A suffix is the combination of suffix elements and multipliers that can be used to interpret the <numeric value> sent. If a suffix is not specified, the Counter assumes that <numeric value> is unscaled (that is, Volts, seconds, etc.)
For example, the following two commands are equivalent:
OUTPUT 703;"INP:IMP 1 MOHM" OUTPUT 703;"INP:IMP 1E+6"
Suffix Elements
Suffix elements , such as HZ (Hertz), S (seconds), V (volts), OHM (Ohms), PCT (percent), and DEG (degrees) are allowed within this format.
3-12
Page 71
Programming Your Counter for Remote Operation
Elements of SCPI Commands
Suffix Multipliers
Table 3-2 lists the suffix multipliers that can be used with suf fix elements (except PCT and DEG).
Table 3-2. Suffix Multipliers
DEFINITION MNEMONIC NAME
1E18 EX EXA 1E15 PE PETA 1E12 T TERA 1E9 G GIGA 1E6 MA ( or M for OHM and HZ)* MEGA 1E3 K KILO 1E-3 M (except for OHM and HZ)* MILLI 1E-6 U MICRO 1E-9 N NANO 1E-12 P PICO 1E-15 F FEMTO 1E-18 A ATTO *The suffix units, MHZ and MOHM, are special cases that should not be confused with
<suffix multiplier>HZ and <suffix multiplier>OHM.
Command Terminator
A command may be terminated with a <new line> (ASCII character decimal 10), an EOI (End-of-Identify) asserted concurrent with last byte, or an EOI asserted concurrent with a <new line> as the last byte.
3-13
Page 72
Programming Your Counter for Remote Operation
Using Multiple Commands
Using Multiple Commands
Program Messages
Program Messages are a combination of one or more properly formatted SCPI Commands. Program messages always go from a computer to the Counter. They are sent to the Counter over the Counter's HP-IB as a sequence of ASCII data messages.
Program Message Syntax
Figure 3-4 shows the simplified syntax of a program message. You can see Common Commands and Subsystem Commands in the same program message. If you send more than one command in one message, you must separate adjacent commands with a semicolon.
NOTE: <new line> = ASCII character decimal 10 ^END = EOI asserted concurrent with last byte
Figure 3-4. Simplified Program Message Syntax Diagram
When using IEEE 488.2 Common commands with SCPI Subsystem commands on the same line, use a semicolon between adjacent commands. For example:
*RST;:INP:COUP AC
When multiple subsystem commands are sent in one program message, the first command is always referenced to the root node. Subsequent commands, separated by “;”, are referenced to the same level as the preceding command if no “:” is present immediately after the command separator (the semicolon).
For example, sending :INP:COUP AC;IMP 50 is equivalent to
sending:
:INP:COUP AC :INP:IMP 50
3-14
Page 73
Programming Your Counter for Remote Operation
Using Multiple Commands
or
:INP:COUP AC;:INP:IMP 50
The “:” must be present to distinguish another root level command. For example:
:INP:COUP AC;:INIT:CONT OFF
is equivalent to sending:
:INP:COUP AC :INIT:CONT OFF
If the “:”(which is following the “;” and is in front of INIT) is omitted, the Counter assumes that the second command is “:INP:INIT:CONT OFF” and generates a syntax error.
3-15
Page 74
Programming Your Counter for Remote Operation
Overview of Response Message Formats
Overview of Response Message Formats
Response Messages
Response messages are data sent from the Counter to a computer in response to a query. (A query is a command followed by a question mark. Queries are used to find out how the Counter is currently configured and to transfer data from the Counter to the computer.)
After receiving a query, the Counter interrogates the requested configuration and places the response in its HP-IB output queue. The output message remains in the queue until it is read or another command is issued. When read, the message is transmitted across the HP-IB to the computer. You read the message by using some type of enter statement that includes the device address and an appropriate variable. Use a print statement to display the message. The following HP BASIC example illustrates how to query the Counter and display the message:
10 OUTPUT 703;":INP:COUP?" 20 ENTER 703; A$ 30 PRINT A$ 40 END
Response Message Syntax
Figure 3-5 shows the simplified syntax of a Response Message. Response messages may contain both commas and semicolon separators. When a single query command returns multiple values, a comma is used to separate each item. When multiple queries are sent in the same program message, the groups of data corresponding to each query are separated by a semicolon. Note that a <new line> ^END is always sent as a response message terminator.
3-16
Page 75
Programming Your Counter for Remote Operation
Overview of Response Message Formats
NOTE: <new line> = ASCII character decimal 10 ^END = EOI asserted concurrent with last byte ; = multiple response separator (ASCII character decimal 59) , = data separator within a response (ASCII character decimal 44)
Figure 3-5. Simplified Response Message Syntax Diagram
3-17
Page 76
Programming Your Counter for Remote Operation
Overview of Response Message Formats
Response Message Data Types
Table 3-3 contains explanations of response data types.
Table 3-3. Response Message Data Types
Type Description
<NR1> This numeric representation has an implicit radix point.
The maximum number of characters in <NR1> response data is 17 (maximum 16 digits, 1 sign).
<NR2> This numeric representation has an explicit radix point.
The maximum number of characters in <NR2> response data is 17 (maximum 15 mantissa digits, 1 sign, 1 decimal point).
<NR3> This numeric representation has an explicit radix point and an exponent.
The maximum number of characters in <NR3> response data is 22 (maximum 15 mantissa digits, 2 signs, 1 decimal point, 1 'E' character, 3 exponent digits).
Not a Number Not a Number is represented by the value 9.91E37. (Not a Number is defined in
IEEE 754). The Counter responds with this numeric value when queried for a floating point number it cannot provide. This value will be formatted as an <NR3>.
3-18
Page 77
Programming Your Counter for Remote Operation
Overview of Response Message Formats
Table 3-3. Response Message Data Types (Continued)
Type Description
<Boolean> A single ASCII-encoded byte, 0 or 1, is returned for the query of settings that
use <Boolean> parameters.
<literal> ASCII-encoded bytes corresponding to the short form of the literal used as the
command parameter. For example, if the :CALC3:AVER:TYPE MAXimum command is sent to the
Counter, the :CALC3:AVER:TYPE? response would be MAX.
<string> A string response consists of ASCII characters enclosed by double quotes.
For example, string data is used for the “<error description>” portion of :SYST:ERR? response and for [:SENS]:FUNC? response.
<definite length block>
The syntax is a pound sign (#) followed by a non-zero digit representing the number of digits in the subsequent decimal integer. The decimal integer specifies the number of 8-bit data bytes being sent. This is followed by the actual data. The terminator is a line feed asserted with EOI. For example, for transmitting 8 bytes of data, the format might be:
The “2” indicates the number of digits that follow and the two digits “08” indicate the number of data bytes to be transmitted.
A zero-length block has the format: #0<new line>^EOI <new line> is defined as a single ASCII-encoded byte corresponding to
10 decimal.
3-19
Page 78
Programming Your Counter for Remote Operation
Status Reporting
Status Reporting
The HP 53181A status registers conform to the SCPI and IEEE 488.2 standards. Figure 3-6 shows all the status system register groups and queues in the Counter.
This is a high level drawing that does not show all the registers that are contained in each group. It is intended as a guide to the bits used in each of these register groups to monitor the Counter's status. Note that besides the Operation Status and the Questionable Data/Signal Register groups, a summary of the Standard Status Structure Registers (defined by IEEE 488.2-1987) is shown.
Refer to the section in this chapter titled “How to Program the Counter for Status Reporting” and the flowchart in Figure 3-10 for detailed information on programming the status reporting system.
3-20
Page 79
Programming Your Counter for Remote Operation
Status Reporting
Figure 3-6. HP 53181A SCPI Status Reporting Summary Functional Diagram
3-21
Page 80
Programming Your Counter for Remote Operation
Status Reporting
Status Byte Register and Service Request Enable Register
Figure 3-7. Status Byte and Service Request Enable
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 as shown in Figure 3-7. The Status Byte Register is a live register—its summary bits are set TRUE or FALSE (one or zero) by the presence or absence of the condition which is being summarized.
The Status Byte Register can be read with either a serial poll or the *STB? query. The Status Byte Register is altered only when the state of the overlying status data
structures is altered. The entire Status Byte Register can be cleared by sending the *CLS command, by
itself in a program message, to the Counter. Table 3-3 lists the Status Byte Register bits and briefly describes each bit.
3-22
Page 81
Programming Your Counter for Remote Operation
Status Reporting
Table 3-3. Status Byte Register
BIT WEIGHT SYMBOL DESCRIPTION
0 Not used 1 Not used 2 Not used
Questionable Data/Signal Status Register
3 8 QSB 4 16 MAV Message Available Summary Bit 5 32 ESB Standard Event Status Register Summary Bit 6 64 RQS/MSS Request Service/Master Status Summary Bit 7 128 OSB Operation Status Register Summary Bit
Summary Bit
A detailed description of each bit in the Status Byte Register follows:
• Bits 0 - 2 are not used.
• Bit 3 (QSB) summarizes the Questionable Data/Signal Status Event
Register. This bit indicates whether or not one or more of the enabled Questionable
Data/Signal events have occurred since the last reading or clearing of the Questionable Data/Signal Status Event Register.
This bit is set TRUE (one) when an enabled event in the Questionable Data/Signal Status Event Register is set TRUE. Conversely, this bit is set FALSE (zero) when no enabled events are set TRUE.
• Bit 4 (MAV) summarizes the Output Queue.
This bit indicates whether or not the Output Queue is empty. This bit is set TRUE (one) when the Counter is ready to accept a request by
the external computer to output data bytes; that is, the Output Queue is not empty. This bit is set FALSE (zero) when the Output Queue is empty.
3-23
Page 82
Programming Your Counter for Remote Operation
Status Reporting
• Bit 5 (ESB) summarizes the Standard Event Status Register.
This bit indicates whether or not one of the enabled Standard Event Status Register events have occurred since the last reading or clearing of the Standard Event Status Register.
This bit is set TRUE (one) when an enabled event in the Standard Event Status Register is set TRUE. Conversely, this bit is set FALSE (zero) when no enabled events are set TRUE.
• Bit 6 (RQS/MSS) summarizes IEEE 488.1 RQS and Master Summary
Status. When a serial poll is used to read the Status Byte Register, the RQS bit
indicates if the device was sending SRQ TRUE. The RQS bit is set FALSE by a serial poll.
When *STB? is used to read the Status Byte Register, the MSS bit indicates the Master Summary Status. The MSS bit indicates whether or not the Counter has at least one reason for requesting service.
• Bit 7 (OSB) summarizes the Operation Status Event Register.
This bit indicates whether or not one or more of the enabled Operation events have occurred since the last reading or clearing of the Operation Status Event Register.
This bit is set TRUE (one) when an enabled event in the Operation Status Event Register is set TRUE. Conversely, this bit is set FALSE (zero) when no enabled events are set TRUE.
Service Request Enable Register
The Service Request Enable Register selects which summary bits in the Status Byte Register may cause service requests as shown in Figure 3-7.
Use *SRE to write to this register and *SRE? to read this register. Use *SRE 0 to clear the register. A cleared register does not allow status
information to generate the service requests. (Power-on also clears this register.)
3-24
Page 83
Programming Your Counter for Remote Operation
Status Reporting
Standard Event Status Register Group
Figure 3-8. Standard Event Status Reporting
Standard Event Status Register
The Standard Event Status Register contains bits that monitor specific IEEE 488.2­defined events as shown in Figure 3-8.
Use *ESR? to read this register. Use *ESR? or *CLS to clear this register. Table 3-4 lists the Standard Event Status Register bits and briefly describes each bit.
3-25
Page 84
Programming Your Counter for Remote Operation
Status Reporting
Table 3-4. Standard Event Status Register
BIT WEIGHT SYMBOL DESCRIPTION
0 1 OPC Operation Complete 1 (RQC) Not used because this instrument
cannot request permission to become active
IEEE 488.1 controller-in-charge. 2 4 QYE Query Error 3 8 DDE Device-Specific Error 4 16 EXE Execution Error 5 32 CME Command Error 6 (URQ) Not used because this instrument does not
define any local controls as “User Request”
controls. 7 128 PON Power On
A detailed description of each bit in the Standard Event Status Register follows:
• Bit 0 (Operation Complete) is an event bit which is generated in response
to the *OPC command. This bit indicates that the Counter has completed all pending operations.
Specifically, this event bit indicates that the pending operation condition has transitioned from TRUE to FALSE.
If
the :TRIGger:COUNt:AUTO is OFF, or statistics are disabled, or the function is set to Voltage Peaks,
then the pending operation condition is set TRUE when either: 1) a single measurement is initiated, or 2) a continuous measurement cycle is initiated. The pending operation condition is set FALSE when the measurement cycle terminates.
3-26
Page 85
Programming Your Counter for Remote Operation
Status Reporting
If
the TRIGger:COUNt:AUTO is ON, and statistics are enabled, and the function is set to Voltage Peaks,
then the pending operation condition is set TRUE when a block of measurements is initiated. The pending operation condition is set FALSE when the block of measurements completes; that is, when the last measurement in the block completes.
NOTE
The OPC bit is not in any way affected by the *OPC? query.
• Bit 1 is not used.
• Bit 2 (Query Error) is an event bit which indicates that either 1) an attempt
was made to read the Output Queue when it was empty or 2) data in the Output Queue has been lost.
Errors -400 through -499 are query errors.
• Bit 3 (Device-Specific Error) is an event bit which indicates an operation
did not properly complete due to some condition of the Counter. Errors -300 through -399 and all those with positive error numbers (+2000
through ...) are device-specific errors.
• Bit 4 (Execution Error) is an event bit which indicates that a command
could not be executed 1) because the parameter was out of range or inconsistent with the Counter's capabilities, or 2) because of some condition of the Counter.
Errors -200 through -299 are execution errors.
• Bit 5 (Command Error) is an event bit which indicates one of the following
has occurred: 1) an IEEE 488.2 syntax error, 2) a semantic error indicating an unrecognized command, or 3) a Group Execute Trigger was entered into the input buffer inside of a program message.
• Bit 6 is not used.
• Bit 7 (Power On) is an event bit which indicates that an off-to-on transition
has occurred in the Counter's power supply.
Standard Event Status Enable Register
3-27
Page 86
Programming Your Counter for Remote Operation
Status Reporting
The Standard Event Status Enable Register selects which events in the Standard Event Status Register are reflected in the ESB summary bit (bit 5) of the Status Byte Register as shown in Figure 3-8.
Use *ESE to write to this register and *ESE? to read this register. Use *ESE 0 to clear the register. (Power-on also clears this register.)
Operation Status Register Group and Questionable Data/Signal Status Register Group
The Operation Status Register Group and the Questionable Data/Signal Status Register Group each have a complete set of registers that consists of the following:
• a condition register
• a positive transition filter register
• a negative transition filter register
• an event register
• an event enable register
Figure 3-9 shows the model that these register groups follow.
3-28
Page 87
Programming Your Counter for Remote Operation
Status Reporting
Figure 3-9. Operation and Questionable Status Reporting Model
3-29
Page 88
Programming Your Counter for Remote Operation
Status Reporting
Condition Register
A condition register continuously monitors the hardware and firmware status of the Counter. There is no latching or buffering for this register; it is updated in real time. Reading a condition register does not change its contents.
To read the condition registers use:
:STATus:OPERation:CONDition? :STATus:QUEStionable:CONDition?
Transition Filter
A transition filter specifies the transition criteria for setting event bits TRUE. When the transition filter specifies a positive transition, the event becomes TRUE
when its associated condition makes a FALSE to TRUE transition only. When the transition filter specifies a negative transition, the event becomes TRUE
when its associated condition makes a TRUE to FALSE transition only. When the transition filter specifies either a positive or a negative transition, the
event becomes TRUE when its associated condition makes either a FALSE to TRUE or a TRUE to FALSE transition.
A transistion filter is defined by a positive and negative transition filter register. Table 3-5 describes how the transition filter registers define the transition criteria for setting an event bit TRUE.
Table 3-5. Transition Filter Definition
Positive Transition Filter Bit
TRUE FALSE positive transition FALSE TRUE negative transition TRUE TRUE either a positive or negative transition FALSE FALSE neither transition (event reporting is disabled)
Negative Transition Filter Bit
Transition Which Causes the Event-Bit to be set TRUE
Transition filters are unaffected by *CLS or queries. Transition filters are set to default values by :STATus:PRESet and power-on.
To write to the transitions filter registers use:
3-30
Page 89
Programming Your Counter for Remote Operation
Status Reporting
:STATus:OPERation:PTRansition :STATus:OPERation:NTRansition :STATus:QUEStionable:PTRansition :STATus:QUEStionable:NTRansition
To read the transition filter registers use:
:STATus:OPERation:PTRansition? :STATus:OPERation:NTRansition? :STATus:QUEStionable:PTRansition? :STATus:QUEStionable:NTRansition?
Event Register
An event register captures changes in conditions. An event register bit (event bit) shall be set TRUE when an associated event occurs.
These bits, once set, are “sticky.” That is, they cannot be cleared even if they do not reflect the current status of a related condition, until they are read.
To read the event registers use:
:STATus:OPERation[:EVENt]? :STATus:QUEStionable[:EVENt]?
Use event register queries or *CLS to clear event registers.
Event Enable Register
An event enable register selects which event bits in the corresponding event register can generate a summary bit.
To write the event enable registers use:
:STATus:OPERation:ENABle :STATus:QUEStionable:ENABle
To read the event enable registers use:
:STATus:OPERation:ENABle? :STATus:QUEStionable:ENABle?
The event enable registers are cleared by :STATus:PRESet and power-on.
Operation Status Register Group
The Operation Status Register Group monitors conditions which are part of the Counter's normal operation.
3-31
Page 90
Programming Your Counter for Remote Operation
Status Reporting
Table 3-6 lists the Operation Status Register bits and briefly describes each bit.
Table 3-6. Operation Status Register
BIT WEIGHT DESCRIPTION
0 1 Calibrating 1 Not used 2 Not used 3 Not used 4 16 Measuring 5 Not used 6 Not used 7 Not used 8 256 Computing Statistics 9 512 Using Internal Reference 10 1024 In Limit Event 11-14 Not used 15 Not used since some controllers may have difficulty
reading a 16-bit unsigned integer. The value of this bit shall always be 0.
A detailed description of each bit in the Operation Status Register follows:
• Bit 0 (Calibrating) is a condition bit which indicates the Counter is
currently performing a (front-panel invoked or HP-IB invoked) calibration. The condition bit is TRUE (one) during a calibration and FALSE (zero)
otherwise.
• Bits 1-3 are not used.
• Bit 4 (Measuring) is a condition bit which indicates the Counter is actively
measuring. The condition bit is TRUE (one) during a measurement and FALSE (zero)
otherwise. If the external reference has been explicitly selected and an absent or invalid
signal at the external reference input is detected, then the Counter will not
3-32
Page 91
Programming Your Counter for Remote Operation
Status Reporting
report Measuring (even though it may perform an auto trigger) in response to the user initiating a measurement.
• Bits 5-7 are not used.
• Bit 8 (Computing Statistics) is a condition bit which indicates the Counter
has begun collecting measurements for the next statistical computation. The condition bit is TRUE (one) once the first of N measurements has
begun, and remains TRUE until the last of N measurements has completed.
• Bit 9 (Using Internal Reference) is a condition bit which indicates the
Counter is using the internal reference. The condition bit is TRUE (one) while the Counter is using the internal
reference. The condition bit is FALSE (zero) while the Counter is using the external reference.
This bit monitors both explicit and automatic reference changes. Explicit reference changes occur when you select internal or external using the front­panel Utility menu or the HP-IB command, [:SENS]:ROSC:SOUR. Automatic reference changes occur when the Counter is configured to select the reference (automatically) by detecting whether or not an external reference is being supplied.
• Bit 10 (In Limit Event) is an event bit indicating the last measurement
limit tested was “in limit.” Each and every time a measurement is limit tested and found to be in limit,
this event will be reported. Note that this is the only bit in the Operation Status Register which is not
representing a condition. Therefore, the transition filters have no effect on this bit.
The Counter does not monitor the condition indicating whether the last measurement was in or out of limit. Hence, the In Limit Event bit does NOT represent the transition from an “out of limit measurement” to “in limit measurement.”
• Bits 11-15 are not used.
Questionable Data/Signal Status Register Group
The Questionable Data/Signal Status Register Group monitors SCPI-defined conditions.
3-33
Page 92
Programming Your Counter for Remote Operation
Status Reporting
Table 3-7 lists the Questionable Data/Signal Status Register bits and briefly describes each bit.
3-34
Page 93
Programming Your Counter for Remote Operation
Status Reporting
Table 3-7. Questionable Data/Signal Status Register
BIT WEIGHT DESCRIPTION
0 Not used 1 Not used 2 4 Time (Period) 3 Not used 4 Not used 5 32 Frequency (only Frequency; not Frequency Ratio) 6 Not used 7 Not used 8 256 Calibration Error 9 Not used 10 1024 Out of Limit Event 11-13 Not used 14 16384 Command Warning 15 Not used since some controllers may have difficulty
reading a 16-bit unsigned integer. The value of this bit shall always be 0.
A detailed description of each bit in the Questionable Data/Signal Status Register Group follows:
• Bits 0-1 are not used.
• Bit 2 (Time) is a condition bit which indicates that the Time measurement
(Period) may be affected by the disabling of automatic interpolator calibration.
The condition bit is TRUE when automatic interpolator calibration is disabled. The condition bit is FALSE when automatic interpolator calibration is enabled.
• Bits 3-4 are not used.
• Bit 5 (Frequency) is a condition bit which indicates that
3-35
Page 94
Programming Your Counter for Remote Operation
Status Reporting
Frequency measurements (this does not include the Frequency Ratio measurements) may be affected by the disabling of automatic interpolator calibration.
The condition bit is TRUE when automatic interpolator calibration is disabled. The condition bit is FALSE when automatic interpolator calibration is enabled.
• Bit 6 is not used.
• Bit 7 is not used.
• Bit 8 (Calibration Error) is an event bit which indicates that one of the
following has occurred: 1) an HP-IB invoked calibration failed, 2) a front­panel invoked calibration failed,
3) an automatic interpolator calibration failed during the measurement cycle, or 4) an automatic measurement calibration failed during the measurement cycle.
Since this is an event bit, the transition filters have no effect on this bit.
• Bit 9 is not used.
• Bit 10 (Out of Limit Event) is an event bit indicating the last measurement
limit tested was “out of limit.” Each and every time a measurement is limit tested and found to be out of
limit, this event will be reported. Note that this bit is not representing a condition. Therefore, the transition
filters have no effect on this bit. The Counter does not monitor the condition indicating whether the last
measurement was in or out of limit. Hence, the Out of Limit Event bit does NOT represent the transition from an “in limit measurement” to “out of limit measurement.”
• Bits 11-13 are not used.
• Bit 14 (Command Warning) is an event bit indicating a command, such as
CONFigure or MEASure, ignored a parameter during execution. Since this is an event bit, the transition filters have no effect on this bit.
• Bit 15 is not used.
3-36
Page 95
Programming Your Counter for Remote Operation
Command Settings for Optimizing Throughput
Command Settings for Optimizing Throughput
This section lists the commands which enable the Counter to transfer data at the fastest possible rate. See the “To Optimize Throughput” sample programs on pages 3-70 , 3-86, and 3-97.
Commands to Set Counter for Optimal Throughput
Unless otherwise noted, these settings are stored on Save (*SAV). All of these settings are reset by *RST or a power cycle.
Disable auto trigger on measurement channel(s):
Specify absolute trigger level and disable auto trigger —
[:SENSe]:EVENt:LEVel[:ABSolute] <numeric_value> [V]
or simply disable auto-trigger —
[:SENSe]:EVENt:LEVel[:ABSolute]:AUTO OFF
Set gate/arm to auto for appropriate measurement:
For Frequency, Period, and Ratio —
[:SENSe]:FREQuency:ARM[:STARt]:SOURce IMMediate [:SENSe]:FREQuency:ARM:STOP:SOURce IMMediate
Define device trigger to FETC?:
When the device trigger is defined as FETC?, the Group Execute Trigger should be used to query for a result.
*DDT #15FETC?
Set reference oscillator to non-auto state (internal or external):
[:SENSe]:ROSCillator:SOURce INTernal | EXTernal (See Note below.)
___________________________
Note: This value is not stored on Save and is not part of the non-volatile state.
3-37
Page 96
Programming Your Counter for Remote Operation
Command Settings for Optimizing Throughput
Disable checking of external source if using external reference oscillator:
[:SENSe]:ROSCillator:EXTernal:CHECk OFF (See Note below.)
Disable automatic interpolator calibration :
:DIAGnostic:CALibration:INTerpolator:AUTO OFF (See Note below.)
Disable display:
:DISPlay:ENABle OFF (See Note below.)
Disable printing:
:HCOPy:CONTinuous OFF
Disable post-processing (math, limit testing, statistics) :
:CALCulate:MATH:STATe OFF :CALCulate2:LIMit:STATe OFF :CALCulate3:AVERage[:STATe] OFF
Specify expected frequency for Frequency, Period, and Ratio measurements:
[:SENSe]:FREQuency:EXPected[1|2] <numeric_value> [HZ] (See Note below.)
Specify ASCII format for result query responses:
:FORMat[:DATA] ASCii
Specify continuous measurements:
:INITiate:CONTinuous ON
Configure the read/fetch function memory:
Issue the following query and read the response.
:FETCh[:SCALar]:<function>?
___________________________
Note: This value is not stored on Save and is not part of the non-volatile state.
Typical Optimizing Throughput Results for Different Computers
Table 3-8 lists the typical performance for three different computers. The “To Optimize Throughput” sample programs on pages 3- 70 , 3-86, and 3-97 were used
3-38
Page 97
Programming Your Counter for Remote Operation
Command Settings for Optimizing Throughput
to generate the numbers in the table. The actual examples listed in this guide show the Frequency Auto Arming function, but the technique is the same for the other function (Frequency Time Arming .001). You only have to change the function in the program to generate the numbers in the table.
Table 3-8. Typical Optimizing Throughput Results in Measurements per Second
IBM PC Compatible 486/25 MHz
Function
Frequency Auto Arming 200 190 195
Frequency Time Arming .001 155 155 160
HP 82335A Card
HP 82324A Basic Language Processor
HP 9000 Series 300 Model 360
3-39
Page 98
Programming Your Counter for Remote Operation
How to Program the Counter for Status Reporting
How to Program the Counter for Status Reporting
Determining the Condition of the Counter
The Counter has status registers that are used to indicate its condition. There are four register groups that can be examined individually, or used to alert a computer. These registers, shown in Figure 3-6, are:
• Operation Status Register Group
• Questionable Data/Signal Register Group
• Standard Event Status Register Group
• Status Byte Register Group
The first three groups all have event registers that can be fed into the Status Byte Register. The Status Byte Register can be used to assert the SRQ line of the HP-IB and thus alert the computer that the Counter needs attention. The following examples show how each of the register groups can be used. (Figure 3-10 is a flowchart diagram of how to program the Counter for Status Reporting.)
Resetting the Counter and Clearing the HP-IB Interface— Example 1
Before attempting any programming, it is a good idea to set the Counter to a known state . The following command grouping shows how to reset the Counter. Before issuing these commands, execute a device clear to reset the interface and Counter. Consult your interface card's documentation for how to issue a device clear since the device clear command will be specific to the interface you are using. Perform the following:
1. Issue a Device Clear (See your computer or interface card documentation for how to issue this command).
2. Issue the following commands:
*RST *CLS *SRE 0 *ESE 0 :STAT:PRES
3-40
Page 99
Programming Your Counter for Remote Operation
How to Program the Counter for Status Reporting
Using the Standard Event Status Register to Trap an Incorrect HP-IB command—Example 2
The following command grouping shows how to use the Standard Event Status Register and the Status Byte Register to alert the computer when an incorrect command is sent to the Counter. The command *ESE 32 tells the Counter to summarize the command error bit ( bit 5 of the Event Status Register) in the Status Byte Register. The command error bit is set when an incorrect command is received by the Counter. The command *SRE 32 tells the Counter to assert the SRQ line when the Event Status Register summary bit is set to 1. If the Counter is serial polled after a command error, the serial poll result will be 96.
Event Status Register
*ESE 32 *SRE 32
Enable for bad command. Assert SRQ from Standard Event Status Register summary.
Using the Questionable Data/Signal Status Register to Alert the Computer When Automatic Interpolator Calibration is Disabled— Example 3
The default operation of the Counter is for automatic interpolator calibration to occur before every measurement. To optimize throughput over the HP-IB, the automatic calibration can be disabled. When it is disabled, the most recent calibration values are used. These values may not be the optimal values for a particular temperature or other environmental condition. For this reason, the Time and Frequency bits in the Questionable Data register are set whenever the automatic calibration is disabled.
In the following Questionable Data Status Register example, the first line tells the Counter to detect a transition from negative (non-questionable data) to positive (questionable data) of bits 2, 5, and 6 in the Questionable Data Register. The next line tells the Counter to summarize the detected events in the Status Byte Register. The command *SRE 8 tells the Counter to assert the SRQ line when the summary bit for the Questionable Data register is set to 1. A serial poll will return the value 72 when the automatic calibration transitions from on to off.
3-41
Page 100
Programming Your Counter for Remote Operation
How to Program the Counter for Status Reporting
Questionable Data Status Register
:STAT:QUES:PTR 100; NTR 0 :STAT:QUES:ENABLE 100
*SRE 8
Detect transition from non-questionable to questionable data. Enable to detect for auto cal off.
Assert SRQ on Questionable Summary bit.
Using the Operation Status Register to Alert the Computer When Measuring has Completed—Example 4
The following command grouping illustrates how to use the Operation Status register and the Status Byte register to alert the computer when measuring has completed. This is useful if the Counter is making a long measurement. For example, a frequency measurement with a gate time of 10 seconds. When the measurement is complete, the Counter can alert the computer.
The first line tells the Counter to watch for a negative transition from true (measuring) to false (non-measuring) of bit 4. This negative transition indicates that the Counter has completed a measurement. The next line tells the Counter to summarize the detected event (bit 4 of the Operation Status Register) in the Status Byte Register. The command *SRE 128 tells the Counter to assert SRQ when the summary bit for the Operation Status register is set to 1. A serial poll will return 192 when a measurement has completed.
Operation Status Register
:STAT:OPER:PTR 0; NTR 16 :STAT:OPER:ENABLE 16 *SRE 128
3-42
Detect transition from measuring to non­measuring. Enable to detect measuring.
Assert SRQ on Operation Summary bit.
Loading...