0% found this document useful (0 votes)
247 views5 pages

BRUTER BRT38-ROM Encoder RS485 Protocol

The document describes the RS485 communication protocol used by an encoder. It uses the MODBUS-RTU protocol with configurable baud rates, data bits, parity and stop bits. It supports functions like reading/writing registers. Register addresses are defined for the slave address, baud rate, check bit, encoder value, identification code and accuracy. Error codes are also defined for exception responses.

Uploaded by

Anandhs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
247 views5 pages

BRUTER BRT38-ROM Encoder RS485 Protocol

The document describes the RS485 communication protocol used by an encoder. It uses the MODBUS-RTU protocol with configurable baud rates, data bits, parity and stop bits. It supports functions like reading/writing registers. Register addresses are defined for the slave address, baud rate, check bit, encoder value, identification code and accuracy. Error codes are also defined for exception responses.

Uploaded by

Anandhs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Encoder RS485 protocol (standard MODBUS-RTU)

Communication protocol details:


The encoder uses MODBUS-RTU (GB/T19582-2008) communication protocol to communicate, supports one master
station to control multiple slave stations, and can configure 127 slave station addresses through its own host
computer. The master station can be a single-chip microcomputer. PLC or PC, etc.

1.1 Communication parameters


The default configuration of the serial port at the factory, the baud rate defaults to 9600bps, data bit 8, no parity,
stop bit 1; the baud rate configurable range is 9600~115200bps, the data bit is fixed to 8 bits, and the check mode
can be configured as odd. Check, even parity or no parity. When it is odd or even parity, the stop bit is 1 bit, and
when there is no parity, the stop bit is 2.
Each character uses 11 bits (1 start bit, 8 data bits, 1 check bit 1 stop bit or no check bit 2 stop bit); when the baud
rate is 19200 bps and below, the character timeout period is 1.5 Character interval; when the time is above
19200bps, the timeout period is 0.75ms; when a character timeout occurs, the previously received data will be
considered invalid.

1.2 MODBUS-RTU frame format


This driver supports MODBUS 0x03 (read holding register), 0x06 (write single register), 0x10 (write multiple registers)
function code.

1.2.1 0x03 read holding register

The main station sends:

Byte 1 2 3 4 5 6 7 8
Start register Start Register Register
ADR 0x03
Content high byte register Number Number CRC High byte CRC low byte
low byte high byte low byte

1st byte ADR: Slave address code (1~127) 2nd byte 0x03 : Read register value function code
3rd, 4th byte: Register start address to be read
5th, 6th byte: number of registers to read
7th, 8th byte: CRC16 checksum from byte 1 to 6

Send back from the station:

Byte 1 2 3 4、5 6、7 … M-1、M M+1 M+2


ADR 0x03 Total Register Register … Register
Content Number data 1 data 2 data M CRC High byte CRC low byte
of bytes

1st byte ADR: Slave address code (2~127) 2nd byte 0x03 : Return read function code
3rd byte: Total number of bytes from 4 to M (including 4 and M)
4th to Mth bytes: Register data
M+1, M+2 bytes: CRC16 checksum from byte 1 to M
When the slave receives an error, the slave sends back:

Byte 1 2 3 4 5
Content Abnormal code CRC High byte CRC low byte
ADR 0x83

1st byte ADR: Slave address code (1~127)


2nd byte 0x83 : Error reading register value
3rd byte exception code: see section 1.2.4
4th, 5th byte: CRC16 checksum from byte 1 to 3

1.2.2 0x06 write a single register

The main station sends:

Byte 1 2 3 4 5 6 7 8
Register Register Register Register
ADR 0x06
Content high byte low byte Number Number CRC High byte CRC low byte
high byte low byte

When the slave receives correctly, the slave sends back:

Byte 1 2 3 4 5 6 7 8
Register high Register Register Register
ADR 0x06
Content byte low byte Number Number CRC High byte CRC low byte
high byte low byte

When the slave receives error, the slave sends back:

