Programmer’s Guide Publication Number 54622-97038 September 2002 For Safety information see the pages behind the Index.
Programming the Oscilloscope When you attach an interface module to the rear of the oscilloscope, it becomes programmable. That is, you can hook a controller (such as a PC or workstation) to it, and write programs on that controller to automate oscilloscope setup and data capture. The following figure shows the basic structure of every program you will write for the oscilloscope.
Capture Once you initialize the oscilloscope, you can begin capturing data for analysis. Remember that while the oscilloscope is responding to commands from the controller, it is not performing acquisitions. Also, when you change the oscilloscope configuration, any data already captured will most likely be rendered. To collect data, you use the :DIGitize command. This command clears the waveform buffers and starts the acquisition process. Acquisition continues until acquisition memory is full, then stops.
In This Book This Programmer’s Guide is your introduction to programming the oscilloscope using an instrument controller. This book, with the Programmer’s Reference, provides a comprehensive description of the oscilloscope’s programmatic interface. The Programmer’s Reference is supplied as a Microsoft Windows Help file on a 3.5" diskette. The oscilloscope has a built-in RS-232-C port for programming. To program the oscilloscope over GPIB, you need the N2757A GPIB Interface Module.
Contents 1 Introduction to Programming Talking to the Instrument 1-3 Program Message Syntax 1-4 Combining Commands from the Same Subsystem 1-7 Duplicate Mnemonics 1-8 Query Command 1-9 Program Header Options 1-10 Program Data Syntax Rules 1-11 Program Message Terminator 1-13 Selecting Multiple Subsystems 1-14 2 Programming Getting Started Initialization 2-3 Autoscale 2-4 Setting Up the Instrument 2-5 Example Program 2-6 Using the DIGitize Command 2-7 Receiving Information from the Instrument 2-9 String Va
Contents 5 Programming and Documentation Conventions Command Set Organization 5-3 The Command Tree 5-6 Obsolete and Discontinued Commands 5-10 Truncation Rules 5-15 Infinity Representation 5-16 Sequential and Overlapped Commands 5-16 Response Generation 5-16 Notation Conventions and Definitions 5-17 Program Examples 5-18 6 Status Reporting Status Reporting Data Structures 6-5 Status Byte Register (SBR) 6-8 Service Request Enable Register (SRER) 6-10 Trigger Event Register (TRG) 6-10 Standard Event Status
1 Introduction to Programming
Introduction to Programming Chapters 1 and 2 introduce the basics for remote programming of an oscilloscope. The programming instructions in this manual conform to the IEEE488.2 Standard Digital Interface for Programmable Instrumentation. The programming instructions provide the means of remote control. To program the oscilloscope you must add either a GPIB (N2757A) interface, or program over the built-in RS-232-C interface on the rear panel.
Introduction to Programming Talking to the Instrument Talking to the Instrument Computers acting as controllers communicate with the instrument by sending and receiving messages over a remote interface. Instructions for programming normally appear as ASCII character strings embedded inside the output statements of a host language available on your controller. The input statements of the host language are used to read in responses from the oscilloscope.
Introduction to Programming Program Message Syntax Program Message Syntax To program the instrument remotely, you must understand the command format and structure expected by the instrument. The IEEE 488.2 syntax rules govern how individual elements such as headers, separators, program data, and terminators may be grouped together to form complete instructions. Syntax definitions are also given to show how query responses are formatted.
Introduction to Programming Program Message Syntax Instructions Instructions (both commands and queries) normally appear as a string embedded in a statement of your host language, such as BASIC, Pascal, or C. The only time a parameter is not meant to be expressed as a string is when the instruction’s syntax definition specifies , such as . There are only a few instructions that use block data.
Introduction to Programming Program Message Syntax Header Types There are three types of headers: • Simple Command headers • Compound Command headers • Common Command headers Simple Command Header Simple command headers contain a single mnemonic. AUTOSCALE and DIGITIZE are examples of simple command headers typically used in this instrument. The syntax is: Simple command headers must occur at the beginning of a program message; if not, they must be preceded by a colon.
Introduction to Programming Combining Commands from the Same Subsystem Combining Commands from the Same Subsystem To execute more than one function within the same subsystem, separate the functions with a semicolon (;): ::; (For example :CHANNEL1:COUPLING DC;BWLIMIT ON) 1-7
Introduction to Programming Duplicate Mnemonics Duplicate Mnemonics Identical function mnemonics can be used in more than one subsystem. For example, the function mnemonic RANGE may be used to change the vertical range or to change the horizontal range: :CHANNEL1:RANGE .4 sets the vertical range of channel 1 to 0.4 volts full scale. :TIMEBASE:RANGE 1 sets the horizontal time base to 1 second full scale. CHANNEL1 and TIMEBASE are subsystem selectors and determine which range is being modified.
Introduction to Programming Query Command Query Command Command headers immediately followed by a question mark (?) are queries. After receiving a query, the instrument interrogates the requested function and places the answer in its output queue. The answer remains in the output queue until it is read or another command is issued. When read, the answer is transmitted across the bus to the designated listener (typically a controller).
Introduction to Programming Program Header Options Program Header Options You can send program headers using any combination of uppercase or lowercase ASCII characters. Instrument responses, however, are always returned in uppercase. Program command and query headers may be sent in either long form (complete spelling), short form (abbreviated spelling), or any combination of long form and short form.
Introduction to Programming Program Data Syntax Rules Program Data Syntax Rules Program data is used to convey a parameter information related to the command header. At least one space must separate the command header or query header from the program data. When a program mnemonic or query has multiple program data, a comma separates sequential program data.
Introduction to Programming Program Data Syntax Rules All numbers must be strings of ASCII characters. Thus, when sending the number 9, you would send a byte representing the ASCII code for the character 9 (which is 57). A three-digit number like 102 would take up three bytes (ASCII codes 49, 48, and 50). This is handled automatically when you include the entire instruction in a string.
Introduction to Programming Program Message Terminator Program Message Terminator The program instructions within a data message are executed after the program message terminator is received. The terminator may be either an NL (New Line) character, an EOI (End-Or-Identify) asserted in the GPIB interface, or a combination of the two. Asserting the EOI sets the EOI control line low on the last byte of the data message. The NL character is an ASCII linefeed (decimal 10).
Introduction to Programming Selecting Multiple Subsystems Selecting Multiple Subsystems You can send multiple program commands and program queries for different subsystems on the same line by separating each command with a semicolon. The colon following the semicolon enables you to enter a new subsystem. For example: ; : :CHANNEL1:RANGE 0.
2 Programming Getting Started
Programming Getting Started This chapter explains how to set up the instrument, how to retrieve setup information and measurement results, how to digitize a waveform, and how to pass data to the controller. Languages for Programming Examples The programming examples in this manual are written in HPBASIC 6.3 or C.
Programming Getting Started Initialization Initialization To make sure the bus and all appropriate interfaces are in a known state, begin every program with an initialization statement. HP BASIC provides a CLEAR command which clears the interface buffer: CLEAR 707 ! initializes the interface of the instrument When you are using GPIB, CLEAR also resets the oscilloscope’s parser. The parser is the program which reads in the instructions which you send it.
Programming Getting Started Autoscale Autoscale The AUTOSCALE feature performs a very useful function for unknown waveforms by setting up the vertical channel, time base, and trigger level of the instrument.
Programming Getting Started Setting Up the Instrument Setting Up the Instrument A typical oscilloscope setup would set the vertical range and offset voltage, the horizontal range, delay time, delay reference, trigger mode, trigger level, and slope. An example of the commands that might be sent to the oscilloscope are: :CHANNEL1:PROBE 10;RANGE 16;OFFSET 1.
Programming Getting Started Example Program Example Program This program demonstrates the basic command structure used to program the oscilloscope. 10 20 30 40 50 60 70 80 90 100 110 120 130 140 CLEAR 707 OUTPUT 707;"*RST" OUTPUT 707;":TIMEBASE:RANGE 5E-4" OUTPUT 707;":TIMEBASE:DELAY 0" OUTPUT 707;":TIMEBASE:REFERENCE CENTER" OUTPUT 707;":CHANNEL1:PROBE 10" OUTPUT 707;":CHANNEL1:RANGE 1.6" OUTPUT 707;":CHANNEL1:OFFSET -.
Programming Getting Started Using the DIGitize Command Using the DIGitize Command The DIGitize command is a macro that captures data satisfying the specifications set up by the ACQuire subsystem. When the digitize process is complete, the acquisition is stopped. The captured data can then be measured by the instrument or transferred to the controller for further analysis. The captured data consists of two parts: the waveform data record and the preamble.
Programming Getting Started Using the DIGitize Command The following program example shows a typical setup: OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT 707;":ACQUIRE:TYPE AVERAGE" 707;":ACQUIRE:COMPLETE 100" 707;":WAVEFORM:SOURCE CHANNEL1" 707;":WAVEFORM:FORMAT BYTE" 707;":ACQUIRE:COUNT 8" 707;":WAVEFORM:POINTS 500" 707;":DIGITIZE CHANNEL1" 707;":WAVEFORM:DATA?" This setup places the instrument int
Programming Getting Started Receiving Information from the Instrument Receiving Information from the Instrument After receiving a query (command header followed by a question mark), the instrument interrogates the requested function and places the answer in its output queue. The answer remains in the output queue until it is read or another command is issued. When read, the answer is transmitted across the interface to the designated listener (typically a controller).
Programming Getting Started String Variables String Variables The output of the instrument may be numeric or character data depending on what is queried. Refer to the specific commands for the formats and types of data returned from queries. Express String Variables Using Exact Syntax In HP BASIC 6.3, string variables are case sensitive and must be expressed exactly the same each time they are used.
Programming Getting Started Numeric Variables Numeric Variables The following example shows the data being returned to a numeric variable: 10 20 30 40 OUTPUT 707;":CHANNEL1:RANGE?" ENTER 707;Rang PRINT Rang END After running this program, the controller displays: 40 2-11
Programming Getting Started Definite-Length Block Response Data Definite-Length Block Response Data Definite-length block response data allows any type of device-dependent data to be transmitted over the system interface as a series of 8-bit binary data bytes. This is particularly useful for sending large quantities of data or 8-bit extended ASCII codes. The syntax is a pound sign ( # ) followed by a non-zero digit representing the number of digits in the decimal integer.
Programming Getting Started Multiple Queries Multiple Queries You can send multiple queries to the instrument within a single program message, but you must also read them back within a single program message. This can be accomplished by either reading them back into a string variable or into multiple numeric variables.
2-14
3 Programming over GPIB
Programming over GPIB This section describes the GPIB interface functions and some general concepts. In general, these functions are defined by IEEE 488.1. They deal with general interface management issues, as well as messages which can be sent over the interface as interface commands. For more information on connecting the controller to the oscilloscope, see the documentation for the GPIB interface card you are using.
Programming over GPIB Interface Capabilities Interface Capabilities The interface capabilities of the oscilloscope, as defined by IEEE 488.1, are SH1, AH1, T5, L4, SR1, RL1, PP0, DC1, DT1, C0, and E2. Command and Data Concepts The interface has two modes of operation: • command mode • data mode The bus is in the command mode when the ATN line is true. The command mode is used to send talk and listen addresses and various bus commands, such as a group execute trigger (GET).
Programming over GPIB Addressing Addressing To set up the GPIB interface (optional Agilent N2757A GPIB Interface Module must be connected to the oscilloscope), refer to the “To set up the I/O port to use a controller” topic in the Utilities chapter of the User’s Guide. • Each device on the GPIB resides at a particular address, ranging from 0 to 30. • The active controller specifies which devices talk and which listen.
Programming over GPIB Communicating Over the Bus Communicating Over the Bus Because GPIB can address multiple devices through the same interface card, the device address passed with the program message must include not only the correct interface select code, but also the correct instrument address. Interface Select Code (Selects Interface) Each interface card has a unique interface select code. This code is used by the controller to direct commands and communications to the proper interface.
Programming over GPIB Lockout Lockout With GPIB, the instrument is placed in the lockout mode by sending the local lockout command (LLO). The instrument can be returned to local by sending the go-to-local (GTL) command to the instrument. Bus Commands The following commands are IEEE 488.1 bus commands (ATN true). IEEE 488.2 defines many of the actions which are taken when these commands are received by the instrument.
4 Programming over RS-232-C
Programming over RS-232-C This section describes the interface functions and some general concepts of the RS-232-C interface. The RS-232-C interface on this instrument is Hewlett-Packard’s implementation of EIA Recommended Standard RS-232-C, Interface Between Data Terminal Equipment and Data Communications Equipment Employing Serial Binary Data Interchange. With this interface, data is sent one bit at a time and characters are not synchronized with preceding or subsequent data characters.
Programming over RS-232-C Interface Operation Interface Operation The oscilloscope can be programmed with a controller over RS-232-C using either a minimum three-wire or extended hardwire interface. The operation and exact connections for these interfaces are described in more detail in subsequent sections of this chapter.
Programming over RS-232-C Minimum Three-Wire Interface with Software Protocol Minimum Three-Wire Interface with Software Protocol With a three-wire interface, the software (as compared to interface hardware) controls the data flow between the oscilloscope and the controller. This provides a much simpler connection between devices because you can ignore hardware handshake requirements.
Programming over RS-232-C Extended Interface with Hardware Handshake Extended Interface with Hardware Handshake With the extended interface, both the software and the hardware can control the data flow between the oscilloscope and the controller. This allows you to have more control of data flow between devices.
Programming over RS-232-C Configuring the Interface The TD (Transmit Data) line from the oscilloscope must connect to the RD (Receive Data) line on the controller. Likewise, the RD line from the oscilloscope must connect to the TD line on the controller. The RTS (Request To Send) line is an output from the oscilloscope which can be used to control incoming data flow.
Programming over RS-232-C Interface Capabilities Interface Capabilities The baud rate, stop bits, parity, handshake protocol, and data bits must be configured exactly the same for both the controller and the oscilloscope to properly communicate over the RS-232-C bus.
Programming over RS-232-C Lockout Command Lockout Command To lockout the front panel controls use the system command LOCK. When this function is on, all controls (except the power switch) are entirely locked out. Local control can only be restored by sending the command :SYSTEM:LOCK OFF. Restoring Local Control Cycling the power will also restore local control, but this will also reset certain RS-232-C states.
5 Programming and Documentation Conventions
Programming and Documentation Conventions This chapter covers conventions used in programming the instrument, as well as conventions used in the online Programmer’s Reference and the remainder of this manual. This chapter also contains a detailed description of the command tree and command tree traversal.
Programming and Documentation Conventions Command Set Organization Command Set Organization The command set is divided into common commands, root level commands and sets of subsystem commands. Each of the groups of commands is described in the Programmer’s Reference, which is supplied as an online help file for Microsoft Windows. See chapter 7, “Installing and Using the Programmer’s Reference” for information on installing and using the help file. The commands shown use upper and lowercase letters.
Programming and Documentation Conventions Command Set Organization Table 5-1 Alphabetic Command Reference Command Subsystem Where used Command Subsystem Where used ACKNowledge ACTivity ACTivity ADDRess AER AUToscale BAUDrate BAUDrate BLANk BWLimit BWLimit BYTeorder TRIGger:CAN CHANnel Root level TRIGger:IIC:PATTern Root level Root level TRIGger:CAN:SIGNal TRIGger:LIN:SIGNal Root level CHANnel EXTernal WAVeform DEVice DIGitize DISPlay DISPlay DISPlay DISPlay *DMC DMINus DPLus DSP DUTycycle DURat
Programming and Documentation Conventions Command Set Organization Command Subsystem Where used *PMC PMODe POINts POINts POLarity POLarity POSition POSition POSition PREamble PREShoot PRINt PROBe PROBe PROTection PROTection PWIDth Common CHANnel ACQuire WAVeform TRIGger:TV TRIGger:GLITch DIGital TIMebase TIMebase:WINDow WAVeform MEASure Root level CHANnel EXTernal CHANnel EXTernal MEASure QUALifier QUALifier QUALifier TRIGger:DURation TRIGger:GLITch TRIGger:IIC:TRIGer RANGe RANGe RANGe RANGe
Programming and Documentation Conventions The Command Tree The Command Tree The command tree shows all of the commands and the relationships of the commands to each other. The IEEE 488.2 common commands are not listed as part of the command tree because they do not affect the position of the parser within the tree. When a program message terminator (, linefeed-ASCII decimal 10) or a leading colon (:) is sent to the instrument, the parser is set to the root of the command tree.
Programming and Documentation Conventions The Command Tree URRW $&7LYLW\ 6<67HP $&4XLUH &$/LEUDWH &+$1QHO Q! ',*LWDO Q! ',63OD\ (;7HUQDO $87RVFDOH '$7( &203OHWH '$7( %:/LPLW ',63OD\ &/(DU %:/LPLW %/$1N '63 &281W /$%HO &283OLQJ /$%HO '$7$ ,03HGDQFH &',6SOD\ (55RU 02'( 6:,7FK ',63OD\ 326LWLRQ /$%HO 352%H ',*LWL]H /2&.
Programming and Documentation Conventions The Command Tree Subsystem Commands Subsystem commands are grouped together under a common node of the command tree, such as the TIMEBASE commands. Only one subsystem may be selected at any given time. When the instrument is initially turned on, the command parser is set to the root of the command tree, therefore, no subsystem is selected. Tree Traversal Rules Command headers are created by traversing down the command tree.
Programming and Documentation Conventions The Command Tree Example 2: OUTPUT 707;":TIMEBASE:REFERENCE CENTER ; DELAY 0.00001" or OUTPUT 707;":TIMEBASE:REFERENCE CENTER" OUTPUT 707;":TIMEBASE:DELAY 0.00001" or OUTPUT 707;":TIMEBASE:REFERENCE CENTER; :TIMEBASE:DELAY 0.00001" In the first line of example 2, the subsystem selector is implied for the DELAY command in the compound command.
Programming and Documentation Conventions Obsolete and Discontinued Commands Obsolete and Discontinued Commands Core Commands Core commands are a common set of commands that provide basic oscilloscope functionality on this oscilloscope and future Agilent 54600-series oscilloscopes. Core commands are unlikely to modified in the future. If you restrict your programs to core commands, the programs should work across product offerings in the future, assuming appropriate programming methods are employed.
Programming and Documentation Conventions Obsolete and Discontinued Commands Obsolete Commands Obsolete commands are older forms of commands that are provided to reduce customer rework for existing systems and programs. Generally, these commands are mapped onto some of the Core and Non-core commands, but may not strictly have the same behavior as the new command. None of the obsolete commands are guaranteed to functional in future products.
Programming and Documentation Conventions Obsolete and Discontinued Commands Obsolete Command Current Command Equivalent FUNCtion:VIEW FUNCtion:DISPlay HARDcopy:DEVice HARDcopy:FORMat PLOTter, THINkjet not supported; TIF, BMP, CSV, SEIko added MEASure:LOWer MEASure:DEFine:THResholds MEASure:DEFine:THResholds can define absolute values or percentage from 1% to 99% for lower, middle, and upper thresholds on analog channels.
Programming and Documentation Conventions Obsolete and Discontinued Commands Discontinued Commands Discontinued commands are commands that were used by previous oscilloscopes, but are not supported by the 54620/40-series oscilloscopes. Listed below are the Discontinued commands and the nearest equivalent command available (if any).
Programming and Documentation Conventions Obsolete and Discontinued Commands Discontinued Parameters Some previous oscilloscope queries returned control setting values of OFF and ON. The 54620/40-series oscilloscopes only return the enumerated values 0 (for off) and 1 (for on).
Programming and Documentation Conventions Truncation Rules Truncation Rules The truncation rule for the mnemonics used in headers and alpha arguments is: The mnemonic is the first four characters of the keyword unless: The fourth character is a vowel, then the mnemonic is the first three characters of the keyword. This rule is not used if the length of the keyword is exactly four characters. Some examples of how the truncation rule is applied to various commands are shown in the following table.
Programming and Documentation Conventions Infinity Representation Infinity Representation The representation of infinity is 9.9E+37. This is also the value returned when a measurement cannot be made. Sequential and Overlapped Commands IEEE 488.2 distinguishes between sequential and overlapped commands. Sequential commands finish their task before the execution of the next command starts. Overlapped commands run concurrently.
Programming and Documentation Conventions Notation Conventions and Definitions Notation Conventions and Definitions The following conventions and definitions are used in this manual and the online Programmer’s Reference in descriptions of remote operation: Conventions < > Angle brackets enclose words or characters that symbolize a program code parameter or an interface command. ::= is defined as. For example, ::= indicates that can be replaced by in any statement containing . | or.
Programming and Documentation Conventions Program Examples Program Examples The BASIC program examples given for commands in the online Programmer’s Reference were written using the HPBASIC 6.3 programming language. The programs always assume the oscilloscope is at address 7 and the interface is at address 7 for a program address of 707. If a printer is used, it is always assumed to be at address 701. In these examples, give special attention to the ways in which the command or query can be sent.
6 Status Reporting
Status Reporting Figure 6-1 is an overview of the oscilloscope’s status reporting structure. The status reporting structure allows monitoring specified events in the oscilloscope. The ability to monitor and report these events allows determination of such things as the status of an operation, the availability and reliability of the measured data, and more. • To monitor an event, first clear the event, then enable the event. All of the events are cleared when you initialize the instrument.
Status Reporting Figure 6-1 Status Reporting Overview Block Diagram The status reporting structure consists of the registers in figure 6-1.
Status Reporting Table 6-1 is a list of the bit definitions for the bit in the status reporting data structure.
Status Reporting Status Reporting Data Structures Status Reporting Data Structures Figure 6-2 brings together the different status reporting data structures mentioned in this chapter and shows how they work together. To make it possible for any of the Standard Event Status Register bits to generate a summary bit, the bits must be enabled. These bits are enabled by using the *ESE common command to set the corresponding bit in the Standard Event Status Enable Register.
Status Reporting Status Reporting Data Structures Figure 6-2 6WDQGDUG (YHQW 6WDWXV 5HJLVWHU 5HDG E\ (65" 3RZHU 2Q 5 2 O D F L J R / 8VHU 5HTXHVW &RPPDQG (UURU ([HFXWLRQ (UURU 'HYLFH 'HSHQGHQW (UURU 4XHU\ (UURU 7ULJJHU 2SHUDWLRQ &RPSOHWH 6WDQGDUG (YHQW 6WDWXV (QDEOH 5HJLVWHU 6HUYLFH 6HW E\ (6( 5HTXHVW 5HDG E\ (6(" *HQHUDWLRQ 4XHXH 1RW (PSW\ 2XWSXW 4XHXH 546 066 5HDG E\ 6HULDO 3ROO (6%
Status Reporting Status Reporting Data Structures Figure 6-2 (continued) ([W 7ULJ &KDQ &KDQ &KDQ &KDQ 29/5" 5HJLVWHU 29/ 2YHUORDG (YHQW 29/" (QDEOH 5HJLVWHU $UP 5HJ $(5" 2YHUORDG (YHQW 5XQ ELW VHW LI VFRSH QRW VWRSSHG 2SHUDWLRQ :DLW 7ULJ 29/5 6WDWXV 5XQ 23(5" 5HJLVWHU 2SHUDWLRQ 23(( 6WDWXV (QDEOH 23((" 5HJLVWHU 321 854 &0( (;( ''( 4<( 54/ 23& (65" 6WDQGDUG (YHQW 6WD
Status Reporting Status Byte Register (SBR) Status Byte Register (SBR) 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. The Status Byte Register is a live register. That is, its summary bits are set and cleared by the presence and absence of a summary bit from other event registers or queues.
Status Reporting Status Byte Register (SBR) Example The following example uses the *STB? query to read the contents of the oscilloscopes Status Byte Register. 10 20 30 40 OUTPUT 707;"*STB?" ENTER 707;Result PRINT Result End !Query the Status Byte Register !Place result in a numeric variable !Print the result The next program prints 112 and clears bit 6 (RQS) of the Status Byte Register. The difference in the decimal value between this example and the previous one is the value of bit 6 (weight = 64).
Status Reporting Service Request Enable Register (SRER) Service Request Enable Register (SRER) Setting the Service Request Enable Register bits enable corresponding bits in the Status Byte Register. These enabled bits can then set RQS and MSS (bit 6) in the Status Byte Register. Bits are set in the Service Request Enable Register using the *SRE command and the bits that are set are read with the *SRE? query. Refer to figure 6-2.
Status Reporting Standard Event Status Register (SESR) Standard Event Status Register (SESR) The Standard Event Status Register (SESR) monitors the following oscilloscope status events: • PON - Power On • URQ - User Request • CME - Command Error • EXE - Execution Error • DDE - Device Dependent Error • QYE - Query Error • RQC - Request Control • OPC - Operation Complete When one of these events occur, the event sets the corresponding bit in the register.
Status Reporting Standard Event Status Enable Register (SESER) Standard Event Status Enable Register (SESER) To allow any of the Standard Event Status Register (SESR) bits to generate a summary bit, you must first enable that bit. Enable the bit by using the *ESE (Event Status Enable) common command to set the corresponding bit in the Standard Event Status Enable Register (SESER). Set bits are read with the *ESE? query.
Status Reporting Operation Status Register (OPR) Operation Status Register (OPR) This register hosts the RUN bit (bit 3), the WAIT TRIG bit (bit 5), and the OVLR bit (bit 11). • The RUN bit is set whenever the instrument is not stopped. • The WAIT TRIG bit is set by the Trigger Armed Event Register and indicates that the trigger is armed. • The OVLR bit is set whenever a 50Ω input overload occurs (54640-series only) • If any of these bits are set, the OPER bit (bit 7) of the Status Byte Register is set.
Status Reporting Error Queue Error Queue As errors are detected, they are placed in an error queue. This queue is first in, first out. If the error queue overflows, the last error in the queue is replaced with 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 length of the oscilloscope’s error queue is 30 (29 positions for the error messages, and 1 position for the Queue overflow message).
Status Reporting Output Queue Output Queue The output queue stores the oscilloscope-to-controller responses that are generated by certain instrument commands and queries. The output queue generates the Message Available summary bit when the output queue contains one or more bytes. This summary bit sets the MAV bit (bit 4) in the Status Byte Register. The output queue may be read with the HP Basic ENTER statement.
Status Reporting Clearing Registers and Queues Figure 6-3 Status Reporting Decision Chart 6-16
7 Installing and Using the Programmer’s Reference
Installing and Using the Programmer’s Reference The Programmer’s Reference is supplied as an online help file readable with the Microsoft Windows help viewer. Sample programs for the oscilloscopes are included in the Examples subdirectory. This chapter explains how to install the help file on your system, discusses the text and program files, and explains how you can get the programs and help file via the Internet.
Installing and Using the Programmer’s Reference To install the help file under Microsoft Windows To install the help file under Microsoft Windows The Programmer’s Reference help file requires Microsoft Windows 95/98/NT or greater running on an IBM-compatible PC. The file uses the Microsoft Windows help viewer, WINHELP.EXE. 1 Insert the “Programmer’s Reference” floppy disk into the floppy disk drive of your PC. 2 Select Start | Run from the Windows taskbar, then type in the following: :\setup.
Installing and Using the Programmer’s Reference To get updated help and program files via the Internet To get updated help and program files via the Internet The latest versions of the help and example program files are available via the internet. 1 Log on to your Internet service. 2 Connect to www.agilent.com/find/5462xsw.
Installing and Using the Programmer’s Reference To start the help file To start the help file To open the help file under Microsoft Windows, double-click the Programmer’s Reference icon in the Programmer’s Reference program group in the Program Manager. The help file requires the program WINHELP.EXE for Microsoft Windows 95/98/NT or greater. The properties for the Program Manager icon are set to expect this file in the Windows directory.
7-6
8 Programmer’s Quick Reference
Introduction The Programmer’s Quick Reference provides the commands and queries with their corresponding arguments and returned formats for the oscilloscopes. The arguments for each command list the minimum argument required. The part of the command or query listed in uppercase letters refers to the short form of that command or query. The long form is the combination of the uppercase and lowercase letters. Any optional parameters are listed at the end of each parameter listing.
Programmer’s Quick Reference Conventions Conventions The following conventions used in this guide include: <> Indicates that words or characters enclosed in angular brackets symbolize a program code parameter or an GPIB command. ::= "is defined as." ::= indicates that can be replaced by in any statement containing . | "or" Indicates a choice of one element from a list. For example, | indicates or but not both. ...
Programmer’s Quick Reference Commands and Queries Commands and Queries The following tables facilitate easy access to each command and query for the oscilloscopes. The commands and queries are divided into separate categories with each entry alphabetized. The arguments for each command list the minimum argument required. The part of the command or query listed in uppercase letters refers to the short form of that command or query. The long form is the combination of the uppercase and lowercase letters.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :CHANnel:IMPedence :CHANnel:IMPedence? ::= {ONEMeg} for 54620-series ::= {ONEMeg | FIFTy} for 54640-series ::= 1-2 or 1-4 in NR1 format :CHANnel:INVert {{0 | OFF} | {1 | ON}} :CHANnel:INVert? {0 | 1} ::= 1-2 or 1-4 in NR1 format :CHANnel:LABel :CHANnel:LABel? ::= any series of 6 or less ASCII characters enclosed in quotation mark
Programmer’s Quick Reference Commands and Queries Command Query :DISPlay:DATA [format][,][area] :DISPlay:DATA? [format][,][area] ::= {TIFF} (command only) ::= {GRATicule} (command only) ::= {TIFF | BMP} (query only) ::= {GRATicule | SCReen} (query only) ::= data in IEEE 488.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :FUNCtion:RANGe :FUNCtion:RANGe? ::= the full-scale vertical axis value in NR3 format. The range for ADD, SUBT, MULT is 8E-6 to 800E+3. The range for the INTegrate function is 8E-9 to 400E+3. The range for the DIFFerentiate function is 80E-3 to 8.0E12 (depends on current sweep speed). The range for the FFT function is 8 to 800 dBV.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns n/a :MARker:XDELta? ::= X cursors delta value in NR3 format :MARKer:Y1Position [suffix] :MARKer:Y1Position? ::= Y1 cursor position value in NR3 format [suffix] ::= {V | mV | dB} ::= Y1 cursor positon value in NR3 format :MARKER:Y2Position [suffix] :MARKer:Y2Position? ::= Y2 cursor position value in NR3 format [suffix] ::= {V | mV | dB}
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :MEASure:PERiod [] :MEASure:PERiod? [] ::= {CHANnel | FUNCtion | MATH} for 546xxA ::= {CHANnel | DIGital0,...
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :MEASure:VBASe [] :MEASure:VBASe? [] ::= {CHANnel | FUNCtion | MATH} ::= 1-2 or 1-4 in NR1 format ::= voltage at the base of the selected waveform in NR3 format :MEASure:VMAX [] :MEASure:VMAX? [] ::= {CHANnel | FUNCtion | MATH} ::= 1-2 or 1-4 in NR1 format ::= maximum voltage of the selected waveform in NR3 format :M
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns OVLenable OVLenable? ::= 8-bit integer in NR1 format as shown, 54640-series only: Bit Weight Input 4 16 External Trigger 3 8 Channel 4 2 4 Channel 3 1 2 Channel 2 0 1 Channel 1 n/a OVLRegister? ::= integer in NR1 format, 54640-series only.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns n/a *STB? ::= 0 to 255; an integer in NR1 format, as shown in the following: Bit Weight Name Condition 7 128 OPER 0 = no enabled operations status conditions occurred 1 = an enabled operation status condition occurred 6 64 RQS/MS 0 = instrument has no reason for service 1 = instrument is requesting service 5 32 ESB 0 = no event status conditions occurred 1 = enabled event status condition occurred 4
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TIMebase:RANGe :TIMebase:RANGe? ::= 50 ns through 500 s in NR3 format for 54620series ::= 10 ns through 500 s in NR3 format for 54640series :TIMebase:REFerence {LEFT | CENTer | RIGHt} :TIMebase:REFerence? ::= {LEFT | CENTer | RIGHt} :TIMebase:SCALe :TIMebase:SCALe? ::= scale value in seconds in NR3 format :TIMebase:WINDow:
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGGER:DURation:LESSthan [suffix] :TRIGger:DURation:LESSthan? ::= floating-point number from 5 ns to 10seconds in NR3 format [suffix] ::= {s | ms | us | ns | ps} :TRIGger:DURation:PATTern , :TRIGger:DURation:PATTern? ::= integer or ::= integer or ::= ""0xnnnnnn"" n ::= {0 ,...., 9 | A ,....
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGger:GLITch:RANGe [suffix], [suffix] :TRIGger:GLITch:RANGe? ::= start time from 10 ns to 9.
Programmer’s Quick Reference Commands and Queries Command Query :TRIGger:SEQuence:EDGE{1 | 2} , :TRIGger:SEQuence:EDGE{1 | 2}? ::= {CHANnel | EXTernal} for the 546xxA ::= {CHANnel | DIGital0,...
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGger:TV:STANdard :TRIGger:TV:STANdard? ::= {GENeric | NTSc | PAL | PALM | SECam} :TRIGger:TV:TVMODE :TRIGger:TV:TVMODE? ::= {Field | ALLFields | LINE | ALLLines | LINEField | LINEAlt | LINEVert} ::= 1-2 in NR1 format :TRIGger:USB:SOURce:DMINus :TRIGger:USB:SOURce:DMINus? ::= {CHANnel | EXTernal} for the 546xxA ::= {CHANnel | DI
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :WAVeform:UNSigned {{0 | OFF} | {1 | ON}} :WAVeform:UNSigned? {0 | 1} :WAVeform:VIEW :WAVeform:VIEW? ::= {MAIN} n/a :WAVeform:XINCrement? ::= x-increment in the current preamble in NR3 format n/a :WAVeform:XORigin? ::= x-origin value in the current preamble in NR3 format n/a :WAVeform:XREFerence? ::= 0 (x-reference value in the current preambl
Index A Analyzing Data iii Arm event Register (ARM) 6-13 AUToscale Command 2-4 B Basic Operations 1-2 Baud Rate 4-6 Block Response Data 2-12 Bus Commands 3-6 C Capturing Data iii Clear Events 6-2 Queue 6-15 Register 6-15 CME 6-11 Command Tree 5-6 Commands 1-5 Alphabetic reference 5-4 Combining 1-7, 1-14 ENTER 1-9 Listing of 8-4 Organization 5-3 Types 5-6 Common Commands 5-6 Communication 1-3 Conventions 5-17, 8-3 D DDE 6-11 Definitions 5-17 Description 1-9 Device Address 1-4, 3-5 Device Clear Command 3-6 D
Index R Registers Clearing 6-15 Response Generation 5-16 Root Level Commands 5-6 RQC 6-11 RS232 Interface 4-2 Cables 4-3 Capabilities 4-7 Configuration 4-6 Extended Interface 4-5 Three-Wire Interface 4-4 S Sequential Commands 5-16 Service Request Enable Register (SRER) 6-5, 6-10 Service Request Interrupt (SSRQ) 6-2 SRQ 6-2 Standard Event Status Enable Register (SESER) 6-5, 6-12 Standard Event Status Register (SESR) 6-2, 6-5, 6-11, 6-12 Status Byte Register (SBR) 6-2, 6-5, 6-8 Status Registers 2-13 Status R
Safety Notices • Whenever it is likely that the ground protection is impaired, you must make the instrument inoperative and secure it against any unintended operation. This apparatus has been designed and tested in accordance with IEC Publication 1010, Safety Requirements for Measuring Apparatus, and has been supplied in a safe condition. This is a Safety Class I instrument (provided with terminal for protective earthing).
Notices in any technical data. WARNING Document Warranty © Agilent Technologies, Inc. 2000-2002 No part of this manual may be reproduced in any form or by any means (including electronic storage and retrieval or translation into a foreign language) without prior agreement and written consent from Agilent Technologies, Inc. as governed by United States and international copyright laws.