Modbus water meter communication protocol
Introduction of RS485 module
Four wires: RS485 needs four wires, of which the second wire is rs485a, rs485b, the second wire is positive and negative 12V power line, the pulse signal line is not divided into positive and negative poles, and the 485 communication line is connected. Red (12V positive), blue (12V negative), yellow (485a), green (485b). Note: wiring must be done carefully! An error will result in damage to the instrument module.
The module integrates the pulse counting module, and outputs the accumulated pulse in RS485 or MBus mode, generally using RS485 Modbus communication protocol or 188 protocol.
When the communication line is long, the cross-sectional area of the communication wire should be increased, the communication line should avoid high-power electrical equipment and strong interference sources, and do a good job in waterproof protection.
Communication settings
1. Baud rate: 9600 / 4800 / 1200 (default 9600 cannot be changed)
2. Check: no check (default no check)
3. Data bit: 8
4. Stop bit: 1
Modbus Protocol
1. Read operation (03h)
Function code |
First register high bit address |
First register low address |
The high order of the number of registers |
The low order of the number of registers |
CRC check low bit |
||
XX |
03 |
XX |
XX |
XX |
XX |
XX |
XX |
2. Read operation reply(03H)
Address |
Function code |
Number of bytes |
Data high byte |
…….. |
Data low byte |
CRC check low bit |
CRC check high bit |
03 |
XX |
XX |
…….. |
XX |
XX |
XX |
3. Write operation (06h)
Function code |
First register high bit address |
First register low address |
Data high byte |
Data low byte |
CRC check low bit |
CRC check high bit |
|
XX |
06 |
XX |
XX |
…… |
XX |
XX |
XX |
4. Write operation reply(06H)
Address |
Function code |
First register high bit address |
First register low address |
Data high byte |
Data low byte |
CRC check low bit |
CRC check high bit |
06 |
XX |
XX |
…… |
XX |
XX |
XX |
5. Write operation (10h)
Address |
Function code |
First register high bit address |
First register low address |
The high order of the number of registers |
The low order of the number of registers |
Number of bytes |
Data high byte |
…… |
Data low byte |
CRC check low bit |
CRC check high bit |
XX |
10 |
XX |
XX |
XX |
XX |
XX |
XX |
…… |
XX |
XX |
XX |
6. Write operation reply (10h)
Address |
Function code |
First register high bit address |
First register low address |
The high order of the number of registers |
The low order of the number of registers |
CRC check low bit |
CRC check high bit |
XX |
10 |
XX |
XX |
XX |
XX |
XX |
XX |
Address |
Function code |
Exception code |
CRC check low bit |
CRC check high bit |
XX |
XX
|
01h illegal function 02h illegal data address 03h illegal data value
|
XX |
XX |
8. Register address
Register address |
Number of bytes |
operation |
remarks |
|
0200H |
2 |
Read / write |
Not recommended |
|
Cumulative flow |
0202H |
4 |
Read / write |
|
Be careful:
The exception code is the highest bit plus 1 of the normal function code. For example, the exception code of the read operation 03h is 83h, the exception code of the write single word 06h is 86h, and the exception code of the write multiple word 10h is 90h.
The cumulative flow is a 4-byte hexadecimal number, with the high bit first and the low bit last. The cumulative flow uses 32-bit data (2 words) without sign.
For example, if the actual data is 123456, the high bit word is saved as 0x0001, and the low bit word is saved as 0xe240.
Unit of measurement: according to the ratio you write, this meter does not participate in the calculation, only records the actual pulse value.
For example:
Suppose the table address is 01 (table address range 1-247)
1. Write the base number of water meter 123456 (hexadecimal: 01e240h)
01 10 02 00 02 00 01 E2 40 73 86 13 bytes
Write the base number of water meter to return: 01 10 02 00 02 E1 B0 8 bytes
Exception: 01 90 03 0C 01 5 bytes (illegal data value)
2. Water meter reading: 01 03 02 00 02 64 73 8 bytes
Read Cumulative Return: 01 03 04 00 01 E2 40 E2 A3 9 bytes
Exception: 01 83 03 01 31 5 bytes
3. Reading water meter address: 00 03 02 00 01 84 63 8 bytes
Return: 01 03 02 00 01 79 84 7 bytes
be careful! When reading the water meter address, only one water meter can be connected to the bus.
|
Contact:James Fang
Phone: +8619941400445
Email:meter@meterchina.top
Add:Jiangdong Street, Yiwu, Jinhua, Zhejiang, China