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
Содержание 54620A
Страница 6: ...6 ...
Страница 9: ...1 Introduction to Programming ...
Страница 21: ...2 Programming Getting Started ...
Страница 35: ...3 Programming over HP IB ...
Страница 40: ...40 ...
Страница 41: ...4 Programming over RS 232 C ...
Страница 48: ...48 ...
Страница 49: ...5 Programming and Documentation Conventions ...
Страница 53: ...Programming and Documentation Conventions The command tree 53 ...
Страница 60: ...60 ...
Страница 61: ...6 Status Reporting ...
Страница 63: ...Status Reporting Data Structures Figure 4 Status Reporting 63 ...
Страница 68: ...68 ...
Страница 69: ...7 Installing and Using the Programmer s Reference ...
Страница 76: ...76 ...
Страница 77: ...8 Programmer s Quick Reference ...