1718021954-MPM47XX MODBUS Protocol V1.2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MODBUS Protocol version 1.

2
(MPM47xx series and MPM462)
COM Port setting:
8 Data bits, 1 Stop bit, no Parity

Function Code
Function code Description Length
0x03 Read register 1 byte
0x06 Write single register 1 byte
0x10 Write multiple registers 1 byte

General information
Register address 2 bytes
Register size 2 bytes
Floating 2 registers with 4 bytes, LSB (first register) MSB (second register)
Short 1 register with 2 bytes
CRC 2 bytes, MSB LSB (little endian)

MODBUS Protocol Format


Read register – 0x03
Command format
Slave Function Starting register Quantity of
CRC
address code address Registers
1 byte 1 byte 2 byte 2 byte 2 byte
XX 03 XXXX XXXX XXXX

Response format
Slave Function No. of return
Register value CRC
address code bytes
1 byte 1 byte 1 byte N byte 2 byte
XX 03 XX XX…XX XXXX
N = No. of return bytes

Example: Reading the pressure/level value of transmitter with address 01

Command: 0103002400028400

Response: 010304F5C340480835

A 4-byte float represents a single-precision floating-point number following the IEEE-754 standard and is returned by two registers. The returned value of
above is 0x4048F5C3, equivalent to 3.14 in decimal point.

Additionally, it utilizes 16-bit CRC verification, with the least significant byte positioned at the beginning and the most significant byte located at the end.

Write single register - 0x06


Command format
Slave Function Register starting
Value to write CRC
address code address
1 byte 1 byte 2 byte 2 byte 2 byte
XX 06 XXXX XXXX XXXX

Response format
Slave Function Register starting
Register value CRC
address code address
1 byte 1 byte 2 byte 2 byte 2 byte
XX 06 XXXX XXXX XXXX
Example: Set device address from 01 to 03

Command: 010600010003980B

Response: 010600010003980B

Write multiple registers - 0x10


Command format
Slave Function Register starting Quantity of
Byte Count Register value CRC
address code address Registers
1 byte 1 byte 2 byte 2 byte 1 byte N*2 byte 2 byte
XX 10 XXXX XXXX XX XX…XX XXXX
N= number of registers

Response format
Slave Function Register starting Quantity of
CRC
address code address Registers
1 byte 1 byte 2 byte 2 byte 2 byte
XX 10 XXXX XXXX XXXX

Example: Set low pressure point (output as 4mA) as 1

Command: 0110001400020400003f80E300

Response: 01100014000201CC

1= 0x3f800000, 4byte.

Error response – 0x83


Error
Slave
function Exception code CRC
address
code
1 byte 1 byte 1 byte 2 byte
XX 83 XX XXXX

Exception code

03: Abnormal reading, invalid data length

04: CRC error

Save setting command


The "Save setting" command is necessary to apply and preserve all changes; otherwise, the transmitter will revert to its original settings after a power cycle.

Device
0x10 0x01 0x88 0x00 0x02 0x04 CRC1 CRC2
Address

Example: Save settings of device address 1

Command: 011001880002041F93

Response: 011001880002C01E

Factory reset command

The factory reset command will restore all settings to their factory default values.

Device
0x10 0x04 0x88 0x00 0x02 0x04 CRC1 CRC2
Address

Example: Factory reset for device address 1

Command: 01100488000204D393

Response: 011004880002C0D2
Command sets

Register starting Quantity of


Function Data type Description
address (Hex) Registers

0x00 Reserved 1 Short

Address range: 0x01-0x99


0x01 Address 1 Short (Hex) The 0x00 serves as the broadcast address, it is not
recommended to avoid conflicts.
0x00 – 1200
0x01 – 2400
0x02 Baud rate 1 Short (Hex)
0x02 – 4800
0x03 – 9600 (Default)
0x00 - kPa
0x01 - Mpa
0x02 - mH2O
0x03 - Bar
0x04 - Psi
0x05 - mBar
0x06 - kgf/cm2
0x07 - cmHg
0x08 - atm
0x03 Unit 1 Short (Hex)
0x09 - Pa
0x0A - inH2O
0x0B – inHg

When the unit has changed, the digital and analog of


zero and full scale output will be scaled to accordingly
value.
E.g. If bar  mH2O for a 0-1bar range, both analog
and digital full scale output become 10mH2O.
For factory calibration purposes, adjustments are not
0x0A Analog zero trimming 1 Short
recommended.
For factory calibration purposes, adjustments are not
0x0B Analog full scale trimming 1 Short
recommended.
0x10 Digital output zero point 2 Float (IEEE754) Digital zero point output

0x12 Digital output full scale point 2 Float (IEEE754) Digital full scale point output

0x14 Low pressure value at 4mA out 2 Float (IEEE754) Low pressure value at 4mA output
0x16 High pressure value at 20mA out 2 Float (IEEE754) High pressure value at 20mA output
0x18 Analog output offset 2 Float (IEEE754) Analog output offset value
0x00 – Output current value
0x1A Analog output signal type 1 Short 0x40 – Analog zero output
0x80 – Analog full scale output

Please refer to ASCII table for the character, each


register contains 2 digits of SN
0x1C Serial number 4 Short
e.g. 4 registers return 3230 3234 3130 3031 Hex,
the serial number is 20241001
The model number is identified by the last four digits.
0x20 Model number 4 Short
E.g. 30014700 refers to MPM4700
E.g Returned value of Register1: 6666 and Register 2:
0x24 Pressure/level reading 2 Float (IEEE754) 40e6
0x40e66666=7.2
E.g. Returned value of Register1: C940 and Register 2:
0x26 Temperature reading 2 Float (IEEE754) 41B9
0x41B9C940=23.22°C

You might also like