Tel: 886.909 602 109 Email: [email protected]
182
4) Command tree
Most remote control programming tasks involve instrument-specific commands. When such a
command is parsed, the SCPI will use a structure similar to the file structure, and it is called as a
command tree, as shown in Fig.5.2:
Fig.5.2 Simplified Command Tree
The
top
command
is
root
command,
or
simply “root”.
In
the
case
of
command parsing, the command at the next layer is reached by following a specific route based
on the tree structure. For example: :POWer:ALC:SOURce
?
where, POWer stands for AA,: ALC
stands for BB, :SOURce stands for GG, and the whole command path is (:AA:BB:GG).
A software module in the instrument software—the command interpreter—is responsible for
parsing each received SCPI. The command interpreter breaks up the command into individual
command element using a series of rules for identifying the command tree path. After the current
command is parsed, the current command path remains unchanged. In this way, the subsequent
commands can be parsed more quickly and efficiently because the same command keyword may
appear in different paths. After the power-on or *RST (reset) operation of the instrument, the current
command path is reset as the root.
5) Command parameter and response
The SCPI defines different data formats in the use of the remote control and response messages
to conform to the principles of “flexible listening” and “accurate speaking”. For more information,
please refer to IEEE 488.2. “Flexible Listening” means that the formats of commands
and parameters are flexible.
For example, for the signal generator, the frequency offset state command is set as:
FREQuency:OFFSet:STATe ON|OFF|1|0,
The following command formats are used to set the frequency offset function as “On”:
:FREQuency:OFFSet:STATe ON
,
:FREQuency:OFFSet:STATe 1
,
:FREQ:OFFS:STAT ON
,
:FREQ:OFFS:STAT 1
Each parameter type corresponding to one or more response data types. In the case of query, a
numeric parameter will return a data type, and the response data is exact and strict, which is called
“Accurate Speaking”.
For example, if you query the power state (:POWer:ALC:STATe?), when it is turned on, the
response is always 1, regardless of whether you previously sent: POWer:ALC:STATe 1
or :POWer:ALC:STATe ON.