22
3. Command Syntax
Compatible
Standard
IEEE488.2
Partial compatibility
SCPI 1999
Partial compatibility
Command
Structure
SCPI commands follow a tree-like structure, organized into
nodes. Each level of the command tree is a node. Each
keyword in a SCPI command represents each node in the
command tree. Each keyword (node) of a SCPI command is
separated by a colon (:).
For example, the diagram below shows an SCPI sub-structure
and a command example.
DC
MEASure
SCALar
POWer
VOLTage
CURRent
DC
DC
:MEASure:SCALar:CURRent:DC?
Command types There are a number of different instrument commands and
queries. A command sends instructions or data to the unit and a
query receives data or status information from the unit.
Command types
Simple
A single command with/without a parameter
Example
*IDN?
Query
A query is a simple or compound command
followed by a question mark (?). A parameter (data)
is returned.
Example
:meas:curr:dc?
Compound Two or more commands on the same command
line.
Compound commands are separated with either a
semi-colon (;) or a semi-colon and a colon (;:).
A semi-colon is used to join two related commands,
with the caveat that the last command must begin
at the last node of the first command.
A semi-colon and colon are used to combine two
commands from different nodes.
Example
:meas:volt:dc?;:meas:curr:dc?
Command
Forms
Commands and queries have two different forms, long and
short. The command syntax is written with the short form of the
command in capitals and the remainder (long form) in lower
case.
The commands can be written in capitals or lower-case, just so
long as the short or long forms are complete. An incomplete
command will not be recognized.
Below are examples of correctly written commands.