Subsystem Command
Trees
The Command Tree Structure
Most programming tasks involve subsystem commands. SCPI uses
a hierarchical structure for subsystem commands similar to the le
systems on most computers. In SCPI, this command structure is
called a
command tree
.
Figure 1-25. A Simplified Command Tree
In the command tree shown in Figure 1-25, the command closest to
the top is the
root command
, or simply the
root
. Notice that you
must follow a particular
path
to reachlower level subcommands. For
example, if you wish to access the
GG
command, you must follow the
path
AA
to
BB
to
GG
.
Paths Through the Command Tree
To access commands in dierent paths in the command tree, you
must understand how an instrumentinterprets commands. A sp ecial
part of the instrument rmware, a
parser
, deco des each message sent
to the instrument. The parser breaks up the message into component
commands using a set of rules to determine the command tree path
used. The parser keeps track of the
current path
, the level in the
command tree where it expects to nd the next command you send.
This is imp ortant because the same keyword may appear in dierent
paths. The particular path you use determines how the keyword is
interpreted. The following rules are used by the parser:
Power On and Reset
After p ower is cycled or after *RST, the current path is set to the
ro ot.
Message Terminators
A message terminator, suchasa
<
new line
>
character, sets the
current path to the ro ot. Many programming languages have
output statements that send message terminators automatically.
The paragraph titled, \Details of Commands and Responses,"
discusses message terminators in more detail.
1-68 Getting Started Programming