User`s manual

WE-2100T Series User’s Manual Serial Command Mode
13-2
Overview
In Serial Command Mode, the module’s parameters are retrieved or configured using specially
parsed commands that are sent through the serial port. Device manufacturers can take advantage of
Serial Command Mode to add local configuration capability to their products. For example, a card
readers number pad could be used to configure the card reader's IP address, netmask, and
baudrate. Using Serial Command Mode, a device can be configured on-site without requiring a
laptop or other additional equipment.
Serial Command Format
Each command and reply is a sequence of case-sensitive ASCII characters transmitted in the
following order: head, command code, OP code, parameter, and tail.
ATTENTION
The carriage return character is used as the last byte or tail for each data frame; an additional
line feed character is not required. For most systems, the ENTER key typically sends both a
carriage return character and a line feed character. Most terminal emulators refer to the carriage
return character as CR and to the line feed character as LF. In hex, CR is 0x0D and LF is 0x0A.
In C language, “\r” refers to CR, whereas “\n” refers to CR + LF.
Command Structure
Descriptor Bytes Character Description
Head 1 “>” fixed value (0x3E)
Command Code 1 “R”, “W”
R: get module parameter
W: set module parameter
OP Code 2 (varies)
Parameter varies (varies)
Tail 1 CR carriage return character, no line feed
For example, if you wanted to change the TCP server port number to 4001, you would send
">WTL4001" followed by CR (carriage return). Available OP codes and parameters are described
in detail later in this chapter.
Reply Structure
Descriptor Bytes Character Comments
Head 1 “<” <: fixed value (0x3C)
Reply Code 1
“Y”,
“1” to “5”,
“E’
Y: command was executed successfully
1: command not supported
2: OP code not supported
3: invalid command encapsulation
4: invalid parameter
5: invalid return value
E: enter Serial Command Mode
OP Code 2 (varies)
Parameter varies (varies)
Tail 1 CR carriage return character, no line feed