1.2. Command Syntax
Commands are in ASCII format and are NOT CASE SENSITIVE and therefore the command string can be sent either using uppercase or lowercase characters.
Each command is composed by one or more fields, the fields are separated by colons
:
.Each command has to be terminated with the CRLF (“Carrige return, line feed”) termination sequence
\r\n
.
Note
In this documentation the commands are represented only in uppercase.
To facilitate the reading, the termination sequence is not included in the code examples, but it is necessary to include it at the end of every command.
1.2.1. Read commands
The read commands have the following format:
command name
, followed by one or more optional sub-commands separated by colons:
;colon
:
char;question mark
?
;termination sequence CRLF
\r\n
.
The reply to a read command has the following format:
hastag
#
;command name echo
is the echo of the command that was sent, without the question mark;colon
:
char;read value
;termination sequence CRLF
\r\n
.
Example(s):
An example of a single level read command is:
MRI:?\r\n
#MRI:1.0658\r\n
An example of a multilevel read command is:
WAVE:N_PERIODS:?\r\n
#WAVE:N_PERIODS:10\r\n
1.2.2. Write commands
The write commands have the following format:
command name
(which could be followed either by one or more optional sub-commands separated by colons);colon
:
char;write value
;termination sequence
\r\n
.
The reply of the power supply to a write command can be:
#AK
(Acknowledged): when the command has been accepted;#NAK
(Not Acknowledged): when the command is NOT accepted, followed by the correspondingerror code
and theerror description
separated by a space character
Example(s):
An example of a write command when it is accepted:
LOOP:V\r\n
#AK\r\n
An example of a write command when it is NOT accepted:
MWI:2\r\n
#NAK:13 Module is off\r\n
Tip
By default the NAK (Not Acknowledged) reply returns also the error description. The error description can be disabled acting on the Error Code Description
field, which is enabled by default (see Internal Memory).
Note
iI the later sections the termination sequence will not be displayed for better readability, but it must be always present otherwise the commands are not parsed.
Before sending the next command, it is necessary to wait the response of the unit to the previous one.