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).
For example, the query :TIMebase:RANGE? places the current time base
setting in the output queue. In HP BASIC, the controller input statement:
ENTER < device address > ;Range
passes the value across the bus to the controller and places it in the variable
Range.
Query commands are used to find out how the instrument is currently
configured. They are also used to get results of measurements made by the
instrument. For example, the command :MEASure:PERiod? instructs the
instrument to measure the period of the current measurement source
channel and places the result in the output queue.
The output queue must be read before the next program message is sent. For
example, when you send the query :MEASure:PERiod? you must follow that
query with an input statement. In HP BASIC, this is usually done with an
ENTER statement immediately followed by a variable name. This statement
reads the result of the query and places the result in a specified variable.
Read the Query Result First
Sending another command or query before reading the result of a query causes
the output buffer to be cleared and the current response to be lost. This also
generates a query interrupted error in the error queue.
Introduction to Programming
Query command
16
Summary of Contents for 54620A
Page 6: ...6 ...
Page 9: ...1 Introduction to Programming ...
Page 21: ...2 Programming Getting Started ...
Page 35: ...3 Programming over HP IB ...
Page 40: ...40 ...
Page 41: ...4 Programming over RS 232 C ...
Page 48: ...48 ...
Page 49: ...5 Programming and Documentation Conventions ...
Page 53: ...Programming and Documentation Conventions The command tree 53 ...
Page 60: ...60 ...
Page 61: ...6 Status Reporting ...
Page 63: ...Status Reporting Data Structures Figure 4 Status Reporting 63 ...
Page 68: ...68 ...
Page 69: ...7 Installing and Using the Programmer s Reference ...
Page 76: ...76 ...