2.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 consists of one or more fields, the fields are separated by colons
:
Each command has to be terminated with the CRLF (“Carriage return, line feed”) termination sequence
\r\n
Note
In this documentation the commands are listed 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.
2.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:
hashtag
#
;command name echo is the echo of the command that was sent, without the question mark ;
colon char
:
;read value or read values separated by colon
:
;termination sequence CRLF
\r\n
.
Example(s):
An example of a single level read command is:
OUT:?\r\n
#OUT:ON\r\n
An example of a multi-level read command is:
GET:I:?\r\n
#GET:I:1.0658\r\n
2.2.2. Write Commands
The write commands have the following format:
command name, followed by one or more optional sub-commands separated by colons
:
;colon char
:
;write value or write values separated by colon
:
;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 corresponding error code and the error description separated by a space character.
Example(s):
An example of a write command when it is accepted:
LOOP:CV\r\n
#AK\r\n
An example of a write command when it is NOT accepted:
SET:I:2\r\n
#NAK:16 Module is not in ON\r\n
Tip
By default the NAK (Not Acknowledged) reply returns also the error description. The error description can be disabled by editing on the Error Code Description field (see Internal Memory).
Note
In the following sections the termination sequence will not be displayed for better readability, but it must be always present, otherwise the commands are not parsed.
Attention
Before sending the next command, it is necessary to wait the response of the unit to the previous one.