7. MODBUS Communication Protocol

Read instantaneous flow rate, flow speed, RSSI, and signal quality:

0

1

2

3

4

5

6

7

Node ID

Funtion Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

04

00

00

00

07

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Response format:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

Node ID

Funtion Code

Data length

Integer part of flow rate

Integer part of flow rate

Fraction part of flow rate

Fraction part of flow rate

Integer part of flow speed

Integer part of flow speed

Fraction part of flow speed

Fraction part of flow speed

Upstream RSSI

Downstream RSSI

Reserved

Signal quality

Unit

Metric/Imperial

CRC

CRC

01~FF

04

0D

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

0

​Content

​Content

​Content

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Byte 00 : Node ID‌

Byte 01 : Function code‌

Byte 02 : Data length 10 bytes‌

Byte 03 ~ 04 : Integer part of totalized positive flow rate, Format: 16-bit signed integer‌

Byte 05 ~ 06 : Fraction part of totalized positive flow rate, Format: 16-bit signed integer, divide by 10000 before add to integer part‌

Byte 07 ~ 08 : Integer part of totalized positive flow speed, Format: 16-bit signed integer‌

Byte 09 ~ 10 : Fraction part of totalized positive flow speed, Format: 16-bit signed integer, divide by 10000 before add to integer part‌

Byte 11, 12 : 8-bit unsigned integer, value is between 0 and 100‌

Byte 14 : 8-bit unsigned integer, value is between 0 and 100‌

Byte 15 : 8-bit unsigned integer, convert this number from hexadecimal to decimal, the digit in tens represents the unit of numerator and the digit in ones represents the unit of denominator. The table below shows the corresponding unit for each number.‌

Byte 16 : 8-bit unsigned integer,value is 1 or 2. 1 stands for Metric, 2 stands for Imperial.

Numerator :

Number

Unit

1

Cubic meter (m³)

2

Liter (l)

3

USA gallon (gal)

4

Imperial Gallon (igl)

5

Million USA gallon (Mgl)

6

Cubic feet (cf)

7

USA liquid barrel (bal)

8

Oil barrel (ob)

Denominat :

Number

Unit

1

Second

2

Minute

3

Hour

4

Day

Read totalized positive (forward-direction) flow rate :

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

04

00

07

00

05

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Response format:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Node ID

Function Code

Data length

Integer part of totalized positive flow rate

Integer part of totalized positive flow rate

Integer part of totalized positive flow rate

Integer part of totalized positive flow rate

Fraction part of totalized positive flow rate

Fraction part of totalized positive flow rate

Fraction part of totalized positive flow rate

Fraction part of totalized positive flow rate

Reserved

Unit

CRC

CRC

01~FF

04

0A

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

0

​Content

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Byte 00 : Node ID‌

Byte 01 : Function code‌

Byte 02 : Data length 10 bytes‌

Byte 03 ~ 06 : 32-bits signed integer‌

Byte 07 ~ 10 : 32-bits signed integer, divide by 1000000 before add to integer part‌

Byte 12 : Value is between 1 and 8. The table below shows the corresponding unit for each number.

Number

Unit

1

Cubic meter (m³)

2

Liter (l)

3

USA gallon (gal)

4

Imperial Gallon (igl)

5

Million USA gallon (Mgl)

6

Cubic feet (cf)

7

USA liquid barrel (bal)

8

Oil barrel (ob)

Read totalized negative (reverse-direciton) flow rate:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

04

00

0C

00

05

16 Bit CRC Calculation results

16 Bit CRC Calculation results

​‌

Response format:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Node ID

Function Code

Data length

Integer part of totalized negative flow rate

Integer part of totalized negative flow rate

Integer part of totalized negative flow rate

Integer part of totalized negative flow rate

Fraction part of totalized negative flow rate

Fraction part of totalized negative flow rate

Fraction part of totalized negative flow rate

Fraction part of totalized negative flow rate

Reserved

Unit

CRC

CRC

01~FF

04

0A

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

0

​Content

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Byte 00 : Node ID‌

Byte 01 : Function code‌

Byte 02 : Data length 10 bytes‌

Byte 03 ~ 06 : 32-bits signed integer‌

Byte 07 ~ 10 : 32-bits signed integer, divide by 1000000 before add to integer part‌

Byte 12 : Value is between 1 and 8. The table below shows the corresponding unit for each number.

Number

Unit

1

Cubic meter (m³)

2

Liter (l)

3

USA gallon (gal)

4

Imperial Gallon (igl)

5

Million USA gallon (Mgl)

6

Cubic feet (cf)

7

USA liquid barrel (bal)

8

Oil barrel (ob)

Read totalized net flow rate:

0

1

2

3

4

5

6

7

Node ID

Funtion Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

04

00

11

00

05

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Response format:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Node ID

Function Code

Data length

Integer part of totalized net flow rate

