Subsystem Command
1-68 Getting Started Programming
The Command Tree Structure
Trees
Most programming tasks involve subsystem commands. SCPI uses
a hierarchical structure for subsystem commands similar to the file
systems on most computers. In SCPI, this command structure is
command tree.
called a
root
level 1
level
In the command tree shown in Figure l-25, the command closest to
the top is the
must follow a particular path to reach lower level subcommands. For
example, if you wish to access the GG command, you must follow the
path
AA
to
Paths Through the Command Tree
To access commands in different paths in the command tree, you
must understand how an instrument interprets commands. A special
part of the instrument firmware, a
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
command tree where it expects to find the next command you send.
This is important because the same keyword may appear in different
paths. The particular path you use determines how the keyword is
interpreted. The following rules are used by the parser:
After power is cycled or after *RST, the current path is set to the
root.
Message Terminators
n
A message terminator, such as a <new line> character, sets the
current path to the root. 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.
I
BB
2
EE FF GG
Figure l-25. A Simplified Command Tree
root command,
or simply the
BB
to GG.
I
c c
H H
root.
Notice that you
parser,
decodes each message sent
current path,
the level in the
JJ