Rubidium™ MG362x1A SeriesLow-Noise RF/Microwave SignalGenerators : Programming with SCPI Commands : Introduction to SCPI Programming
Introduction to SCPI Programming
The Standard Commands for Programmable Instruments (SCPI) defines a set of standard programming commands for use by all SCPI compatible instruments. SCPI is intended to give the ATE user a consistent environment for program development. It does so by defining controller messages, instrument responses, and message formats for all SCPI compatible instruments. The set of SCPI commands implemented by the MG362x1A interfaces a comprehensive set of programming functions covering all the major functions of the MG362x1A signal generator.
SCPI Command Types
SCPI commands, which are also referred to as SCPI instructions, are messages to the instrument to perform specific tasks. The MG362x1A command set includes:
“Common” commands (IEE488.2 mandated commands)
SCPI required commands
SCPI optional commands (per SCPI 1993.0)
SCPI compliant commands that are unique to the MG362x1A
Common Commands
The required common commands are IEEE-488.2 mandated commands that are defined in IEEE-488.2 and must be implemented by all SCPI compatible instruments. These commands (Table: Common Commands) are identified by the asterisk (*) at the beginning of the command keyword. These commands are used to control instrument status registers, status reporting, synchronization, and other common functions. The common commands and their syntax are described in detail in Programming Commands.
Common Commands
Required and Optional SCPI Commands
The required SCPI commands are listed in Table: SCPI Required Commands. The optional SCPI commands and MG362x1A unique commands comprise the remainder (major portion) of the MG362x1A command set. They control the majority of the programmable functions of the MG362x1A. See Programming Commands.
SCPI Required Commands
Query Commands
All commands, unless specifically noted in the syntax descriptions in Programming Commands, have a query form. As defined in IEEE-488.2, a query is a command with a question mark symbol appended (examples: *ESR? and :FREQuency:CENTer?). When a query form of a command is received, the current setting associated with the command is placed in the output buffer.
Command Names
Typical SCPI commands consist of one or more keywords, parameters, and punctuation. SCPI command keywords can be a mixture of upper and lower case characters. Except for common commands, each keyword has a long and a short form. In this manual, the long form is presented with the short form in upper case and the remainder in lower case. For example, the long form of the command keyword to control the instrument display is: DISPlay.
The short form keyword is usually the first four characters of the long form For example: DISP is the short form of the command DISPlay. The exception to this is when the long form is longer than four characters and the fourth character is a vowel. In such cases, the vowel is dropped and the short form becomes the first three characters of the long form. Example: the short form of the keyword POWer is POW.
Some command keywords may have a numeric suffix to differentiate between multiple instrument features such as dual channel inputs. For example: keywords EXTernal1 and EXTernal2 (or EXT1 and EXT2).
As with any programming language, the exact command keywords and command syntax must be used. The syntax of the individual commands is described in detail in Programming Commands. Unrecognized versions of long form or short form commands, or improper syntax, will generate an error. Error reporting is described in Error Messages.
Hierarchical Command Structure
All SCPI commands, except the common commands, are organized in a hierarchical structure similar to the inverted tree file structure used in most computers. The SCPI standard refers to this structure as “the Command Tree.” The command keywords that correspond to the major instrument control functions are located at the top of the command tree. The command keywords for the MG362x1A SCPI command set are shown in Figure: SCPI Command Tree.
SCPI Command Tree
All MG362x1A SCPI commands, except the ABORt command, have one or more subcommands (keywords) associated with them to further define the instrument function to be controlled. The subcommand keywords may in turn also have one or more associated subcommands (keywords). Each subcommand level adds another layer to the command tree. The command keyword and its associated subcommand keywords form a portion of the command tree called a command subsystem.
Data Parameters
Data parameters, referred to simply as “parameters,” are the quantitative values used as arguments for the command keywords. The parameter type associated with a particular SCPI command is determined by the type of information required to control the particular instrument function. For example, Boolean (ON|OFF) type parameters are used with commands that control switch functions.
The command descriptions in Programming Commands specify the type of data parameter to be used with each command. The most commonly used parameter types are numeric, extended numeric, discrete, and Boolean.
Numeric parameters comprise integer numbers, or any number in decimal or scientific notation and may include polarity signs. This includes <NR1>, <NR2>, and <NR3> numeric data as defined in Parameter Notations. This type of numeric element is abbreviated as <NRf> throughout this document.
Extended Numeric
Extended numeric parameters include values such as MAXimum and MINimum.
Discrete parameters, such as INTernal and EXTernal, are used to control program settings to a predetermined finite value or condition.
Boolean parameters represent binary conditions and may be expressed as ON, OFF or 1, 0.
Unit Suffixes
Unit suffixes are not required for data parameters, provided the values are scaled for the global default units. The MG362x1A SCPI default units are: Hz (Hertz) for frequency related parameters and S (seconds) for time related parameters. For example, the command below sets the MG362x1A output frequency to 3 GHz.
:SOURce:FREQuency:CW 3000000000
The global default units may be changed via use of the :UNIT Subsystem commands.