Programming Guide This guide describes how to use the Agilent 53150A, 53151A, and 53152A Microwave Frequency Counters. The information in this guide applies to instruments having the number prefix listed below, unless accompanied by a “Manual Updating Changes” package indicating otherwise.
Copyright Agilent Technologies, Inc. 1999, 2002 Certification and Warranty Before Cleaning Certification All Rights Reserved. Reproduction, adaptation, or translations without prior written permission is prohibited, except as allowed under the copyright laws. Agilent Technologies, Inc. certifies that this product met its published specification at the time of shipment from the factory.
Contents 1 Before You Start... Introduction 1-2 Getting Started 1-3 How to Use This Guide 1-3 New Users 1-4 Experienced Programmers Applications 1-5 Programming Guide Contents Assumptions 1-7 Related Documentation 1-8 2 1-5 1-6 Command Summary Introduction 2-2 Chapter Summary 2-2 Front Panel to SCPI Command Map 2-3 Agilent 53150A/151A/152A Command Summary 2-8 SCPI Conformance Information 2-8 IEEE 488.
Contents Overview of Command Types and Formats 3-12 Common Command Format 3-12 SCPI Command and Query Format 3-12 Elements of SCPI Commands 3-13 Subsystem Command Syntax 3-13 Common Command Syntax 3-13 Abbreviated Commands 3-14 Keyword Separator 3-14 Optional Keyword 3-14 Parameter Types 3-16 Parameter Separator 3-17 Query Parameters 3-17 Suffixes 3-17 Command Terminator 3-18 Using Multiple Commands 3-19 Program Messages 3-19 Program Message Syntax 3-19 Overview of Response Message Formats 3-21 Response Me
Contents Commands for Displaying Results 3-47 Command for Displaying Raw Results 3-47 Commands for Displaying Relative Results 3-47 Commands for Enabling and Disabling the Display 3-47 Programming the Counter to Synchronize Measurements 3-48 Synchronizing Measurement Completion 3-48 Resetting the Counter and Clearing the Interface 3-48 Using the *WAI Command 3-49 Using the *OPC? Command 3-49 Using the *OPC Command to Assert SRQ 3-50 Writing SCPI Programs 3-52 Programming Examples 3-54 Using BASIC 3-54 Usin
Contents :STATus Subsystem 4-31 :STATus:OPERation Subtree 4-31 :STATus:QUEStionable Subtree 4-36 :SYSTem Subsystem 4-39 :SYSTem:COMMunicate Subtree 4-39 :TRIGger Subsystem 4-42 Common Commands 4-43 *CLS (Clear Status Command) 4-43 *DDT (Define Device Trigger Command) *DDT? (Define Device Trigger Query) 4-44 *ESE (Standard Event Status Enable Command) *ESE? (Standard Event Status Enable Query) 4-45 *ESR? (Event Status Register Query) 4-47 *IDN? (Identification Query) 4-48 *IST? (Instrument
1 Before You Start...
Chapter 1 Before You Start... Introduction 1 Introduction This programming guide contains programming information for the Agilent Technologies 53150A, 53151A, and 53152A Microwave Frequency Counters. This guide assumes you are familiar with the front-panel operation of the Counter. See the Agilent 53150A/151A/152A Operating Guide for detailed information about front-panel operation. You should use this programming guide together with the operating guide.
Chapter 1 Before You Start... Getting Started Getting Started • 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.
Chapter 1 Before You Start... How to Use This Guide New Users 1 What You Should Understand As a new user, you must have some understanding of a high-level language, such as BASIC or C, before you can use the command set defined in this guide to control the Counter. (In Chapter 3, “Programming Your Counter for Remote Operation,” there are programming examples provided in BASIC, Microsoft® QuickBASIC, and Borland® Turbo C.
Chapter 1 Before You Start... How to Use This Guide Experienced Programmers Because the SCPI command set and some of the status reporting techniques are new, we advise you to use the following sequence to learn the Counter programming requirements: • Look over the steps for a new user, and perform any that you think are applicable to your current level of knowledge. In particular, look at the measurement techniques and examples provided in Chapter 3, “Programming Your Counter for Remote Operation.
Chapter 1 Before You Start... Programming Guide Contents 1 Programming Guide Contents The following information is contained in this guide: 1-6 • Chapter 1 (this chapter),“Before You Start...,” is a preface that introduces you to the programming guide. • Chapter 2, “Command Summary,” is a quick reference that summarizes the Counter's programming commands. It provides you with front-panel to SCPI command maps, SCPI conformance information, and command-summary tables.
Chapter 1 Before You Start... Assumptions Assumptions As previously mentioned, this guide also assumes you are familiar with the front-panel operation of the Counter. See the Agilent 53150A/ 151A/152A Operating Guide for detailed information about front-panel operation. Knowing how to control the Counter from the front panel and understanding the measurements you need to perform makes the programming task much easier.
Chapter 1 Before You Start... Related Documentation 1 Related Documentation This section contains a list of documentation that relates to the use of the Counter. Additional information that may be useful is contained in the following publications: 1. Agilent 53150A/151A/152A Operating Guide (Agilent Part Number 53150-90013) 2. Beginner’s Guide to SCPI (Agilent Part Number H2325-90002, July 1990 Edition). 3. Beginner’s Guide to SCPI, Barry Eppler (Hewlett-Packard Press, Addison-Wesley Publishing Co. 1991).
Chapter 1 Before You Start... Related Documentation To obtain a copy of this standard, write to: 1 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.
Chapter 1 Before You Start...
2 Command Summary
Chapter 2 Command Summary Introduction Introduction This chapter is a quick reference that summarizes the Counter’s programming commands. Chapter Summary Front Panel to SCPI Command Map1 pg. 2-3 • Agilent 53150A/151A/152A Command Summary2 pg. 2-8 2 • • • SCPI Conformance Information pg. 2-8 • IEEE 488.2 Common Commands pg. 2-9 • Agilent 53150A/151A/152A SCPI Subsystem Commands pg. 2-12 *RST Response3 pg.
Chapter 2 Command Summary Front Panel to SCPI Command Map Front Panel to SCPI Command Map Figures 2-1 and 2-2 are command maps that shows the relationships between the front-panel keys and the SCPI commands. This map should help you to identify commands, if you are already familiar with the front panel. 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.
Chapter 2 Command Summary Front Panel to SCPI Command Map 3 2 Shift + Freq Offset Shift + Pwr Offset Rate Avg 2 MODIFY 1 Reset/Local Freq Offset Pwr Offset GPIB Reset/ Local Rate Avg Resol Shift Clear +/- Enter Menu Shift + GPIB 4 5 6 On/Off Shift + FREQ Gate 12 11 Chan Select Freq Offset On/Off On/Off Resolution 7 Display Power 9 8 POWER Channel 2 dBm/ W Chan Select Display Power Rel Freq Rel Pwr Offset On/Off Offset On/Off Power Offset On/Off 10 Figure 2-1.
Chapter 2 Command Summary Front Panel to SCPI Command Map INITitiate[:IMMediate] 2 TRIGger[:SEQuence]:HOLDoff 3 [SENSe]:FREQuency:OFFSet 4 [SENSe]:POWer:AC:REFerence 5 [SENSe]:AVERage:COUNt 6 [SENSe]:AVERage:STATe 7 SYSTem:COMMunicate:GPIB:ADDRess 8 [SENSe]:FREQuency:RESolution 9 DISPlay:BACKground[:STATe] 2 1 10 [SENSe]:FUNCtion 11 [SENSe]:POWer:AC:REFerence:STATe 12 [SENSe]:FREQuency:OFFSet:STATe 13 [SENSe]:FUNCtion Figure Front Panel Control to SCPI Command Map (Part 2 of 2) P
Chapter 2 Command Summary Front Panel to SCPI Command Map Shift + Menu 1 2 Menu Reset/ Local REF OSC SAVE Freq Offset Rate On/Off Shift Clear 2 3 RECALL 4 CH1 LPF 5 FM BAUD 6 PRESET 7 Instrument ID 8 OP HRS 9 BATT VOLTAGE 10 DO SELF TEST 11 PWR CORR 12 Figure 2-2.
Chapter 2 Command Summary Front Panel to SCPI Command Map [:SENSe]:ROSCillator:SOURce 2 *SAV 3 *RCL 4 :INPut:FILTer[:LPASs][:STATe] 5 [:SENSe]:FILTer:FM:AUTO 6 :SYSTem:COMMunicate:SERial[:RECeive]:BAUD 7 *RST 8 *IDN? 9 See Service Guide 10 See Service Guide 11 *TST? 12 MEMory:CLEar[:NAME] MEMory:DATA [:SENSe]:CORRection:CSET:SELect [:SENSe]:CORRection:CSET:STATe 2 1 Figure Front Panel Menu to SCPI Command Map (Part 2 of 2) Programming Guide 2-7
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Agilent 53150A/151A/152A Command Summary This section summarizes both the IEEE 488.2 Common and Agilent 53150A/151A/152A Standard Commands for Programmable Instruments (SCPI) commands in tabular format. IEEE 488.2 Common Commands are listed first, followed by SCPI commands. 2 SCPI Conformance Information The SCPI commands used in the Agilent 53150A/151A/152A Counters are in conformance with the SCPI Standard Version 1995.0.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary IEEE 488.2 Common Commands The Common Commands are general-purpose commands that are common to all instruments (as defined in IEEE 488.2). Common Commands are easy to recognize because they all begin with an “*” (for example, *RST, *IDN?, *OPC). These commands are generally not related to measurement configuration. They are used for functions like resetting the instrument, identification, or synchronization.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-1. IEEE 488.2 Common Commands Command Name Function *CLS Clear Status Clears all event status registers summarized in the status byte and empties the Error Queue. *DDT Define Device Trigger Command Defines which command is executed when the Counter receives a GET or *TRG command. *DDT? Define Device Trigger Query Queries which command is executed when the Counter receives a GET or *TRG command.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-1. IEEE 488.2 Common Commands (Continued) Command Name Function *SRE? Service Request Enable Query Queries the Service Request Enable register. *STB? Status Byte Query Queries the Status Byte and Master Summary Status bit. *TRG Trigger This trigger command is the device-specific analog of the IEEE 488.1 defined GET. It initiates the action specified by the *DDT command.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Agilent 53150A/151A/152A 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.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-2. Agilent 53150A/151A/152A SCPI Command Summary Keyword/Syntax Parameter Form Std/New Comments Std Event; no query. Resets the trigger system and aborts any measurement in progress. Places the trigger system in the IDLE state. :CONFigure Std See Measurement Instructions in this table. :DISPlay Std Subsystem. Controls the selection and presentation of textual information on the display.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table Agilent 53150A/151A/152A SCPI Command Summary (Continued) Keyword/Syntax Parameter Form Measurement Instructions :CONFigure[:SCALar]: Std/New See and below. Std Configures the instrument to perform the specified measurement. Std Returns the function configured by the last :CONFigure or :MEASure command. Std Configures the instrument, initiates measurement, and queries for the result (i.e.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-2. Agilent 53150A/151A/152A SCPI Command Summary (Continued) Keyword/Syntax Parameter Form :MEMory :CLEAr[:NAME] Std Std , Std Std :DATA :DATA? Std Subsystem. Manages instrument memory. Event; no query. Restores the frequency values in the named correction profile to the default values and sets all loss values to zero. Stores data in the named correction profile.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-2. Agilent 53150A/151A/152A SCPI Command Summary (Continued) Keyword/Syntax Parameter Form [:SENSe] (cont.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-2.
Chapter 2 Command Summary Agilent 53150A/151A/152A Command Summary Table 2-2. Agilent 53150A/151A/152A SCPI Command Summary (Continued) Keyword/Syntax Parameter Form 2 :SYSTem Std/New Comments Std :COMMunicate Std :GPIB [:SELF] :ADDRess :SERial [:RECeive] :BAUD :ERRor? Std Subsystem. Collects the functions that are not related to instrument performance. Subtree. Collects together configuration of control/communication interfaces. Subtree. Controls the GPIB.
Chapter 2 Command 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 command settings affected by the *RST command are described in Table 2-3. Table 2-4 lists command settings that are unaffected by *RST. 2 Table 2-3.
Chapter 2 Command Summary *RST Response Table 2-4.
3 Programming Your Counter for Remote Operation
Chapter 3 Programming Your Counter for Remote Operation Introduction Introduction This chapter provides remote-operation setup and programming information. You can use this information to configure the Counter to operate as a remote device. NOTE Most of this chapter deals with programming the Agilent 53150A/ 151A/152A Counters using SCPI and IEEE 488.2 commands.
Chapter 3 Programming Your Counter for Remote Operation Introduction Chapter Summary • Connecting the Counter to a Computer pg. 3-5 • Overview of Command Types and Formats pg. 3-12 • Elements of SCPI Commands pg. 3-13 • Using Multiple Commands pg. 3-19 • Overview of Response Message Formats pg. 3-21 • Status Reporting pg. 3-25 • Programming the Counter for Status Reporting pg. 3-41 • Programming the Counter to Display Results pg. 3-46 • Commands for Displaying Results pg.
Chapter 3 Programming Your Counter for Remote Operation Introduction 3 Where to Find Some Specific Information • To Connect With the GPIB pg. 3-5 • Configuring the GPIB pg. 3-5 • IEEE 488.1 Interface Capabilities pg. 3-6 • To Connect With the RS-232 Serial Interface pg. 3-7 • Making an RS-232 Cable pg. 3-7 • Remote/Local Operation pg. 3-11 • Common Command Format pg. 3-12 • SCPI Command and Query Format pg. 3-12 • Abbreviated Commands pg. 3-14 • Optional Keyword pg.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Connecting the Counter to a Computer To program the Counter to operate remotely, you need to interface the Counter with a computer. The Agilent 53150A, 53151A, and 53152A provide two interfaces for remote, computer-controlled operation— GPIB and RS-232. The following sections describe how to connect and configure both interfaces for remote Counter operation.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer The following section, titled “Changing the GPIB Address,” provides instructions for setting the GPIB address from the Counter’s front panel. Once the Counter is in Remote mode, all front-panel keys except the Reset/Local key are disabled. As long as local-lockout is off, pressing the Reset/Local key returns the counter to Local mode.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer To Connect With the RS-232 Serial Interface The Agilent 53150A, 53151A, and 53152A use an RJ12 modular connector for the RS-232 interface. This connector is accessible through the back panel of the counter, as shown in Figure 3-2. Made in U.S.A.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Assembling the DB-25/RJ12 Adapter and the Cable Use the following procedure to wire the adapter and assemble the cable: 1 Obtain a male DB25 to female RJ12 adapter, such as the Voltrex MAK206F (manufactured by SPC Technology) or equivalent, and either a 6-conductor male-to-male RJ12 cable of a suitable length or a similar length of 6-conductor, flat telephone cable and two RJ12 plugs.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer DB-25F (Female) 25 24 23 22 21 20 19 18 17 16 15 14 RJ12 (Male) 13 12 11 10 9 8 7 GRN (GND) 6 5 4 3 2 1 6 5 4 3 2 1 Pin 4: GND Pin 3: RXD Pin 2: TXD BLK (TXD) RED (RXD) (Viewed from front side of the connectors) SPC Technology Voltrex Brand Part number MAK206 F DB-25F (female) to RJ12 (male) Adapter 3 Figure 3-3.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Wire No. 6 5 4 3 2 1 Color Pin # BLU YEL GRN RED BLK WHT 6 5 4 3 2 1 RJ12 Modular Plug SPC Technology Part number TA 30-6 6 5 4 3 2 1 Pin # 6 5 4 3 2 1 1 2 3 4 5 6 Wire No. 6 5 4 3 2 1 Color BLU YEL GRN RED BLK WHT SPC Technology, 6−Conductor Flat Telephone Wire Part number TXW6151 3 Figure 3-4.
Chapter 3 Programming Your Counter for Remote Operation Connecting the Counter to a Computer Connecting with the Serial Interface Connect the female DB25 connector on the adapter to the male DB25 serial-port connector on the computer, and then insert the RJ12 plug at the other end of the cable into the RJ12 receptacle on the back of the counter as shown in Figure 3-5. Computer (Rear Panel) Serial Cable Counter (Rear Panel) Made in U.S.A.
Chapter 3 Programming Your Counter for Remote Operation Overview of Command Types and Formats Overview of Command Types and Formats There are two types of Agilent 53150A/151A/152A programming commands: IEEE 488.2 Common Commands and Standard Commands for Programmable Instruments (SCPI). The format of each type of command is described in the following paragraphs. (Refer to Chapter 2, “Command Summary,” for SCPI conformance information.) Common Command Format The IEEE 488.
Chapter 3 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 GPIB or the RS-232 interface as a sequence of ASCII data messages.
Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands * sp mnemonic parameter ? Note: sp = space. ASCII character decimal 32. Figure 3-7. Simplified Common Command Syntax Diagram Abbreviated Commands 3 The command syntax shows most keywords as a mixture of upper- and lowercase letters. Uppercase letters indicate the abbreviated spelling for the command. For better program readability, you may send the entire keyword.
Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Examine the portion of the [:SENSe] subsystem shown below: [:SENSe] :FREQuency :RESolution The root-level keyword [:SENSe] is an optional keyword.
Chapter 3 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.
Chapter 3 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 parameters (except Common Commands) can be queried to return the minimum, maximum, and DEFault values they are capable of being set to by sending a MINimum, MAXimum, or DEFault parameter after the “?.” For example, consider the AVERage:COUNt? query.
Chapter 3 Programming Your Counter for Remote Operation Elements of SCPI Commands Suffix Multipliers Table 3-2 lists the suffix multipliers that can be used with suffix elements (except PCT and DEG). 3 Table 3-2.
Chapter 3 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 GPIB or serial interface as a sequence of ASCII data messages. Program Message Syntax Figure 3-8 shows the simplified syntax of a program message.
Chapter 3 Programming Your Counter for Remote Operation Using Multiple Commands 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).
Chapter 3 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.
Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats ; , response data NOTE ^END = 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) 3 Figure 3-9.
Chapter 3 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 This numeric representation has an implicit radix point. + − The maximum number of characters in response data is 17 (maximum 16 digits, 1 sign). This numeric representation has an explicit radix point. + .
Chapter 3 Programming Your Counter for Remote Operation Overview of Response Message Formats Table 3-3. Response Message Data Types (Continued) Type Description A string response consists of ASCII characters enclosed by double quotes. For example, string data is used for the “” portion of :SYST:ERR? response and for [:SENS]:FUNC? response.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Status Reporting The Agilent 53150A, 53151A, and 53152A status registers conform to the SCPI and IEEE 488.2 standards. Figure 3-10 shows all of the status-register groups and queues in the Counter. This is a high level diagram 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.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting NOTES: 1. The numbers that are in parentheses and positioned above the arrows represent the integer formed by the binary weighting of the corresponding bit. 2. Descriptions of all registers are contained in this section. 3.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Status Byte Register and Service Request Enable Register Error/Event Queue Questionable Data Status Register Group Status Byte Register 0 1 EAV QSB MAV ESB RQS /MSS OSB Status of Output Queue Standard Event Status Register Group Operation Status Register Group & 0 1 2 3 4 5 & & & & & & 7 Logical OR SRQ Interrupt to Computer Figure 3-11.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Table 3-4.
Chapter 3 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.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Standard Event Status Register Group Standard Event Enable Register 0 1 2 3 4 5 6 7 Standard Event Status Register & & & & & & & & Logical OR 0 1 2 3 4 5 6 7 Operation Complete Not Used Query Error Device-Dependent Error Execution Error Command Error Not Used Power On To ESB bit (bit 5) of the Status Byte Register Figure 3-12.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Table 3-5. 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.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting • 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 are device-specific errors.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting The Operation and Questionable Data Status Register Groups The Operation and Questionable Data Status Register Groups have the following registers: • a condition register • one or more transition filters • an event register • an event enable register Figure 3-13 shows the model that these register groups follow. * = positive transition, or negative transition, or either transition. See Table 3-6.
Chapter 3 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.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Table 3-6. Transition Filter Definition Positive Negative Transition Transition Transition Which Causes the Event-Bit to be set TRUE Filter Bit 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) Transition filters are unaffected by *CLS or queries.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting 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.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Operation Status Register Group The Operation Status Register Group monitors conditions which are part of the Counter’s normal operation and has a complete set of registers that consist of the following: • a condition register • a positive transition filter register (PTR) • a negative transition filter register (NTR) • an event register • an event enable register Table 3-7 lists the Operation Status Register bits and briefly
Chapter 3 Programming Your Counter for Remote Operation Status Reporting A detailed description of each bit in the Operation Status Register follows: • Bits 0-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. • Bits 5 (Waiting for Trigger) The condition bit is TRUE (one) when the Counter is in the HOLD mode (INIT:CONT OFF), and it has not been triggered.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting Questionable Data Status Register Group The Questionable Data Status Register Group monitors SCPI-defined conditions. NOTE For this register group, the transition filter is fixed as PTR with all bits set to ones. This cannot be changed or queried. Table lists the Questionable Data Status Register bits and briefly describes each bit. Table 3-8.
Chapter 3 Programming Your Counter for Remote Operation Status Reporting • Bits 6-11 are not used. • Bit 12 (Hardware Summary) This condition is TRUE when an internal hardware fault has been detected, either in normal operation or by the self test. • Bit 13 is 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 it. Bit 15 is not used.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Programming 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.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Resetting the Counter and Clearing the Remote 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.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Using the Operation Status Register to Alert the Computer When Measuring has Completed—Example 3 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. When the measurement is complete, the Counter can alert the computer.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting Do you want to do Status Reporting? NO Skip this section ("Status Reporting"). YES Use the following: Reset and initialize the Counter as follows: Device Clear *RST *CLS *SRE 0 *ESE 0 :STAT:PRES continue program Do you want to report events monitored by the Standard Event Status Register? :STAT:OPER:ENAB 6704 This enables any of the available bits to generate a summary bit to the Status Byte Register.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter for Status Reporting From sheet 1 of 2 Do you want to send a Service Request (SRQ) interrupt to the computer? Initiate a Counter function. For example, use the following: NO INIT This initiates the selected measurement.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Display Results Programming the Counter to Display Results Configuring the Counter’s Display The Counter has three display modes: 1. Raw results. This display mode is used on power-up. 2. Relative results - results modified by offset values 3. Display Disabled - All LCD display segments disabled. 3 The following command groupings show how to program the Counter to any of the above display modes.
Chapter 3 Programming Your Counter for Remote Operation Commands for Displaying Results Commands for Displaying Results Command for Displaying Raw Results The following command always causes raw measurements to be displayed: *RST Turns off all offsets. Commands for Displaying Relative Results FREQ:OFFS:STAT ON POW:AC:REF:STAT ON Turns on offsets. Turns on offsets. Commands for Enabling and Disabling the Display The Counter display can be turned on or off.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Programming the Counter to Synchronize Measurements Synchronizing Measurement Completion There are three commands for synchronizing the end of a measurement and computer transfer of data: 1. The *WAI command 2. The *OPC? command 3. The *OPC command to assert SRQ The following discussion shows how to use these three commands.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Using the *WAI Command This command is most useful when only the Counter is on the bus, and you want the Counter to send the data when it is ready. In this example, the Counter is instructed to take 50 measurements and return the average for these 50 measurements.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements If you had wanted to hold off the command to another instrument, you would use the *OPC? command instead of the *WAI command. :AVERAGE:COUNT 50 On INIT, take 50 measurements. :AVERAGE ON Enable averaging. :INIT Start making measurements. *OPC? Tell Counter to put a 1 in the output buffer when 50th measurement is complete. Read the Counter. The program waits until the Counter returns a 1.
Chapter 3 Programming Your Counter for Remote Operation Programming the Counter to Synchronize Measurements Set up program to specify service routine and enable interrupt when SRQ is asserted: :INIT *OPC Start measurements. Enable OPC bit. The program can do other things while it is waiting for SRQ. When SRQ occurs, and the Counter has been identified as the cause of the SRQ, ask for the data: DATA? Ask for data.
Chapter 3 Programming Your Counter for Remote Operation Writing SCPI Programs Writing SCPI Programs 3 Figure 3-15 is a general summation of how to write SCPI programs. It shows a typical sequence you might go through in the process of writing a program. You do not have to follow this exact sequence, but it will help you to become familiar with the Counter’s capabilities and to direct you to sections of the guide which will be useful while writing programs.
Chapter 3 Programming Your Counter for Remote Operation Writing SCPI Programs Reset and initialize the Counter as follows: Device Clear :ABORt *RST *CLS 0 *SRE ESE 0 *:STAT:PRES Do you want to average? NO YES Configure Averaging. Do you want to do Status Reporting? NO See Averaging in Chapter 3. YES Configure status reporting. See section titled "Status Reporting" in this chapter. See Chapter 4, :STATus,*ESE, and *SRE. See Figure 3-14. Initiate a measurement. See Figure 2-1.
Chapter 3 Programming Your Counter for Remote Operation Programming Examples Programming Examples In this section, you will see how to program the Agilent 53150A/ 151A/152A to make common measurements. Examples are provided in the following programming languages: • BASIC • Microsoft® QuickBASIC • C Using BASIC This guide uses doubles quotes to enclose string parameters in syntax descriptions, but uses single quotes in the BASIC programming examples for readability.
Chapter 3 Programming Your Counter for Remote Operation Programming Examples Using C The C examples assume you have an Agilent 82335A GPIB Interface card inside your computer. List of the Programming Examples The following examples are provided: 1. Making a Frequency Measurement (BASIC) 2. 3. Making a Frequency Measurement (C) NOTE All programming examples use the ASCII format to transfer data from the Counter to the computer. The ASCII format is the default format when *RST is used.
Chapter 3 Programming Your Counter for Remote Operation Programming Examples 3 Making a Frequency Measurement (BASIC) 10 ! This program sets up the instrument to make 10 frequency 20 ! measurements on channel 2. 30 ! The results are displayed on the computer CRT. 40 ! ASCII format is used to preserve resolution.
Chapter 3 Programming Your Counter for Remote Operation Programming Examples Making a Frequency Measurement (QuickBASIC) ’This program configures the instrument to make 10 frequency measurements ’on channel 2. ’The results are printed on the computer monitor. ’Data is sent in ASCII format to preserve resolution.
Chapter 3 Programming Your Counter for Remote Operation Programming Examples Making a Frequency Measurement (C) 3 /* This program configures the instrument to make 10 frequency measurements on channel 1 followed by 10 frequency measurements on channel 2 and 10 power measurements. The results are displayed on the computer monitor. The program comments discuss the meaning of each command. ASCII result format is used to preserve resolution. */ #include
Chapter 3 Programming Your Counter for Remote Operation Programming Examples Sendhp(":CONF:FREQ DEFAULT,DEFAULT,(@2)") /* Set to Band 2 Sendhp("INIT:IMM") Sendhp("READ?") */ IOENTERS(ctr,freq,&length); length=strlen(freq); freq[length-1]=’\0’ ; printf ("Frequency in Band 2 = %s Hz\n",freq); printf("Press a key to continue\n"); getch(); Sendhp(":CONF:POW") Sendhp("INIT:IMM") Sendhp("READ?") /* Set measurement function to Power */ IOENTERS(ctr,pow,&length); length=strlen(pow); freq[length-1]=’\0’ ; prin
Chapter 3 Programming Your Counter for Remote Operation 3 Programming Examples 3-60 Programming Guide
4 Command Reference
Chapter 4 Command Reference Introduction Introduction This chapter describes the SCPI Subsystem commands and the IEEE 488.2 Common Commands for the Agilent 53150A/151A/152A. The information in this chapter is intended to help you program the Counter over its GPIB or RS-232 serial interface. The commands are presented in alphabetical order. • SCPI Subsystem commands are described on pages 4-4 through 4-42. • IEEE 488.2 Common command descriptions start on Page 4-43.
Chapter 4 Command Reference Introduction • The vertical bar, |, is used to mean “OR” and is used to separate alternative options. • The short form of keywords is shown in uppercase. • Quotation marks may be part of the command’s parameter; the quotation marks shown must be sent to the Counter. • Unless otherwise noted, a command is sequential (not overlapped). See Chapter 3 of this guide for details regarding command syntax, parameter types, and query response types.
Chapter 4 Command Reference :ABORt Command :ABORt Command COMMAND :ABORt This command causes the Counter to abort, as quickly as possible, any measurement in progress. The :ABORt command is not complete until the current measurement is stopped. The execution of an ABORt command sets false any Pending Operation Flags that were set true by initiation of measuring.
Chapter 4 Command Reference :DISPlay Subsystem :DISPlay Subsystem This subsystem controls the selection and presentation of textual information on the Counter’s display. This information includes measurement results. :DISPlay is independent of, and does not modify, how data is returned to the controller. See the section titled “Programming the Counter to Display Results” on Page 3-46 of this guide. COMMAND :DISPlay[:WINDow]:BACKground[:STATe] . . . Turns the display backlight ON or OFF.
Chapter 4 Command Reference :DISPlay Subsystem COMMAND :DISPlay:ENABle . . . Sets or queries whether the entire display (annunciators and indicators, with the exception of Rmt) is visible. QUERY RESPONSE COMMENTS Single ASCII-encoded byte, 0 or 1. • A value of 0 indicates OFF; a value of 1 indicates ON. • *RST: ON • This value is unaffected by *SAV/*RCL.
Chapter 4 Command Reference Group Execute Trigger (GET) Group Execute Trigger (GET) COMMAND GET The full capability of the Group Execute Trigger IEEE 488.1 interface function is implemented in the Counter. This function permits the Counter to have its operation initiated over the Bus. In response to the IEEE 488.1 Group Execute Trigger (GET) remote interface message (while the Counter is addressed to listen), the Counter performs the action defined by the *DDT command (see Page 4-44).
Chapter 4 Command Reference :INITiate Subsystem :INITiate Subsystem This subsystem controls the initiation of a measurement. COMMAND :INITiate:CONTinuous . . . Sets or queries the state of continuously initiated measurements. When CONTinuous is set to OFF, no measurements are made until CONTinuous is set to ON or :INITiate[:IMMediate] is received. Once CONTinuous is set to ON, a new measurement is initiated.
Chapter 4 Command Reference :INPut Subsystem COMMAND :INITiate[:IMMediate] This event command causes the instrument to initiate either a single measurement or a block of measurements. This command is an overlapped command (see IEEE 488.2, Section 12). Beginning a measurement or block of measurements with an :INITiate[:IMMediate] sets the Pending Operation Flag to true. Completing the measurement or block of measurements (normally or by aborting) sets Pending Operation Flag to false.
Chapter 4 Command Reference :MEASure Subsystem :MEASure Subsystem The :MEASure subsystem commands allow you to configure the Counter, initiate measurements, and place the results in the Output Queue using a minimum number of commands. These commands are described in detail in this section. Measurement Instructions (:CONFigure, :FETCh, :MEASure, :READ) The purpose of these commands is to acquire data using a set of high-level instructions.
Chapter 4 Command Reference :MEASure Subsystem Table 4-1. Summary of the Measurement Instruction Commands Command Description :MEASure query This command is the simplest to use, but it allows little flexibility. This command lets the Counter configure itself for an optimal measurement, initiate the measurement, and return the result; i.e., it provides a complete measurement sequence (:MEAS query is equivalent to the :CONF, :INIT, :FETC? command sequence, but with no flexibility.
Chapter 4 Command Reference :MEASure Subsystem COMMAND :CONFigure[:SCALar]: [,] Configures the instrument to perform the specified function but does not initiate the measurement. COMMENTS COMMAND • Use :INITiate:FETCh? or :READ? to make and query a measurement. • Parameters (other than ) can be defaulted by substituting the keyword DEFault. The parameter can be defaulted by omitting it.
Chapter 4 Command Reference :MEASure Subsystem COMMAND • If an parameter is outside the measurement capabilities of the Counter model, an error is generated, and the command does not execute. • See “Descriptions of the Measurement Functions” on Page 4-16 for a description of each of the measurement functions. • See Table 4-2 for a summary of the , , and for each of the measurement functions.
Chapter 4 Command Reference :MEASure Subsystem COMMAND :MEASure[:SCALar]:? [,] This query provides a complete measurement sequence: configuration, measurement initiation, and query for result. 4 COMMENTS • This query is used when generic measurement is acceptable, and fine adjustment of Counter settings is not necessary. • Parameters (other than ) can be defaulted by substituting the keyword DEFault.
Chapter 4 Command Reference :MEASure Subsystem COMMAND :READ?[[:SCALar]:]? This query provides a method for performing a :FETCh? on fresh data. COMMENTS This command is commonly used in conjunction with a :CONFigure command to provide a capability similar to :MEASure?, in which the application programmer is allowed to provide fine adjustments to the instrument state by issuing the corresponding commands between :CONFigure and :READ?.
Chapter 4 Command Reference :MEASure Subsystem Descriptions of the Measurement Functions Table 4-2 lists the available measurement functions, the parameters that can be used with them, and the valid values for . Table 4-2.
Chapter 4 Command Reference :MEASure Subsystem :MEASure[:SCALar]:POWer[:AC] [[,]] [,(@2)] This command measures power. FUNCTION DESCRIPTION range: -40 to +10 dBm default: 0.00 resolution: 0.01 description: is supported only for compatibility with other instruments. values: 0.01 dB | MIN | MAX | DEF default: 0.01 dB description: Specifies which front-panel input is used for the measurement.
Chapter 4 Command Reference :MEASure Subsystem Using :MEAsure This is the simplest Measurement Instruction command to use, but it does not offer much flexibility. :MEASure causes the Counter to configure itself for a default measurement, starts the measurement, and queries the result. The following example shows how to use the :MEASure query to measure frequency. Use :MEASURE:FREQ? to execute a default frequency measurement and have the result sent to the controller.
Chapter 4 Command Reference :MEASure Subsystem Using :CONFigure with :READ? The :CONFigure command causes the instrument to choose default settings for the specified measurement. :READ? starts the measurement and queries the result. This sequence operates in the same way as the :MEASure query, but it allows you to insert commands between :CONFigure and :READ? to specify a particular setting.
Chapter 4 Command Reference :MEMory Subsystem :MEMory Subsystem This subsystem manages the instrument’s memory. COMMAND :MEMory:DATA . . . , Stores and queries data in the named power-correction profile. QUERY RESPONSE Data points are returned in format. • A data point consists of two to ten comma-separated, NRf format number pairs. • Valid profile names: CORR1, CORR2, . . . CORR9 • Valid data is stored in non-volatile memory.
Chapter 4 Command Reference :MEMory Subsystem COMMAND :MEMory:CLEAR[:NAME] . . . Resets the contents of the named power-correction profile to the default configuration. COMMENTS RELATED FRONT-PANEL KEYS COMMAND • Valid profile names: CORR1, CORR2, . . . CORR9 • The data currently stored in non-volatile memory for the named correction profile is discarded. • The default power-correction profile configuration consists of two data points, both having loss values of zero.
Chapter 4 Command Reference [:SENSe] Subsystem [:SENSe] Subsystem The [:SENSe] subsystem commands are divided into several sections. Each section, or subtree, deals with controls that directly affect instrument-specific settings and not those related to the signal-oriented characteristics. COMMAND [:SENSe]:AVERage:[STATe] . . . Turns averaging ON and OFF. When averaging is ON, each new valid measurement result is the average of the number of measurements specified in the AVERage:COUNt command.
Chapter 4 Command Reference [:SENSe] Subsystem COMMAND [:SENSe]:CORRection:CSET:SELect . . . Selects a power-correction profile by name from nine available profiles. Valid profile names: CORR1, CORR2, . . . CORR9 COMMENTS RELATED FRONT-PANEL KEYS COMMAND • *RST: CORR1 • The correction-profile setting is applied for the current session only. To store the profile selection in non-volatile memory, issue a *SAV command. Shift + Menu (PWR CORR > OFF | 1 . . . 9) [:SENSe]:CORRection:CSET:STATe .
Chapter 4 Command Reference [:SENSe] Subsystem COMMAND [:SENSe]:DATA? . . . [] Queries the current measurement result data of the :SENSe subsystem. Valid : “[SENSe:][XNONE:]FREQuency [1] | 2” “[SENSe:][XNONE:]POWer [2]” QUERY RESPONSE COMMENTS RELATED FRONT-PANEL KEYS COMMAND • Frequency values are returned in Hz as ASCII bytes in NR1 format. • Power values are returned in dB in NR2 format. • Query only. • Does not initiate any measurement action.
Chapter 4 Command Reference [:SENSe] Subsystem COMMAND [:SENSe]:FREQuency:OFFSet . . . [] Sets a reference frequency for all other absolute frequency settings in the instrument. RANGE UNITS COMMENTS The acceptable range for the parameter is 0 to 50 GHz. The offset frequency can be specified in Hz, KHz, or MHz only. • This command does not affect the hardware settings of the instrument. It affects only the entered and displayed frequencies.
Chapter 4 Command Reference [:SENSe] Subsystem COMMAND [:SENSe]:FREQuency:RESolution . . . [] Sets the resolution of the frequency measurement. The allowable settings for and are: 1 Hz, 10 Hz, 100 Hz, 1 KHz, 10 KHz, 100 KHz, and 1 MHz. COMMENTS RELATED FRONT-PANEL KEYS COMMAND • *RST: 1 Hz • This command does not affect the unit multipliers of any measurement queries.
Chapter 4 Command Reference [:SENSe]:FUNCtion Subtree [:SENSe]:FUNCtion Subtree This subtree controls the sensor functions. COMMAND [:SENSe]:FUNCtion[:OFF] . . . [,] Sets or queries the sensor functions to be sensed by the Counter. The strings are: "[XNONe:]FREQuency [1 | 2]" "[XNONe:]POWer [2]" QUERY RESPONSE • The query form of this command returns a comma-separated list of functions that are OFF.
Chapter 4 Command Reference [:SENSe]:FUNCtion Subtree COMMAND [:SENSe]:FUNCtion[:ON] . . . [,] Selects the sensor functions to be sensed by the Counter. The supported strings are: “[XNONe:]FREQuency [1 | 2]” “[XNONe:]POWer [2]” QUERY RESPONSE • The query form of this command returns a comma-separated list of functions that are ON. • The string omits default nodes (XNONe) and uses short-form mnemonics.
Chapter 4 Command Reference [:SENSe]:FUNCtion Subtree COMMAND [:SENSe]:FUNCtion:STATe? . . . This query-only command returns a Boolean value that indicates whether the specified is currently ON or OFF. COMMENT See [:SENSe]:FUNCtion[:ON] on Page 4-28 for valid strings. [:SENSe]:POWer Subtree This subtree controls the power-measurement function. COMMAND [:SENSe]:POWer:AC:REFerence . . .
Chapter 4 Command Reference [:SENSe]:FUNCtion Subtree [:SENSe]:ROSCillator Subtree This subtree controls the Reference Oscillator. COMMAND [:SENSe]:ROSCillator:SOURce . . . Sets or queries the current reference timebase to INTernal or EXTernal. QUERY RESPONSE 4 COMMENTS RELATED FRONT-PANEL KEYS A sequence of ASCII-encoded bytes: INT or EXT • *RST: INT • INTernal indicates the timebase is the internal reference.
Chapter 4 Command Reference :STATus Subsystem :STATus Subsystem The :STATus subsystem commands allow you to specify or examine the status of the Operation Status Register group and the Questionable Data/Signal Register group. :STATus:OPERation Subtree The :STATus:OPERation subtree commands allow you to examine the status of the Counter monitored by the Operation Status Register Group, shown in Figure 4-1.
Chapter 4 Command Reference :STATus Subsystem COMMAND :STATus:OPERation:CONDition? Queries the status of the Operation Condition Status Register. QUERY RESPONSE COMMENTS RELATED FRONT-PANEL KEYS COMMAND • Numeric data transferred as ASCII bytes in format. • Range is 0 to 32,767. • The query response value is an integer formed by the binary weighting of the bits. The value of unused bits is zero. • Query only. • The Operation Condition Status Register is cleared at power-on.
Chapter 4 Command Reference :STATus Subsystem COMMAND :STATus:OPERation[:EVENt]? Queries the status of the Operation Event Status Register. QUERY RESPONSE COMMENTS RELATED FRONT-PANEL KEYS • Numeric data transferred as ASCII bytes in format. • Range is 0 to 32,767. • The query response value is an integer formed by the binary weighting of bits. The value of unused bits is zero.
Chapter 4 Command Reference :STATus Subsystem COMMAND :STATus:OPERation:NTRansition | Sets or queries the negative transition filter for the Operation status reporting structure. RANGE QUERY RESPONSE COMMENTS RELATED FRONT-PANEL KEYS 4 COMMAND The range of the or parameter is 0 to 32,767. Numeric data transferred as ASCII bytes in format.
Chapter 4 Command Reference :STATus Subsystem COMMENTS RELATED FRONT-PANEL KEYS COMMAND • The parameter and the query response value, when rounded to an integer value and expressed in base 2 (binary), represent the bit values of the positive transition filter. • The value of unused bits is zero when queried and is ignored when set.
Chapter 4 Command Reference :STATus Subsystem :STATus:QUEStionable Subtree The :STATus:QUEStionable subtree commands allow you to examine the status of the Counter monitored by the Questionable Data/Signal Status Register Group, shown in Figure 4-3. The Questionable Status Group consists of a condition register, two transition registers, an event register, and an enable register. The commands in this subtree allow you to control and monitor these registers.
Chapter 4 Command Reference :STATus Subsystem COMMAND :STATus:QUEStionable:ENABle . . . | Sets or queries the Questionable Data Event Status Enable Register. RANGE QUERY RESPONSE COMMENTS RELATED FRONT-PANEL KEYS COMMAND The range of the or parameter is 0 to 32,767. Numeric data transferred as ASCII bytes in format.
Chapter 4 Command Reference :STATus Subsystem The event bits, once set, are “sticky”—i.e., they cannot be cleared until they are read, even if they do not reflect the current status of a related condition. • The Questionable Data Event Status Register is cleared by *CLS, by :STAT:QUES[:EVEN]?, and at power-on.
Chapter 4 Command Reference :SYSTem Subsystem :SYSTem Subsystem This subsystem collects together the capabilities that are not related to instrument performance. :SYSTem:COMMunicate Subtree The :SYSTem:COMMunicate subtree collects together the configuration of the control/communication interfaces. The :SYSTem:COMMunicate:SERial subtree controls the physical configuration of the RS-232C port. Any command to change the settings takes effect immediately upon receipt of the “program message termination.
Chapter 4 Command Reference :SYSTem Subsystem COMMAND :SYSTem:COMMunicate:SERial:BAUD . . . Sets or queries the baud rate. RANGE The possible BAUD rate values that can be entered for the parameter are: 1200, 2400, 4800, 9600, 14400, and 19200. QUERY RESPONSE Numeric data transferred as ASCII bytes in format. COMMENTS RELATED FRONT-PANEL KEYS COMMAND • This value is unaffected by *RST.
Chapter 4 Command Reference :SYSTem Subsystem COMMENTS RELATED FRONT-PANEL KEYS COMMAND • The queue is cleared (emptied) on *CLS, power-on, or upon reading he last error from queue. • If the Error Queue overflows, the last error in the queue is replaced with the error -350, “Queue overflow”. Any time the queue overflows, the least recent errors remain in the queue and the most recent error is discarded. The maximum length of the Error Queue is 30.
Chapter 4 Command Reference :TRIGger Subsystem :TRIGger Subsystem COMMAND :TRIGger[SEQuence | STARt]:HOLDoff . . . When INIT:CONT is ON, this command determines the rate at which measurements are made by setting a delay between measurements. Its setting corresponds to the front-panel rate setting as follows: RATE COMMENTS • *RST: 0.0 • The only settings that are accepted are the three listed above. • The measurement rate is also affected by the Resolution setting.
Chapter 4 Command Reference Common Commands Common Commands The IEEE 488.2 Common Commands are general-purpose commands that are common to all instruments (as defined in IEEE 488.2). These commands are generally not related to measurement configuration. They are used for functions like resetting the instrument, identification, or synchronization.
Chapter 4 Command Reference Common Commands *DDT (Define Device Trigger Command) *DDT? (Define Device Trigger Query) COMMAND *DDT *DDT? Sets or queries the action that the device executes when it receives the IEEE 488.1 Group Execute Trigger (GET) interface message (Page 4-7) or a *TRG common command.
Chapter 4 Command Reference Common Commands *ESE (Standard Event Status Enable Command) *ESE? (Standard Event Status Enable Query) COMMAND *ESE | *ESE? Sets or queries the Standard Event Status Enable Register, shown in Figure 4-3. The parameter and query response value, when rounded to an integer value and expressed in base 2 (binary), represents the bit values of the Standard Event Status Enable Register. The value of unused bits is zero when queried and ignored when set.
Chapter 4 Command Reference Common Commands RANGE RESOLUTION QUERY RESPONSE COMMENTS 1 Numeric data transferred as ASCII bytes in format. • At power-on, the Standard Event Status Enable Register is cleared (value is 0). • This value is unaffected by *RST and *SAV/*RCL. • Values for *ESE may be entered as decimal, hexadecimal, octal, or binary numbers.
Chapter 4 Command Reference Common Commands *ESR? (Event Status Register Query) COMMAND *ESR? Queries the Standard Event Status Register, shown in Figure 4-4. This event register captures changes in conditions, by having each event bit correspond to a specific condition in the instrument. An event becomes TRUE when the associated condition makes the defined transition. The event bits, once set, are “sticky”—i.e.
Chapter 4 Command Reference Common Commands *IDN? (Identification Query) COMMAND *IDN? Queries the Counter identification. QUERY RESPONSE A sequence of ASCII-encoded bytes: Agilent Technologies, , , COMMENTS RELATED FRONT-PANEL KEYS • This query should be the last query in a terminated program message; if it is not the last query, an error -440 is generated. • The model number is either 53150A, 53151A, or 53152A.
Chapter 4 Command Reference Common Commands *OPC (Operation Complete Command) COMMAND *OPC This event command enables the OPC bit (bit 0) in the Standard Event Status Register to be set when a triggered action is complete. See the section titled “Standard Event Status Register” on Page 3-30 of this guide for a detailed description of the Standard Event Status Register's Operation Complete bit.
Chapter 4 Command Reference Common Commands *PRE (Parallel Poll Enable Register) *PRE? (Parallel Poll Enable Register Query) COMMAND *PRE *PRE? Sets or queries the value of the parallel poll enable register. QUERY RESPONSE RANGE COMMENTS RELATED FRONT-PANEL KEYS 0-255 • The parallel poll enable register is eight bits wide and has the same bit definitions as the status byte.
Chapter 4 Command Reference Common Commands *RST (Reset Command) COMMAND *RST This event command performs an instrument reset. The reset performs the following: COMMENTS RELATED FRONT-PANEL KEYS • sets instrument settings to their *RST states, and • places the instrument in “Operation Complete Idle State” and “Operation Complete Query Idle State.” • See the section titled “*RST Response” on Page 2-19 for a complete listing of the *RST state.
Chapter 4 Command Reference Common Commands *SAV (Save Command) COMMAND *SAV | This command stores the current state of the instrument in register 0 of local non-volatile memory when *RCL or is executed or Recall is selected from the menu using the front-panel controls.
Chapter 4 Command Reference Common Commands *SRE (Service Request Enable Command) *SRE? (Service Request Enable Query) COMMAND *SRE | *SRE? Sets or queries the Service Request Enable Register, which is shown in Figure 4-5. The parameter and query response value, when rounded to an integer value and expressed in base 2 (binary), represents the bit values of the Service Request Enable Register.
Chapter 4 Command Reference Common Commands COMMENTS At power-on, this value is cleared (set to 0). • This value is unaffected by *RST, *CLS, and *SAV/*RCL.
Chapter 4 Command Reference Common Commands *STB? (Status Byte Query) COMMAND *STB? Queries the Status Byte Register, shown in Figure 4-6. This register is cleared at power-on. This query does not directly alter the Status Byte Register (including the MSS/RQS bit) or anything related to the generation of SRQ. Not Used EAV QSB MAV ESB RQS/MSS OSB Bits 0 to 1 2 (8) 3 (16) 4 (32) 5 (64) 6 (128) 7 Figure 4-6.
Chapter 4 Command Reference Common Commands *TRG (Trigger Command) COMMAND *TRG This command is the device-specific analog of the IEEE 488.1 Group Execute Trigger (GET) interface message (Page 4-7), and has exactly the same effect. The *TRG command performs the action defined by the *DDT command (Page 4-44).
Chapter 4 Command Reference Common Commands *TST? (Self-Test Query) COMMAND *TST? This query causes an internal self-test; the response indicates whether any errors were detected When the self-test fails, error -330 is generated, and other messages indicating specific failures are also placed in the error/event queue. QUERY RESPONSE • Numeric data transferred as ACSII bytes in format.
Chapter 4 Command Reference Common Commands COMMENTS RELATED FRONT-PANEL KEYS The following are tested: CPU EEPROM Front-panel components Measurement hardware ROM Power supply outputs Shift + Menu (DO SELF TEST) *WAI (Wait-to-Continue Command) COMMENTS *WAI This command prevents the instrument from executing any further commands or queries until all pending operations are complete. The only way to cancel this “holdoff” is by device clear, power-on, *RST, or *CLS.
5 Errors
Chapter 5 Errors Introduction Introduction This chapter explains how to read error messages from the Counter, discusses the types of errors, and provides a table of all of the Counter’s error messages and their probable causes. Reading an Error Executing the :SYSTem:ERRor? command reads the oldest error from the error queue and erases that error from the queue.
Chapter 5 Errors Error Queue Error Queue As errors are detected, they are placed in an error queue. The error queue is a first in, first out queue. That is, if more than one error has occurred, the first error in the queue is read out with :SYST:ERR?. Subsequent responses to :SYST:ERR? continue until the queue is empty. If the error queue overflows, the last error in the queue is replaced with error −350, “Queue overflow”.
Chapter 5 Errors Error Types Error Types Error numbers are categorized by type as shown in Table 5-1. The error codes that can be generated by the Agilent 53151A/152A/153A Counters are listed in Table 5-2. Table 5-1. Error Types Error Number Error Type +0 No Error −100 to −199 Command Errors −200 to −299 Execution Errors −300 to −350 Device-Specific Errors −400 to −499 Query Errors The first error described in each class (for example, -100, -200, -300, -400) is a “generic” error.
Chapter 5 Errors Error Types Command Error An in the range [−100 to −199] indicates that an IEEE 488.2 syntax error was detected by the Counter’s parser. The occurrence of any error in this class causes the command error bit (bit 5) in the Event Status Register to be set. This happens when one of the following events occurs: • An IEEE 488.2 syntax error is detected by the Counter’s parser. That is, a controller-to-Counter message was received that is in violation of the IEEE 488.2 Standard.
Chapter 5 Errors Error Types Device- or Counter-Specific Error An in the range [−300 to −399] or [+1 to +32767] indicates that the Counter has detected an error that is not a command error, a query error, or an execution error; some Counter operations did not properly complete, possibly due to an abnormal hardware or firmware condition. These codes are also used for self-test response errors.
Chapter 5 Errors Error Types Table 5-2.
Chapter 5 Errors Error Types Table 5-2.
Chapter 5 Errors Error Types Table 5-2.
Chapter 5 Errors Error Types Table 5-2. Errors (Continued) Number Error String Cause Query UNTERMINATED -430 Query DEADLOCKED -440 Query UNTERMINATED after indefinite response Indicates that a condition causing an UNTERMINATED Query error occurred. For example, the Counter was addressed to talk and an incomplete program message was received. Indicates that a condition causing a DEADLOCKED Query error occurred. For example, both input buffer and output buffer are full and the Counter cannot continue.
Index A ABORt, 2-13, 4-4 ACSII, 4-57 ADDRess, 2-18, 4-39 address, GPIB, 3-6, 4-39 Applications, 1-5 ASCII format, 3-55 Assumptions, 1-7 auto-trigger, 4-8 AVERage, 2-5, 2-15, 4-22 STATe, 2-15 averaging, 2-15 Programming Guide B Index *CLS, 2-10, 5-3, 5-4 *DDT, 2-10, 4-44, 4-56 *DDT?, 2-10, 4-44 *ESE, 2-10, 2-20, 4-45 *ESE?, 2-10 *ESR?, 2-10, 4-47 *IDN?, 2-7, 2-10, 4-48 *IST?, 2-10, 4-48 *OPC, 2-10, 4-49 *OPC?, 2-10, 4-49 *PRE, 2-10, 2-20, 4-50 *PRE?, 2-10, 4-50 *RCL, 2-7, 2-10, 4-50, 4-52 *RST, 2-7, 2-1
Index Index *RCL, 2-10, 4-50 *RST, 2-10, 4-51 *SAV, 2-10, 4-52 *SRE, 2-10, 4-53 *SRE?, 2-11, 4-53 *STB?, 2-11, 4-55 *TRG, 2-11, 4-56 *TST?, 2-11, 4-57 *WAI, 2-11, 4-58 Clear Status, 2-10 CONFigure, 2-13 common commands definition, 2-9, 4-43 summary list, 2-10 syntax, 2-9 Common Commands Summary Table, 2-10 Common Commands, IEEE 488.
Index F fall time, 4-27, 4-28 FETCh, 2-13, 2-14, 4-10 FETCh?, 4-11, 4-13 FILTer, 2-7, 2-15, 4-9, 4-24 filter, 2-13 FM, 4-24 FM compensation, 2-15 FM signals, 4-24 FREQuency, 2-5, 2-14, 2-16, 4-25, 4-26 frequency, 4-16, 4-17, 4-27, 4-28 frequency modulation, 4-24 frequency ratio, 4-27, 4-28 frequency unit, 2-16 frequency values, 2-15 front panel to SCPI command maps, 2-3 FUNCtion, 2-5, 2-16, 4-28, 4-29 function, 2-14, 4-12, 4-13, 4-27, 4-28 Programming Guide G general-purpose functions, 2-12 GET, 2-10, 2-
Index Index INITiate, 2-13, 4-8, 4-11 initiate, 4-8 initiate measurements, 4-8 INITitiate, 2-5 INPut, 2-7, 2-13, 4-9 Instrument Status, 2-10, 4-48 Instrument Status Query, 2-10 Invalid block data, 5-8 Invalid character, 5-7 Invalid character data, 5-8 Invalid character in number, 5-7 Invalid expression, 5-8 Invalid outside macro definition, 5-8 Invalid separator, 5-7 Invalid string data, 5-8 Invalid suffix, 5-8 K KEY, 2-18 key codes, 2-18 L Learning to Program the Counter, 1-4 list of errors, 5-7 loss v
Index P Parallel Poll Enable Register, 2-10, 4-50 Parallel Poll Enable register, 2-10 parallel poll enable register, 4-50 Parallel Poll Enable Register Query, 2-10 parallel poll response, 2-10, 4-48 Parameter error, 5-9 Parameter not allowed, 5-7 Parameter Types, 2-12 parameter types, 3-16 parameters, 2-14, 4-12 peak-to-peak voltage, 4-27, 4-28 period, 4-27, 4-28 phase, 4-27, 4-28 PON, 3-31 positive pulse width, 4-27, 4-28 positive transition filter, 2-17 positive transition filter register, 3-37 POWer, 2-
Index Index remote, 3-2 Reset, 2-10, 4-51 Reset Command, 4-51 RESolution, 2-16, 4-26 resolution, 2-14, 4-13, 4-26 response format, 4-11 rise time, 4-27, 4-28 ROSCillator, 2-16, 4-30 RQC, 3-31 RQS, 4-55 RQS/MSS, 3-29 RS-232, 1-2, 1-7, 3-5, 3-7, 4-39 S Save, 2-10, 4-52 Save Command, 4-52 SCALar, 4-12, 4-13, 4-14, 4-15 SCPI, 1-2, 1-5, 1-8, 1-9, 2-8, 3-2 obtaining copy of standard, 1-8 syntax conventions, 2-3 version, 1-2, 4-41 SCPI commands ABORt, 2-13 ADDRess, 2-18 AVERage, 2-15 STATe, 2-15 BAUD, 2-18 CATa
Index Programming Guide status byte register, 4-55 status reporting, 3-41 STATus Subsystem, 4-31 STATus subsystem commands, 4-31 Std, 2-12 string BASIC, 3-54 parameters, 3-54 String data not allowed, 5-8 Subsystem, 4-22 Subsystem Commands, 4-4 ABORt, 4-4 DISPlay, 4-5 ENABle, 4-6 INITiate, 4-8 CONTinuous, 4-8 INPut, 4-9 MEASure, 4-10 MEMory, 4-20 SENSe, 4-22 STATus, 4-31 OPERation:CONDition?, 4-32 SYSTem, 4-39 SYSTem ERRor?, 4-40 Suffix error, 5-7 Suffix not allowed, 5-8 Suffix too long, 5-8 Summary of the
Index Index T V time interval, 4-27, 4-28 Too many digits, 5-7 Too much data, 5-9 totalize, 4-27, 4-28 TRACking, 2-16, 4-26 Transition Filter, 3-34 transition filter, 4-35 TRIGger, 2-5, 2-18, 4-42 Trigger, 2-11 trigger device, 4-44 Trigger Command, 4-56 Trigger error, 5-8 Trigger ignored, 5-9 trigger system, 2-13 Turbo, 1-4 Turbo C, using, 3-55 version, SCPI, 4-41 VOLTage, 2-14 voltage maximum, 4-27, 4-28 minimum, 4-27, 4-28 W Wait-to-Continue, 2-11 Wait-to-Continue Command, 4-58 WINDow, 4-5 writing p
Service and Support Contacting Agilent Technologies: For more information about Agilent test and measurement products, applications, and services, visit our web site at http://www.agilent.com/services/English/index.html. Agilent’s Test and Measurement Fax Service for United States and Canada: Technical information for test and measurement products and services is available 24 hours a day, 7 days a week, by calling 1-800-800-5281.
Continued from front matter. . . Warranty (cont’d) Agilent does not warrant that the operation of Agilent products will be uninterrupted or error free. If Agilent is unable, within a reasonable time, to repair or replace any product to a condition as warranted, customer will be entitled to a refund of the purchase price upon prompt return of the product. Agilent products may contain remanufactured parts equivalent to new in performance or may have been subjected to incidental use.