Welcome Customer !

Membership

Help

Xi'an Dingjin Electronic Technology Co., Ltd
Custom manufacturer

Main Products:

ybzhan>Download Materials>RS485 communication Modbus RTU protocol
Download

Xi'an Dingjin Electronic Technology Co., Ltd

  • E-mail

    xadingjin@126.com

  • Phone

    13572257472

  • Address

    No. 77, Keji 2nd Road, Xi'an High tech Zone, Xi'an Optoelectronic Park

Contact Now
RS485 communication Modbus RTU protocol
Date: 2020-05-22Read: 11

This instrument communication protocol complies with the MODBUS-RTU communication protocol, with 1 start bit, 8 data bits, and 1 stop bit.

The following instruction definitions assume that the instrument parameters are: instrument address set to 1, communication baud rate 9600, invalid parity, one decimal place, unit MPa, and instrument display value 500.0 MPa. The addresses and data in read and write instructions are all high byte first and low byte last; CRC checks that low bytes come first and high bytes come last.

Read the pressure value

Command:01 03 00 04 00 01 C5 CB

Instruction Description:01 (Instrument Address) 03 (Read Command) 00 04(Instrument communication address) 00 01 (Read a parameter) 84 0A (CRC16 verification code)

Response:01 03 02 13 88 B5 12

Instruction Description:01 (Instrument Address) 03 (Read Command) 02 (Number of bytes read, 1 parameter is 2, 2 parameters are 4...) 13 88 (13 88 is a hexadecimal number 13 is a high byte 88 is a low byte converted to a decimal number exactly 5000) B5 12 (CRC16 checksum)

Zero drift adjustment

Command:01 0600 0500 0158 0B

Instruction Description:01 (instrument address) 06 (write command) 00 05 (instrument communication address) 00 01 (zero drift adjustment code) 58 0B (CRC16 verification code)

Response:01 0600 0500 0158 0B

Instruction Description:01 (instrument address) 06 (write command) 00 05 (instrument communication address) 00 01 (zero drift adjustment code) 58 0B (CRC16 verification code)

[Read parameter values]

Command:01 03 XX XX 00 01 CRC1 CRC2

Instruction Description:01 (instrument address) 03 (read command) XX XX (parameter address: see Table 2) 00 01 (read a parameter) CRC1 CRC2 (CRC16 checksum: low byte first, high byte last)

Response:01 03 02XX XX CRC1 CRC2

Instruction Description:01 (instrument address) 03 (read command) 02 (number of bytes read, 1 parameter is 2, 2 parameters are 4...) XX XX (returned parameter value: high bit first, low bit second) CRC1 CRC2 (CRC16 checksum: low byte first, high byte second)

Write parameter values

Command:01 06 XX XX data1 data2 CRC1 CRC2

Instruction Description:01 (instrument address) 03 (read command) XX XX (parameter address: see Table 2) data1 data2 (written parameters: high byte before, low byte after). See Table 2) CRC1 CRC2 (CRC16 checksum: low byte first, high byte second)

Response:01 06 XX XX data1 data2 CRC1 CRC2

Instruction Description:01 (instrument address) 03 (read command) XX XX (parameter address) data1 data2 (written parameters: high byte before, low byte after). See Table 2) CRC1 CRC2 (CRC16 checksum: low byte first, high byte second)

Table 2: Parameter addresses and data

parameter name

content

Address (Hex)

Data (data1, data2)

Addr

Delivery board address

00 00

1~255

baud

Transmission board baud rate

00 01

1-2400 2-4800 3-9600 4-19200

Unit

unit of measurement

00 02

0-m 1-kPa 2-MPa 3-℃ 4-L 5-bar 6-psi7 Pa

Dot

Number of decimal places in measurement data

00 03

Value range: 0-4

measured value

00 04

Zero

zero drift

00 05

Parity

check digit

00 06

0-None 1-Odd 2-Even

Loc

Password verification

00 0A

Password: 38 79

[Procedure for Writing Parameters]

①Password verification, the password is 38 79H, which means sending the command: 01 06 00 0A 38 79 7B EA

②Write the parameters that need to be modified, such as changing the address of the transmission board

At 2 o'clock, command: 01 06 00 00 02 08 0B

Note: When writing parameters, password authentication only needs to be done once. In the absence of power, other parameters can continue to be modified without the need for authentication again. After power failure, re authentication is required before changing parameters.

Note: 1. Return 2 bytes of pressure data, with the high byte before and the low byte after.

2. Return the pressure value as a signed hexadecimal number, with the highest digit being the sign bit.

3. Negative numbers are binary complement codes, with high bits being 1.