Remote Commands
Using Commands 6
6-7
Definition: Queries and Commands
Messages directed to the Product are commands and queries. Commands
instruct the Product to do something or to set a value, and no response is
expected. Queries generally ask only for information from the Product and a
response is always expected. Some queries also require the Product to take
action. For example, the *TST? query has the Product do a self test, then send
the result to the controller. A query always ends with a question mark. A
command never ends with a question mark. (In the alphabetical listing of
commands in this chapter, all commands and queries are mixed together and
called commands.)
All query responses are generated instantly on receipt of the query. Queries
generate their output when the Product executes the query rather than when the
controller attempts to read the response. The Product generates the requested
message and places it in an area of memory called the output buffer. When the
controller addresses the Product as a talker, the contents of the output buffer are
transmitted to the controller.
Some messages have both query and command forms (for example, *PUD and
*PUD?). In such cases, the command generally sets the value of a parameter
and the query generally returns the most recent value of the parameter. Some
messages are queries only (for example,*IDN?). Some messages are commands
only (for example, *RST).
Functional Elements of Commands
Table 6-3 lists the functional elements of commands described by the IEEE-
488.2 standard that are used by the Product. This table is for those who have a
copy of the standard and want to use it to pursue additional information. The
standard provides full definitions and syntax diagrams for each element.