Integer part of totalized net flow rate

Integer part of totalized net flow rate

Integer part of totalized net flow rate

Fraction part of totalized net flow rate

Fraction part of totalized net flow rate

Fraction part of totalized net flow rate

Fraction part of totalized net flow rate

Reserved

Unit

CRC

CRC

01~FF

04

0A

​Content

​Content

​Content

​Content

​Content

​Content

​Content

​Content

0

​Content

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Byte 00 : Node ID‌

Byte 01 : Function code‌

Byte 02 : Data length 10 bytes‌

Byte 03 ~ 06 : 32-bits signed integer‌

Byte 07 ~ 10 : 32-bits signed integer, divide by 1000000 before add to integer part‌

Byte 12 : Value is between 1 and 8. The table below shows the corresponding unit for each number.

Number

Unit

1

Cubic meter (m³)

2

Liter (l)

3

USA gallon (gal)

4

Imperial Gallon (igl)

5

Million USA gallon (Mgl)

6

Cubic feet (cf)

7

USA liquid barrel (bal)

8

Oil barrel (ob)

Clear all totalized flow rate:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

14

00

00

00

00

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Clear totalized net flow rate:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

15

00

00

00

00

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Clear totalized positive (forward-direction) flow rate:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

16

00

00

00

00

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Clear totalized negative (reverse-direction) flow rate:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

17

00

00

00

00

16 Bit CRC Calculation results

16 Bit CRC Calculation results

7.6 Read upstream and downstream PT1000 temperature, instantaneous flow and error bits: (available starting from fw 1.2.2)

Read upstream and downstream PT1000 temperature, instantaneous flow and error bits:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

04

00

16

00

05

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Response format:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Node ID

Function Code

Data length

Upstream temperature multiplied by 10, rounded to the nearest integer (format: 16-Bit signed integer multiplied by ten)

Upstream temperature multiplied by 10, rounded to the nearest integer (format: 16-Bit signed integer multiplied by ten)

Downstream temperature multiplied by 10, rounded to the nearest integer (Format: 16-Bit signed integer multiplied by ten)

Downstream temperature multiplied by 10, rounded to the nearest integer (Format: 16-Bit signed integer multiplied by ten)

Integer portion of the flow rate (format: 16-Bit signed integer)

Integer portion of the flow rate (format: 16-Bit signed integer)

Decimal portion of the flow rate (format: 16-Bit signed integer). It needs to be divided by 10000 before being added to the integer portion.

Decimal portion of the flow rate (format: 16-Bit signed integer). It needs to be divided by 10000 before being added to the integer portion.

Reserved

error code

CRC

CRC

01~FF

04

0A

00

00

00

00

00

00

00

00

00000000

16 Bit CRC Calculation results

16 Bit CRC Calculation results

Byte 00 : Node ID‌

Byte 01 : Function code‌

Byte 02 : Data length 8 bytes

Byte 03 ~ 04 : Upstream temperature multiplied by 10, rounded to the nearest integer (format: 16-Bit signed integer multiplied by ten)

Byte 05 ~ 06 : Downstream temperature multiplied by 10, rounded to the nearest integer (Format: 16-Bit signed integer multiplied by ten)

Byte 07 ~ 08 : Integer part of the flow rate, format: 16-Bit signed integer

Byte 09 ~ 10 : Decimal portion of the flow rate , format: 16-Bit signed integer, before adding it to the integer portion, divide it by 10000

Byte 12 : error code

7.6.1 Resetting Totalised Flow Data:

Clear All Totalised Flow Data:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

14

00

00

00

00

16 Bit CRC result

16 Bit CRC result

Clear Net Totalised Flow:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

15

00

00

00

00

16 Bit CRC result

16 Bit CRC result

Clear Forward Totalised Flow:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

16

00

00

00

00

16 Bit CRC result

16 Bit CRC result

Clear Reverse Totalised Flow:

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01~FF

17

00

00

00

00

16 Bit CRC result

16 Bit CRC result

7.7 Single Data Read Command (Updated in Firmware 1.2.6)

7.7.1 04 Single Data Read - Memory Register List

Addr
Name
Type
Length

0x00

Flow Integer Part

int16_t

1

0x01

Flow Fractional Part × 10,000

int16_t

1

0x02

Velocity Integer Part

int16_t

1

0x03

Velocity Fractional Part

int16_t

1

0x16

Upstream Temperature × 10

int16_t

1

0x17

Downstream Temperature × 10

int16_t

1

0x1B

Forward Totalised Flow × 100

int32_t

2

0x1D

Reverse Totalised Flow × 100

int32_t

2

0x1F

Net Totalised Flow × 100

int32_t

2

0x21

Heat Integer Part

int16_t

1

0x22

Heat Fractional Part × 10,000

int16_t

1

7.7.2 Read Command Example

A. Reading Big Endian Forward Totalised Flow Data

