Syntax Conventions¶
The SCPI (Standard Commands for Programmable Instruments) is a universal ASCII-based textual remote programming language for electronic test and measurement (T&M) instruments. Based on the IEC 60488-2 specification, the remote transportation interface to the OXYGEN software is Ethernet based, as defined by the IEEE 802.3 working group, and the networking protocol is TCP.
Note: Check the reference manual of your DEWETRON measurement device for the availability and configuration options of the Ethernet interface.
The SCPI defines messages in the form of commands and queries to control the operation and functions for T&M instruments. The related topics below describe the syntax of these commands and queries, and the conventions that the OXYGEN software uses to process them. Commands modify settings and parameters of the OXYGEN software. Further, commands tell the OXYGEN software to perform a specific action. Queries cause the OXYGEN software to return data and status information.
Refer to the following table for the symbols used to describe the syntax of commands and queries.
Symbol |
Meaning |
---|---|
< > |
A defined element |
::= |
Is defined as |
| |
Exclusive OR |
{ } |
Option group; one element is required |
[ ] |
Optional; can be omitted |
… |
Previous elements can be repeated |
SCPI Message Structure¶
The SCPI messages may consist of five element types, defined in the following table.
Element |
Meaning |
---|---|
<Header> |
This element represents the basic command name. In case if the header ends with a question mark, the command is a query. The header may begin with a colon or asterisk character. A header consists of one or more <Mnemonic> elements, representing the system or subsystem of the command or query category. The only exception |
<Mnemonic> |
A part of the <Header>. Some commands have only one <Mnemonic> defined by their <Header>. Mnemonics can have a short and a long form. The syntax of the mnemonics in this document is to capitalize the short form while the long form finalizes the <Mnemonic> in lower case characters. |
<Parameter> |
This is a parameter used as input to the addressed command or query identified by the <Header>.Some commands have no parameters while others have multiple parameters. A <Space> separates parameters from the <Header>, while a <Comma> separates parameters from each other. |
<Comma> |
A single comma separates parameters of multiple-parameter commands. |
<Space> |
A white space character separates the <Header> from its <Parameter> list. |
Commands have the structure:
<Header>[<Space><Parameter>[<Comma><Parameter>]...]
Queries have the structure:
<Header>?[<Space><Parameter>[<Comma><Parameter>]...]
SCPI defines systems and subsystems as a grouping for mnemonics. For example, the mnemonics operating on the acquisition control are summarized within a group :ACQUISITION, containing the mnemonics START, STOP, PAUSE and STATE. Subsystems are additional groupings within a system or a subsystem. Some SCPI systems have no subsystem while others have many subsystems. Not all functions are grouped in systems or subsystems. Therefore, this document uses a logical grouping of function blocks.
A SCPI message can be composed of multiple commands and queries by separating them with a semicolon. The following rules apply when concatenating commands and queries:
- Separate completely different headers by a semicolon and by the beginning colon on all headers. For example, the command :ACQUISITION:START and the query :STORE:STATE?, can be concatenated into the following single message::ACQUISITION:START; :STORE:STATE?
- If concatenated headers differ by only the last mnemonics, you can abbreviate the subsequent headers and eliminate the beginning colon. For example, to concatenate the command :ACQUISITION:START and the query :ACQUISITION:STATE?, the following single message can be formed::ACQUISITION:START; STATE?
When concatenating multiple queries, a single response message is been generated by concatenating the responses to all queries.
The processing order of concatenated commands and queries is the order received.
An <EOM> message terminator must terminate each SCPI message. The OXYGEN software allows the usage of LF and CR LF characters as a valid message termination. The OXYGEN software evaluates only terminated messages.
Parameter And Response Types¶
Angle brackets, such as <num>, indicate parameters of commands. Angle brackets containing the parameter type indicate a response type of queries, such as <String>. There are several different types of parameters and response types defined by the SCPI and used by the RC_SCPI of the OXYGEN software, as listed in the following table:
Parameter Type |
Description |
Example |
---|---|---|
Arbitrary Block |
A block of ASCII raw data described by a simple header of the format: #[1-9][0-9]* The hashtag indicates the beginning of an arbitrary block header. The following digit indicates the number of subsequent digits specifying the length of the data in bytes. |
#14AHOI |
Arbitrary ASCII String |
An unquoted block of ASCII character terminated by a <CR> |
Lorem Ipsum |
String |
Quoted alphanumeric characters, by either a single or a double quote. |
“17E24 * 37E87 = BIG NUMBER” ‘Lorem Ipsum‘ |
Character |
Unquoted alphanumeric characters in the format [a-zA-Z][a-zA-Z0-9 |
Test123 |
Boolean |
Boolean numbers or values. The response type returns only boolean numbers 0 and 1. |
ON or ≠ 0 OFF or 0 |
Hexadecimal |
Hexadecimal coded integers of the form #Hxxxx |
#HFF |
Octal |
Octal coded integers of the form #Qxxxx |
#Q77 |
Binary |
Binary coded integers of the form #Bxxxx |
#B1101 |
NR1 |
Integers |
0, 1, 42, -37 |
NR2 |
Decimal numbers 3.432, |
-74.43 |
NR3 |
Decimal numbers in scientific notation |
1.55433E+6 |
NRf |
Flexible decimal numbers that may be of type NR1, NR2 or NR3 |
See NR1, NR2 and NR3 examples |
SCPI defines special numeric values as possible parameters for commands and queries. If mentioned in the specific command or query documentation, you can use the following special character values instead of the numeric values:
Special Charactere Value |
Description |
Numeric Value |
---|---|---|
NAN |
Not a Number, as defined in IEEE 754 for 32-bit floating point numbers |
9.91 E 37 |
INFinity NINFinity |
Infinity and negative infinity, as defined in IEEE 754 for 32-bit floating point numbers |
9.9 E 37 -9.9 E 37 |
MINimum MAXimum |
Denotes the minimum and maximum value of a range of numeric values |
For the range 20..100 MIN = 20 MAX = 100 |
DEFault |
The preset value which is set by the *RST command |
See NR1, NR2 and NR3 examples |