Appendix 一
Encoder RS485 TCP
(
Standard MODBUS-RTU
)
This encoder uses MODBUS-RTU (National Standard GB/T19582-2008) TCP for
communication, supports one master station to control multiple slave stations, and 127
slave station addresses can be configured through the built-in host computer. The
master station can be a single-chip computer, PLC or PC, etc.
1.1
Communication parameters
The default configuration of the serial port at the factory, the baud rate is 9600bps
by default, the data bit is 8, no parity, and the stop bit is 1. The baud rate can be
configured in the range of 9600~115200bps, and the encoder default communication
address (station number) is 1.
1.2 MODBUS-RTU Frame format
This encoder supports 0x03 (read holding register), 0x06 (write a single register)
function codes of MODBUS
。
1.2.1 0x03 Read holding register
Host send
:
Byte
1
2
3
4
5
6
7
8
Content
ADR
0x03
Start
register
high
byte
Start
register
low
byte
High
byte of
register
number
Low
byte of
register
number
CRC
High
byte
CRC
low
byte
The 1
st
byte ADR
:
Slave address code
(
1
~
127
)
The 2
nd
byte 0x03
:
Read register value function code
The 3
rd
.
、
4
th
. byte
:
Start address of the register to be read
The 5
th
.
、
6
th
. byte
:
Number of registers to be read
The 7
th
.
、
8
th
. byte
:
CRC16 checksum from byte 1 to 6
Return from station
:
Byte
1
2
3
4
、
5
6
、
7
M-1
、
M
M+1
M+2
Content
ADR
0x03
Total
byte
Register
data 1
Register
data 2
…..
Register
data M
CRC
High
byte
CRC
Low
byte
The 1
st
byte ADR
:
Slave address code
(
1
~
127
)
The 2
nd
byte 0x03
:
Return to read function code
The 3
rd
byte
:
The total number of bytes from 4 to M
(including 4 and M)
The 4
th
. ~ M byte
:
Register data