beautypg.com

Examples, 6 examples – Tecfluid MX4B User Manual

Page 10

background image

10

6 EXAMPLES

NOTE: In all examples, where said CRC refers to “Cyclic redundancy check”, that is an
error detecting code sent at the end of each frame.

Example 1: Flow rate reading
Master requests the slave number 0x01 (MX4B converter) a flow rate.
Slave ID: 0x01
Function: 0x04 (Read input registers)
Initial address: 0x2000
Number of registers to read: 2

The slave responds after more than 3.5 characters, indicating its identification, the
requested function code, the number of data bytes to be sent, data and the CRC.

01

04

04

44

AB

6C

91 38

72

N. of bytes

Flow rate LSB

Flow rate MSB

01

03

30

00

00

02 CB 0B

The flow rate received is the floating point 32 bits data 0x44AB6C91 = 1371,31

Example 2: Totalizer reading
Master requests the slave number 0x01 (MX4B converter) the totalizer value.
Slave ID: 0x01
Function: 0x03 (Read holding registers)
Initial address: 0x3000
Number of registers to read: 2

01

04

20

00

00

02 7A 0B

Register address

N. of registers to read

Slave ID (MX4B)

Function

CRC

CRC

Slave ID (MX4B)

Function

Register address

N. of registers to read

Slave ID (MX4B)

CRC

Function

This manual is related to the following products: