Tel: 886.909 602 109 Email: [email protected]
100
4) Command tree
Most remote control programming tasks involve instrument-specific commands. When such a command is parsed, the
SCPI uses a structure similar to a file system. This command structure is called a 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*RST (reset) operation of the instrument, the current command path is
reset as the root.
5) Command parameter and response
Table 5.4 Types of SCPI Parameter and Response
Parameter Type
Response Data Type
Numeric
Real or Integer
Extended Numeric
Integer
Discrete
Discrete
Boolean
Numeric Boolean
String
String
Block
Definite Length Block
Indefinite Length Block
Non-decimal numeric
Hexadecimal
Octal
Binary
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, the frequency offset state command set for the microwave power meter is as follows:
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.