409
Header
ASCII CODE
DLE STX
0~FFH
L H DLE ETX
1
16
0
16
Station No.
HEX
Function
code
HEX
Data block
Terminator
ASCII Code
SUM Check
ASCII Code
DLE
ACK
0~FFH
L H DLE ETX
1
16
0
16
Error code
HEX
20H
D,SD,R,T,C
28H
21H
29H
D,SD,R,T,C
00H
+
07H
+
00H
+
20H
+ + + + + +
A0H 34H 12H 00H 05H 00H
=
112H
To
PLC
D
L
E
S
T
X
10H 02H 20H00H
D
L
E
E
T
X
10H 03H07H 00H A0H 34H 12H 00H 05H 00H 31H 32H
L H
〜
L H L H H L
B. Communication protocol data format
Number of
data Bytes
HEX
Header
ASCII CODE
Number of
data Bytes
HEX
Station No.
HEX
Data block
Terminator
ASCII Code
SUM Check
ASCII Code
The total number
of bytes
Sum up those HEX values and store at the last
2 digits by the ASCII codes
The communication command string is sent to the Slave PLC
The communication feedback string from the Slave PLC
Sum up those HEX values and store at the last
2 digits by the ASCII codes
The total number
of bytes
The characters of the header for command string sent to the Slave is DLE(10H) + STX(02H) by the ASCII
code; the header of feedback string from the Slave is DLE(10H) + ACK(06H) by the ASCII code.
Every Slave PLC at the same communication circuit must have an unique station number, the Slave will
respond to the command if its station number matches with the number in the command. Thus, the
Master (computer) can use the station number to make a command for the particular Slave PLC.
Station No.: The Slave's identication number.
Number of data Bytes: Counting the number of bytes from the function or error code to the end of the data block.
Function code: The Master PLC or computer commands the Slave PLC to do the appointed task.
Header: The starting characters of the data string to be transferred.
Command Function Code
Object of Device
Word Device Read
Word Device Write
Bit Device Read
Bit Device Write
the coil or contact of X, Y, M, SM, S, T and C
the coil or contact of X, Y, M, SM, S, T and C
Data block: The contents in the data block may include the head number of devices, the number of devices, the
content values of sending data and so forth.
Terminator: The last characters of the data string to be transferred.
The characters of the terminator for command string is DLE(10H) + ETX(03H) by the ASCII code.
SUM Check: Sum up the content values of HEX data from the beginning of station No. to the end of the data block.
Use the accumulated last two digits (by the HEX format) and convert that into two ASCII codes to be
the check code.
To operate the same code-checking procedures at both data sending and receiving ends can ensure
the data transmission is correct.
Sum up those HEX values and store at the last
2 digits by the ASCII codes
Station
No.
Number
of data
Bytes
Function
code
Device
code
Head number
of devices
Number
of
devices
SUM
Check