Byte 1 2 3 4 5
Abnormal code CRC High byte CRC low byte
ADR 0x83
Content
1st byte ADR: Slave address code (1~127)
2nd byte 0x86: Write register value error function code
3rd byte exception code: see section 1.2.4
4th, 5th byte: CRC16 checksum from byte 1 to 3
1.2.3 0x10 Write Multiple Registers

The main station sends:

Byte 1 2 3 4 5 6 7 8
Start Start Register Register
ADR 0x10
Content register register low Number Number CRC CRC low byte
high byte byte high byte low byte High byte

Byte 8 9 10 11 N、 N+1 N+2 N+3


Content Register Register Register CRC High CRC
data 1 data 2 data M byte low byte

When the slave receives correctly, the slave sends back:

Byte 1 2 3 4 5 6 7 8
Register high Register Register Register
ADR 0x10
Content byte low byte Number Number CRC High byte CRC low byte
high byte low byte

When the slave receives error, the slave sends back:

Byte 1 2 3 4 5
Abnormal code CRC High byte CRC low byte
ADR 0x83
Content

1st byte ADR: Slave address code (1~127)


2nd byte 0x90: Error writing register value
3rd byte exception code: see section 1.2.4
4th, 5th byte: CRC16 checksum from byte 1 to 3

1.2.4 Error Abnormal Code

1, MODBUS error Abnormal code:

Abnormal Code Meaning

0x01 Illegal function code

0x02 Illegal data address

0x03 Illegal data value

0x04 Slave device failure


The request has been confirmed, but it takes a long time to process the request
0x05
Busy from the device
0x06
Storage parity error
0x08
Unavailable gateway
0x0A
Gateway target device response failed
0x0B

1.3 Register Definition

1.3.1 Serial Information Register

Register address Description Ranges Support function code Remarks

0x0002 Address 1~127 0x03、0x10 Contact address

Baud rate four-byte 300~115200 0x03、0x10


Baud rate of
0x0003 Integer

high halfword serial communication

Baud rate four-byte


integer low halfword
0x0004

0x01 No check

0x0005 Check Bit 0x01~0x03 0x03、0x10 0x02 Odd parity

0x03 Even parity

1.3.2 Encoder Value Information Register

Register Description Ranges Support function code Remarks


address
0x0000 Encoder According to the 0x03 Real-time value
value properties of the of the encoder
encoder: no more than
65535

1.3.3 Unique Identification Code Register

Register Description Ranges Support function code Remarks


address
Unique 0x03 Written at the factory and
0x0006~0x
identification cannot be modified.
000B
code of
the product
1.3.4 Encoder accuracy

Register Description Ranges Support function code Remarks


address
0x000C Encoder 10、12、14、15 0x03 Real-time value
accuracy of the encoder

1.3.5 Zeroing Mark Bit

Register Description Ranges Support function code Remarks


address
0x000D Encoder reset 0x01 0x06 When this bit is written
Zero mark bit 0x01, the encoder is zero
at the current position.

1.4 Encoder Communication Example

1.4.1 Reading Encoder Values


Tx: 01 03 00 00 00 01 (84 0A)
Rx: 01 03 02 01 42 (39 E5)
Note: The CRC check digit is in parentheses, and the encoder return data is 01 42 (decimal: 322)

1.4.2 Setting the Encoder Address


Tx: 01 06 00 02 00 02 (A9 CB)
Rx: 01 06 00 02 00 02 (A9 CB)
Note: The CRC check digit is in parentheses, and the setting address is 02 (HEX: 0x0002)

1.4.3 Setting the encoder baud rate


Tx:01 10 00 03 00 02 04 00 01 C2 00 (B3 1A)
Rx: 01 10 00 03 00 02 (C8 B1)
Note: The CRC check digit is in parentheses and the baud rate is set to 115200 (HEX: 0x0001C200)

1.4.4 Setting the encoder zero


Tx: 01 06 00 0D 00 01 (D9 C9)
Rx: 01 06 00 0D 00 01 (D9 C9)
Note: The CRC check digit is set in parentheses, and the current encoder current point is set as the origin.

You might also like