Instructions
Each instruction (for both commands and queries) normally appears 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 <block data>. There are
only a few instructions that use block data. See the :WAVeform:DATA? query
for an example of a command that uses block data.
Instructions are composed of two main parts:
•
The header, which specifies the command or query to be sent.
•
The program data, which provides additional information needed to clarify
the meaning of the instruction.
Instruction Header
The instruction header represents the operation to be performed by the
instrument, and is one or more mnemonics separated by colons (:). The
command tree in chapter 5 illustrates how all the mnemonics can be joined
together to form a complete header (see chapter 5, “Programming and
Documentation Conventions”).
The example in figure 1 is a command. Queries are indicated by adding a
question mark (?) to the end of the header. Many instructions can be used as
either commands or queries, depending on whether or not you have included
the question mark. The command and query forms of an instruction usually
have different program data. Many queries do not use any program data.
White Space (Separator)
White space is used to separate the instruction header from the program
data. If the instruction does not require any program data parameters, you do
not need to include any white space. In this manual, white space is defined as
one or more spaces. ASCII defines a space to be character 32 (in decimal).
Program Data
Program data are used to clarify the meaning of the command or query. They
provide necessary information, such as whether a function should be on or
off, or which waveform is to be displayed. Each instruction’s syntax definition
shows the program data, as well as the values they accept. The “Program
Data Syntax Rules” topic in this chapter describes all of the general rules
about acceptable values.
Introduction to Programming
Program message syntax
13
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 ...