(TX) Example Transmission :

0

1

2

3

4

5

6

7

Node ID

Function Code

Address 1

Address 0

Data 1

Data 0

CRC

CRC

01

04

00

1B

00

02

16 Bit CRC result

16 Bit CRC result

Node ID Byte 01 : Node identifier 01

Function code Byte 01 : Function code 04

Addr Byte 02~03 : 00 1B (Memory address corresponding to forward totalised flow).

Length Byte 05 ~ 06 : 00 02 (corresponding to 2 registers for forward totalised flow ×100).

CRC: (Error-checking code).

(RX) Example Response :

0

1

2

3

4

5

6

7

8

Node ID

Function Code

Data length

Forward Totalised Flow × 100:32-Bit signed

Forward Totalised Flow × 100:32-Bit signed

Forward Totalised Flow × 100:32-Bit signed

Forward Totalised Flow × 100:32-Bit signed

CRC

CRC

01

04

04

00

12

D6

87

16 Bit CRC result

16 Bit CRC result

Node ID Byte 00 : Node identifier 01

Function code Byte 01 : Function code 04

Length Byte 02 : 00 04 Data length in 4 bytes

Data Byte 03 ~ 06 : 00 12 D6 87 Forward totalised flow ×100 in big endian format (32-bit signed integer).

CRC: (Error-checking code).

B. Reading Flow Integer Part TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Flow Integer Part

0x01

0x04

0x00

0x00

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Flow Integer Part

1234.5

0x01

0x04

0x02

0x04

0xD2

-1234.5

0x01

0x04

0x02

0xFB

0x2E

C. Reading Flow Fractional Part *10000 TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Flow Fractional Part *10000

0x01

0x04

0x00

0x01

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Flow Fractional Part *10000

1234.5

0x01

0x04

0x02

0x13

0x88

-1234.5

0x01

0x04

0x02

0xEC

0x78

D. Reading Velocity Integer Part TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Velocity Integer Part

0x01

0x04

0x00

0x02

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Velocity Integer Part

12.34

0x01

0x04

0x02

0x00

0x0C

-12.34

0x01

0x04

0x02

0xFF

0xF4

E. Reading Velocity Fractional Part*100000 TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Velocity Fractional Part*100000

0x01

0x04

0x00

0x03

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Velocity Fractional Part*100000

12.34

0x01

0x04

0x02

0x0D

0x48

-12.34

0x01

0x04

0x02

0xF2

0xB8

F. Reading Upstream Temperature*10 TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Upstream Temperature*10

0x01

0x01

0x04

0x16

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Upstream Temperature*10

10.9

0x01

0x04

0x02

0x00

0x6D

G. Reading Downstream Temperature*10 TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Downstream Temperature*10

0x01

0x04

0x00

0x17

0x00

0x01

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Downstream Temperature*10

0.2

0x01

0x04

0x02

0x00

0x02

H. Reading Forward Totalised Flow TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Forward Totalised Flow*100

0x01

0x04

0x00

0x1B

0x00

0x02

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
DATA
DATA
CRC
CRC

Forward Totalised Flow*100

12345.67

0x01

0x04

0x04

0x00

0x12

0xD6

0x87

I. Reading Reverse Totalised Flow TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Reverse Totalised Flow*100

0x01

0x04

0x00

0x1D

0x00

0x02

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
DATA
DATA
CRC
CRC

Reverse Totalised Flow*100

-76543.21

0x01

0x04

0x04

0xFF

0x8B

0x34

0x4F

J. Reading Net Totalised Flow TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Net Totalised Flow*100

0x01

0x04

0x00

0x1F

0x00

0x02

RX Example(big endian)
Parameter
ID
FUNC
LEN
DATA
DATA
DATA
DATA
CRC
CRC

Net Totalised Flow*100

12345.67

0x01

0x04

0x04

0x00

0x12

0xD6

0x87

-12345.67

0x01

0x04

0x04

0xFF

0xED

0x29

0x79

K. Reading Heat Integer Part TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Heat Integer Part

0x01

0x04

0x00

0x21

0x00

0x01

RX Example(big endian)
Parameter
Return Value
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Heat Integer Part

123.4567

123

0x01

0x04

0x02

0x00

0x7B

-123.4567

-123

0x01

0x04

0x02

0xFF

0x85

L. Reading Heat Fractional Part*10000 TX / RX Example

TX Example
ID
FUNC
ADDR
ADDR
LEN
LEN
CRC
CRC

Heat Fractional Part*10000

0x01

0x04

0x00

0x22

0x00

0x01

RX Example(big endian)
Parameter
Return Value
ID
FUNC
LEN
DATA
DATA
CRC
CRC

Heat Fractional Part*10000

123.4567

4567

0x01

0x04

0x02

0x11

0xD7

-123.4567

-4567

0x01

0x04

0x02

0xEE

0x29

Last updated