About this Manual We’ve added this manual to the Agilent website in an effort to help you support your product. This manual is the best copy we could find; it may be incomplete or contain dated information. If we find a more recent copy in the future, we will add it to the Agilent website. Support for Your Product Agilent no longer sells or supports this product. Our service centers may be able to perform calibration if no repair parts are needed, but no other support from Agilent is available.
Programmer’s Guide Publication Number 54645-97000 June 1996 (pdf version Nov 1998) For Safety information, Warranties, and Regulatory information, see the pages behind the Index.
Programming the Oscilloscope When you attach an interface module to the rear of the HP 54645 A/D 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. Both HP-IB (also known as GP-IB, IEEE-488) and RS-232-C interfaces are available. 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 is most likely invalid. 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 The HP 54645A/D Programmer’s Guide is your introduction to programming the HP 54645A Oscilloscope or HP 54645D Mixed-Signal 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. To program the HP 54645A/D, you need an interface module, such as the HP 54650A, 54651A, or 54652B.
1 Introduction to Programming 2 Programming Getting Started 3 Programming over HP-IB 4 Programming over RS-232-C 5 Programming and Documentation Conventions 6 Status Reporting 7 Installing and Using the Programmer’s Reference 8 Programmer’s Quick Reference Index v
vi
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–7 Query Command 1–8 Program Header Options 1–9 Program Data Syntax Rules 1–10 Program Message Terminator 1–12 Selecting Multiple Subsystems 1–12 2 Programming Getting Started Initialization 2–3 Autoscale 2–4 Setting Up the Instrument 2–4 Example Program 2–5 Using the DIGitize Command 2–6 Receiving Information from the Instrument 2–8 String Var
Contents 4 Programming over RS-232-C Interface Operation 4–3 Cables 4–3 Minimum Three-Wire Interface with Software Protocol 4–4 Extended Interface with Hardware Handshake 4–5 Configuring the Interface 4–7 Interface Capabilities 4–8 Communicating Over the RS-232-C Bus 4–9 Lockout Command 4–10 5 Programming and Documentation Conventions Command Set Organization 5–3 The Command Tree 5–6 Truncation Rules 5–10 Infinity Representation 5–11 Sequential and Overlapped Commands 5–11 Response Generation 5–11 Notatio
Contents Output Queue 6–19 Message Queue 6–19 Key Queue 6–19 Clearing Registers and Queues 6–19 7 Installing and Using the Programmer’s Reference To install the help file under Microsoft Windows 7–3 To use the help text and example program files 7–3 To get updated help and program files via the Internet 7–4 To start the help file 7–5 To navigate through the help file 7–5 8 Programmer’s Quick Reference Introduction 8–2 Conventions 8–3 Suffix Multipliers 8–3 Commands and Queries 8–4 Index Contents–3
Contents–4
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 IEEE 488.2 Standard Digital Interface for Programmable Instrumentation. The programming instructions provide the means of remote control. To program the HP 54645A/D oscilloscope you must add either an HP-IB (HP 54650A, for example) or RS-232-C (HP 54651A, for example) interface to 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 learnstring. There are only a few instructions which 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 a semicolon (;) is used to separate the functions: ::; (For example :ANALOG1:COUPLING DC;BWLIMIT ON) Duplicate Mnemonics Identical function mnemonics can be used for more than one subsystem.
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 Program headers can be sent 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 variety of types of 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 are expected to 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 taken care of 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 HP-IB 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).
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 HP BASIC 5.0 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 HP-IB, 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 on unknown waveforms by setting up the vertical channel, time base, and trigger level of the instrument. The syntax for the autoscale function is: :AUTOSCALE 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.
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 150 CLEAR 707 OUTPUT 707;"*RST" OUTPUT 707;":TIMEBASE:RANGE 5E-4" OUTPUT 707;":TIMEBASE:DELAY 0" OUTPUT 707;":TIMEBASE:REFERENCE CENTER" OUTPUT 707;":ANALOG1:PROBE X10" OUTPUT 707;":ANALOG1:RANGE 1.6" OUTPUT 707;":ANALOG1: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 ANALOG1" 707;":WAVEFORM:FORMAT BYTE" 707;":ACQUIRE:COUNT 8" 707;":WAVEFORM:POINTS 500" 707;":DIGITIZE ANALOG1" 707;":WAVEFORM:DATA?" This setup places the instrument into
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 5.0, 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;":ANALOG1:RANGE?" ENTER 707;Rang PRINT Rang END After running this program, the controller displays: .
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.
3 Programming over HP-IB
Programming over HP-IB This section describes the HP-IB 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 HP-IB interface card you are using.
Programming over HP-IB 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 HP-IB Addressing Addressing By using the front-panel menus, you must place the instrument in the “Connect to Computer” mode. Use the Print/Utility menu key on the front panel to do this after you have installed the HP-IB interface on the rear panel of the oscilloscope. Use this menu to set the HP-IB address for the oscilloscope. • Each device on the HP-IB resides at a particular address, ranging from 0 to 30. • The active controller specifies which devices talk and which listen.
Programming over HP-IB Communicating Over the Bus Communicating Over the Bus Because HP-IB 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 HP-IB Lockout Lockout You can use the SYSTem:LOCK ON command to disable front-panel control while a program is running. By default, the instrument accepts and executes bus commands, and the front panel is entirely active. Restore Front-Panel Control Cycling power also restores front panel control. With HP-IB, the instrument is placed in the lockout mode by sending the local lockout command (LLO).
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. 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 preceeding 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 the following sections.
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 since 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 Extended Interface with Hardware Handshake 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 Configuring the Interface Configuring the Interface By using the front-panel controls, you must place the RS-232-C interface in either the printer mode or the controller mode. Use the printer mode when you want the instrument to talk directly to a printer over RS-232-C without the aid of a controller. Use the controller mode when the instrument will operate in conjunction with a controller over RS-232-C.
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 Communicating Over the RS-232-C Bus Data Bits Data bits are the number of bits sent and received per character that represent the binary code of that character. Information is stored in bytes (8 bits at a time) in the oscilloscope. Data can be sent and received just as it is stored, without the need to convert the data. Communicating Over the RS-232-C Bus Each RS-232-C interface card has its own interface select code.
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 HP 54645A/D Oscilloscopes 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 HP 54645A/D Oscilloscopes Programmer’s Reference, which is supplied as an online help file for Microsoft Windows. See the chapter "Installing and Using the Programmer’s Reference" for information on installing and using the help file.
Programming and Documentation Conventions Command Set Organization Table 5-1 Alphabetic Command Reference Command Subsystem Where Used Command Subsystem Where Used Command Subsystem Where Used ACTivity ADDRess ADVanced AER ALL ASTore AUToscale CHANnel HARDcopy TRIGger Root level TEST Root level Root level DSP DUTycycle SYSTem MEASure BLANk BWLimit BYTeorder Root level ANALog WAVeform EDGE EDGE1 EDGE2 *EMC ERASe ERRor *ESE *ESR TRIGger TRIGger:ADVanced TRIGger:ADVanced Common Root level SYSTem
Programming and Documentation Conventions Command Set Organization Command Subsystem Where Used Command Subsystem Where Used Command Subsystem Where Used PATTern2 PEAKs PERiod PHASe# PIXel *PMC PMODe POINts POINts POLarity POLarity POSition POSTfailure PREamble PREShoot# PRINt PROBe PWIDth# TRIGger:ADVanced FUNCtion MEASure MEASure DISPlay Common ANALog ACQuire WAVeform TRIGger:TV TRIGger:GLITch DISPlay MASK WAVeform MEASure Root level ANALog MEASure SOURce SOURce SOURce1 SOURce2 SOURce SOURce SOUR
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 5-7
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" In the first line of example 2, the “subsystem selector” is implied for the DELAY command in the compound command. The DELAY command must be in the same program message as the REFERENCE command, since the program message terminator places the parser back at the root of the command tree.
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 HP 54645A/D Oscilloscopes 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.
Programming and Documentation Conventions Program Examples Program Examples The program examples given for commands in the online HP 54645A/D Oscilloscopes Programmer’s Reference were written using the HP BASIC 5.0 programming language. The programs always assume the oscillscope 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.
5-14
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 Status Reporting Data Structures 6-6
Status Reporting Status Reporting Data Structures Figure 6-2 (Continued) Status Reporting Data Structures 6-7
Status Reporting Status Reporting Data Structures Figure 6-2 (Continued) Status Reporting Data Structures 6-8
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 when none of the register’s summary bits are enabled to generate an SRQ interrupt. 10 20 30 40 OUTPUT 707;":SYSTEM:HEADER OFF;*STB?" !Turn headers off ENTER 707;Result !Place result in a numeric variable PRINT Result !Print the result End The next program prints 112 and clears bit 6 (RQS) of the Status Byte Register.
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 make it possible for any of the Standard Event Status Register (SESR) bits to be able to generate a summary bit, first enable the 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 User Event Register (UER) User Event Register (UER) This register hosts the LCL bit (bit 0) from the Local Event Register. The other 15 bits are reserved. You can read and clear this register using the UER? query. This register is enabled with the UEE command. For example, if you want to enable the LCL bit, you send a mask value of 1 with the UEE command; otherwise, send a mask value of 0.
Status Reporting Limit Test Event Register (LTER) Limit Test Event Register (LTER) Bit 0 (COMP) of the Limit Test Event Register is set when the Limit Test completes. The Limit Test completion criteria are set by the LTESt:RUN command. Bit 1 (FAIL) of the Limit Test Event Register is set when the Limit Test fails. Failure criteria for the Limit Test are defined by the LTESt:FAIL command. The Limit Test Event Register is read and cleared with the LTER? query.
Status Reporting Mask Test Event Register (MTER) Mask Test Event Register (MTER) Bit 0 (COMP) of the Mask Test Event Register is set when the Mask Test completes. The Mask Test completion criteria are set by the MTESt:RUMode command. Bit 1 (FAIL) of the Mask Test Event Register is set when the Mask Test fails. This will occur whenever any sample is recorded within any polygon defined in the mask. The Mask Test Event Register is read and cleared with the MTER? query.
Status Reporting Histogram Event Register (HER) Histogram Event Register (HER) Bit 0 (COMP) of the Histogram Event Register is set when the Histogram completes. The Histogram completion criteria are set by the HISTogram:RUNTil command. The Histogram Event Register is read and cleared with the HER? query. When the COMP bit is set, it in turn sets the HIST bit (bit 9) of the Operation Status Register.
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-20
7 Installing and Using the Programmer’s Reference
Installing and Using the Programmer’s Reference The HP 54645A/D Oscilloscopes Programmer’s Reference is supplied as an online help file readable with the Microsoft Windows 3.1 help viewer. A second diskette contains the help file as an ASCII text file and sample programs for the HP 54645A/D Oscilloscopes. 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 help file requires Microsoft Windows 3.1 and MS-DOS 3.3 or greater running on an IBM-compatible PC. The file uses the Microsoft Windows help viewer, WINHELP.EXE. 1 Start your PC and start Microsoft Windows. 2 Insert the 3.5" floppy disk labeled “HP 54645A/D Oscilloscopes Programmer’s Reference/Example Programs for Windows 3.
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 anonymous ftp. You must have a connection to the Internet and have ftp software. 1 Log on to your Internet service. 2 Connect to host col.hp.com using anonymous ftp. A sample set of commands might be as follows: $ ftp col.hp.com Name: anonymous Password: myname@mycompany.
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 “HP 54645A/D Oscilloscopes Programmer’s Reference” program group in the Program Manager. The help file requires the program WINHELP.EXE for Microsoft Windows 3.1. 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 HP 54645A/D 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 HP-IB 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 HP 54645A/D 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.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :ASTore n/a n/a :AUToscale n/a n/a :BLANk
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :DISPlay:PIXel , , :DISPlay:PIXel? , ::= x coordinate of the pixel to be set; an integer (0 to 511) in NR1 format ::= y coordinate of the pixel to be set; an integer (0 to 303) in NR1 format ::= an integer in NR1 format: 0 for pixel off 1 for pixel with half-bright on 2 for pixel with full-bright on n/a :DISPlay:POSition? :
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :FUNCtion2:MOVE {LEFT) n/a n/a :FUNCtion:OFFSet :FUNCtion:OFFSet? ::= the value at center screen in NR3 format. The range of legal values is +-10 times the current sensitivity of the selected function.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns n/a *IDN? HEWLETT-PACKARD,, 0, X.X ::= the model number of the instrument ::= the software revision of the instrument n/a *LMC? ::= string list seperated by commas n/a *LRN? ::= a block of data in IEEE 488.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :MEASure:NWIDth [] :MEASure:NWIDth? [] ::= {ANALog1 | ANALog2 | DIGital0,...
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns n/a :MEASure:VDELta? ::= delta V value in volts in NR3 format :MEASure:VMAX [] :MEASure:VMAX? [] ::= {ANALog1 | ANALog2} ::= maximum voltage of the selected waveform in NR3 format :MEASure:VMIN [] :MEASure:VMIN? [] ::= {ANALog1 | ANALog2} ::= minimum voltage of the selected waveform in NR3 format :MEASure:VPP [
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns *SRE *SRE? ::= sum of all bits that are set, 0 to 255; an integer in NR1 format. ::= following values: Bit Weight Enables 7 128 OPER - Operation Status Register 6 64 Not Used 5 32 ESB - Event Status Bit 4 16 MAV - Message Available 3 8 Not used 2 4 MSG - Message 1 2 USR - User 0 1 TRG - Trigger n/a :STATus? {ON | OFF} ::= {ANALog1 | ANALog2 | DIGital0,...
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :SYSTem:LOCK :SYSTem:LOCK? ::= {ON | OFF} :SYSTem:SETup :SYSTem:SETup? ::= a maximum of 218 bytes of data in IEEE 488.2 # format. n/a :TER? ::= 0 or 1 n/a :TEST:ALL? ::= 16-bit integer in NR1 format :TIMebase:DELay :TIMebase:DELay? ::= time from trigger to display reference in seconds.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGGER:ADVanced:PATTern1 , :TRIGger:ADVanced:PATTern1? < value> ::= integer in NR1 format or ::= integer in NR1 format or ::= ::= "0xnnnnn" n ::= {0 | 1 | ...
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGger:GLITch:QUALifier {GREaterthan | LESSthan | RANGe} :TRIGger:GLITch:QUALifier? {GREaterthan | LESSthan | RANGe} :TRIGger:GLITch:RANGe , [suffix] :TRIGger:GLITch:RANGe? ::= number from 8 ns to 100 seconds in NR3 format ::= number from 8 ns to 100 seconds in NR3 format [suffix] ::= {s | ms (-3) | µs (-6) | ns (-9) | ps (-12)} :TRIGge
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :TRIGger:TV:TVMode :TRIGger:TV:TVMode? ::= {LINE | FIELD1 | FIELD2 | VERTical} {LINE | FIELD1 | FIELD2 | VERTical | ALLLINES | ALLFLDS} with the Option 005 Enhanced TV/Video Trigger :TRIGger:TV:VIR {ON | OFF} :TRIGger:TV:VIR? {ON | OFF} *TRG n/a n/a n/a *TST? ::= 0 or non-zero value; an integer in NR1 format 0 indicates the test passed. Non-zero indicates the test failed.
Programmer’s Quick Reference Commands and Queries Command Query Options and Query Returns :WAVeform:SOURce or :WAVeform:SOURce:FUNCtion :WAVeform:SOURce? ::= {ANALog1 | ANALog2 | POD1 | POD2} ::= {1 | 2} n/a :WAVeform:TYPE? ::= {NORMal | PEAK | AVERage} 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
Index A Address 707, 2–9 Addressing, 3–4 the instrument, 3–5 alpha argument, 5–10 Arguments, 1–5 Arm Event Register (ARM), 6–17 availability of measured data, 6–2 B BASIC, 1–3 Baud rate, 4–8 Bit Definitions in Status Reporting, 6–4 Block data, 1–5, 2–11 Block Diagram Status Reporting Overview, 6–3 C Cable RS-232-C, 4–3 carriage return, 5–8 Character data, 1–10 Character program data, 1–10 Clear To Send (CTS), 4–6 clearing error queue, 6–18 registers and queues, 6–19 to 6–20 Standard ESE Register, 6–12 TRG
Index programming conventions, 5–2 Protocol, 4–8 DTR (Data Terminal Ready), 4–8 XON/XOFF, 4–8 program commands, 1–12 program data, 1–10 queries, 2–12 subsystems, 1–12 N NL, 1–12, 5–6 Notation Conventions and Definitions, 5–12 Numeric data, 1–10 program data, 1–10 variables, 2–10 O online help file, 7–2 Operation Complete (OPC), 6–4 status, 6–2 Operation19 Status Register (OPR), 6–14 OPR (Operation Status Register), Output command, 1–4 OUTPUT statement, 1–3 Output11 queue, 6–19 Overlapped Commands, 5–11 6
© Copyright HewlettPackard Company 1996 All Rights Reserved. Microsoft is a registered trademark of Microsoft Corporation. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under the copyright laws. Document Warranty The information contained in this document is subject to change without notice.
Product Warranty This Hewlett-Packard product has a warranty against defects in material and workmanship for a period of three years from date of shipment. During the warranty period, Hewlett-Packard Company will, at its option, either repair or replace products that prove to be defective. For warranty service or repair, this product must be returned to a service facility designated by Hewlett-Packard.