You are on page 1of 4

MADINCOS STANDARD MODBUS-RTU COMMUNICATION PROTOCOL

1. Protocol: It is abided by standard MODBUS-RTU protocol.

2. Communication Method: Asynchronous communication.

3. Communication Function Code:

In MODBUS communication protocol, the function code can be 0 to 255. our meters just use some of the functional codes as
follows:
Function Code Description
03H(3) Read one or multi register, input or hold register
04H(4) Read one or multi register, input or hold register
06H(6) Write one register (hold register)
Note: Function code 03H &04H to read input or hold register has same principle as follows:

4. Command

1) Function Code 03H:

The Master’s send data format as follows:

Slave address Function The address of first register required to Total register numbers CRC checking code
Code be read required to be read
00H - FFH 03H Please see the parameter register 00H 01H High Low byte
address list in manual byte
The Slave responds data format:
Slave address Function Total Bytes numbers of Register data Register Data Value to CRC Checking
Code to be read be read Code
00H - FFH 03H 02H High Low High byte Low byte
byte byte

2) Function Code 04H:

The Master Send data format as follows:

Slave Function The address of first register Total register numbers CRC checking
address Code required to be read required to be read code
00H - FFH 04H Please see the parameter High Low High Low
codes list byte byte byte byte

The Slave responds data format:


Slave address Function Total Bytes numbers of registers Register Data Value to be CRC Checking Code
Code data to be read read….n
00H - FFH 04H High byte first High Low byte
00H to FFH(n)
then Low byte Byte

1
3)Function Code 06H:

The Master send data format as follows:

Slave Function The address of first register to Register Data Value CRC checking
address Code be written to be written code
00H - FFH 06H Please see the parameter High byte Low byte High Low
register address list byte byte

The Slave responds data format as follows:

Slave Function The address of first register Register Data Value CRC checking
address Code required to be read Required to be written code
00H - FFH 06H Please see the parameter High byte Low byte High Low
register address list byte byte

4)When communication is wrong,the Slave responds to master:(Please refer E.g.5)

Slave address Function Code Total register numbers required Register Data CRC Checking Code
to be read Value(remain)
00H - FFH The highest position of the 02H High Low High Low Byte
function code send by Byte Byte Byte
Master=1
Example:

E.g. 1:To read multi input registers for paperless recorder and multi channel indicator series.

a) It is assumed that the meter (Slave) address “Addr”=1, want to read the value from CH1 to CH3, So Master send command as
follows:
01 04 00 00 00 03 B0 0B

Slave Function The address of first register Total register numbers CRC checking
address Code required to be read required to be read code
01 04 00 00 00 03 B0 0B
CH1 register (hex.) Total 3 data/value read

b) Then, It is assumed that in above “e.g. 1” CH1value =40, CH2 value=159,CH3 value =295, so the meter responds to master as

follows:
01 04 06 00 28 00 9F 01 27 71 31
Slave Function Total Bytes numbers of register data to be Register Data Value to be CRC Checking Code
address Code read read….n
01 04 06 00 28 00 9F 01 27 71 31
Total 6 bytes for CH1,CH2, CH3 CH1 CH2 CH3

2
E.g. 2:To read multi input registers for paperless recorder and multi channel indicator series.

a) It is assumed that the meter (Slave) address “Addr”=1, want to read the value from CH2 to CH3, So Master command as
follows: 01 04 00 01 00 02 20 0B

Slave Function The address of first register Total register numbers CRC checking
address Code required to be read required to be read code
01 04 00 01 00 02 20 0B
CH2 hex. Register (hex.) Total 2 data/value read

b) It is assumed that in above “e.g. 2” CH2 value=159, CH3 value=259, the meter responds to master:01 04 04 00 9F 01 278 8A

20
Slave address Function Total Bytes numbers of register data Register Data Value to be CRC Checking Code
Code to be read read….n
01 04 04 00 9F 01 278 8A 20
Total 4 bytes for CH2,CH3 CH2 CH3
Note: Same principle for reading multi hold registers as above; please check the relative register address in Kehao offered
register address list.
E.g.3: (Read One Hold Register)
a) It is assumed that that the meter (Slave) addresses “Addr”=1, parameter “Type”=K (thermocouple),
Want to read parameter type value “K”, so master send command as follows:
01 04 03 E8 00 01 B1 BA

Slave Function The address of first register Total register numbers CRC checking
address Code required to be read required to be read code
01 04 03 E8 00 01 B1 BA
Parameter “Type”(hex.) one register “type” read

b) So the meter will response to Master as follows:


01 04 02 00 00 B9 30
Slave address Function Total Data Bytes numbers required Parameter Register CRC Checking Code
Code to be read Code….n
01 04 02 00 00 B9 30
Total 2 byte for 1 data /parameter Parameter “type” :K=0x0000
Note: Same principle for reading single input registers as above; please check the relative register address in Kehao
offered register address list.
E.g.4: (Write One Hold Register)
a) It is assumed that that the meter (Slave) addresses “Addr”=1, want to write parameter” type” , save it in salve, so master send
command as follows:
01 06 03 E8 00 00 09 BA

Slave Function The address of first register The address of setting CRC checking
address Code required to be written register value required to code
be written
01 06 03 E8 00 00 B1 BA
Parameter “Type” hex. Parameter “Type”=K, K
register code thermocouple register

3
E.g. 5: (Wrong communication)
It is assumed that there is wrong communication in above “E.g.1” a) part, so the meter response to Master:
01 83 02 xx xx xx xx

5. Overtime Handling
1. The interval time between sending and receiving the byte during the same communication process should not be more than
10ms.
2. The visiting frequency to the same communication address should not be more than 50HZ (more than 20ms).

You might also like