40
S:\HP8924C\USRGUIDE\BOOK\chapters\getstart.fb
Chapter 1, Getting Started
HP-IB Command Guidelines
Using Question Marks to Query Setting or Measurement Fields
The question mark (?) is used to query (read-back) an instrument setting or
measurement value. To generate the query form of a command, place the question
mark immediately after the command. Queried information must be read into the
proper variable type within the program context before it can be displayed,
printed, or used as a numeric value in the program.
Queried information is returned in the same format used to set the value (a queried
numeric field returns numeric data; quoted string fields return quoted string
information).
For example, the following BASIC language program statements query the
current setting of the
AFGen 1 To field:
OUTPUT 714;”AFG1:DEST?”!Query the AFGen1 To field.
ENTER 714;Afg1_to$!Enter queried value into a string variable
Sample HP-IB Program
The following program was written on an HP 9000 Series 300 controller using
Hewlett-Packard Rocky Mountain BASIC (RMB). To run this program directly in
the Test Set’s IBASIC Controller:
1. use exclamation marks (!) to comment-out lines 440, 450, and 460 (these commands
not supported in IBASIC).
2. change line 70 to Bus = 8 (internal HP-IB select code = 8).