0% found this document useful (0 votes)
44 views

PH7&RX7 Modbus Protocol (Mod New Version)

The document describes the Modbus communication protocol for the PH7&RV7 sensor. It includes: 1. Communication settings like slave address, baud rate, and data format. 2. Function codes for reading and writing registers. 3. A list of register addresses and their corresponding parameters, data types and ranges. 4. Examples of getting measurement data and calibrating the sensor in a two-point procedure by writing target values to registers after obtaining measured values.

Uploaded by

Hector Navarrete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

PH7&RX7 Modbus Protocol (Mod New Version)

The document describes the Modbus communication protocol for the PH7&RV7 sensor. It includes: 1. Communication settings like slave address, baud rate, and data format. 2. Function codes for reading and writing registers. 3. A list of register addresses and their corresponding parameters, data types and ranges. 4. Examples of getting measurement data and calibrating the sensor in a two-point procedure by writing target values to registers after obtaining measured values.

Uploaded by

Hector Navarrete
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

PH7&RV7 Modbus Communication Protocol

1 Communication Settings

Slave Device Address used for Sensor ID: 1-255,

Default of PH7/RV7is 2

Baud rate: default is 9600bps, 19200bps is option.

Data bits: 8

Stop bits: 1

Parity: None

2 Function Code (FC) Introduction

FC 0x03:it is used for reading data from the holding registers

Command format:

Sensor ID + FC + starting address (high byte, low byte) + total number of registers to

read (high byte, low byte) + CRC

Where,

CRC stands for Cyclic Redundancy Check; it is a 2-byte code for error checking.

FC 0x06:it is used for writing data into a single register

Command format:

Sensor ID + FC +starting address (high byte, low byte)+ data (high byte,

low byte) + CRC


3 List of Addresses of Registers

Measuring Data (0x03)

Description of Address of Data Range(Data in


R/W Length
parameter register format decimal)

Measured data 0x00 OR Float 2 Depend on sensor

Temperature 0x02 OR Float 2 -30-130℃

General settings (0x03/0x06)

Sensor ID 0x10 OR Int 1 1-255

Baud rate 0x11 OR Int 1 0-1: 0-9600;1-19200

Filter 0x17 WR Int 1 1-60

Measurment mode 0x18 WR Int 1 0-3:0-PH;1-ORP


0-2 : 0-Manual ;
TC mode 0x19 WR Int 1 1-PT1000;2-NTC30K

Writing 0x11 into the

register to restore the


Restore to default 0x2f WR Int 1
above settings to

default.

Parameter for calibration (0x03/0x06/0x10)


1-3 : 11-One point
calibration ; 12-Two
points calibration;13-
Three points
Calibration mode 0x30 WR Int 1 calibration
Writing the one of
above values into the
register to set
calibration mode.

The 1st PH target


0x32 WR Float 2
value

The 2nd PH target


0x34 WR Float 2
value

The 3rd PH target


0x36 WR Float 2
value

The MV value can


The 1st measured
be measured
0x3c WR Float 2
automatically
PH value
during calibration

The 2nd measured The MV value can be


0x3e WR Float 2 measured automatically
PH value during calibration

The 3rd measured The MV value can be


0x40 WR Float 2 measured automatically
PH value during calibration

Trimming Range : -10-10℃ ,


0x46 WR Float 2 Available only for TC
temperature mode is 1

Set temperature Range : -30-130 ℃ ,


0x48 WR Float 2 Available only for TC
value manually mode is 0

Offset(1-2) 0x4a OR Float 2 -60 ~ 60mV

Slope(1-2) 0x4c OR Float 2 50~150%

Offset (2-3) 0x4e OR Float 2 -60 ~ 60mV


Slope (2-3 0x50 OR Float 2 50~150%

Writing 0x11 into the

register to restore the


Restore to default 0x5f WR Int 1
calibration data to

default.

Setting for communication (0x06)

Changingsensor ID 0x70 WR Int 1 1-255

Baud rate 0x71 WR Int 1 0-1:0-9600;1-19200

4 Taking examples for communication between a sensor and a remote

device.

4.1 Procedure of getting measuring data

Waiting for at least 5s

Getting data 1

Waiting for at least 5s

Getting data 2

………………………..

………………………..

4.2 Getting measured data

PC -> Sensor: the PC sends 0x02 0x03 0x00 0x00 0x00 0x04 0x44 0x3A to the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers


0x00 0x00 – Starting address (high byte, low byte)

0x00 0x04 – Total number of registers to read (high byte, low byte) in which 4registers

will be read.

0x44 0x3A– CRC code

Sensor -> PC , the PC gets 0x02 0x03 0x08 0Xa3 0Xd3 0x40 0Xe0 0Xbd 0xDA 0x41 0x79

0x49 0x00 sent from the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x08– Total number of bytes of data to follow, 8 bytes of data from 4 holding registers

0Xa3 0Xd3 0x40 0Xe0 0Xbd 0xDA 0x41 0x79 – 8 bytes of data

CRC code

Send repeatedly the above command to get data for multiple

measurements.

4.3 Explanation of returned data

The data “0Xa3 0Xd3 0x40 0Xe0 0Xbd 0xDA 0x41 0x79”is gotten from sensor ,

There are two groups of data,the“0Xa3 0Xd3 0x40 0Xe0“ for PH value and

the 0Xbd 0xDA 0x41 0x79“ for temperature ,exchange the high byte and low byte of

every one group of data,then convert them to float form

40 E0 A3 D3 (in HEX)= 7.11

41 9 BD DA (in HEX)=15.6089
4.4 Calibrating steps and details of command

4.4.1 Calibrating steps

(1) Changing the calibration mode to two points calibration

(2) Place the sensor into the 1st standard solution after cleaning it , then get the MV

value .

(3) Writing the target value 1 ( concentration of the standard solution1 )into the

registers after the MV value is stable

(4) Place the sensor into the 2nd standard solution after cleaning it , then get the

MV value .

(5) Writing the target value2 ( concentration of the standard solution2 )into the

registers after the MV value is stable

(6) Getting the offset and slope of new calibration

4.4 .2 Details of commands

(1)Changing the calibration mode to two points calibration

PC -> Sensor, the PC sends0x02 0x06 0x00 0x30 0x00 0x0C 0x89 0XF3 to the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x06 – FC for writing data into a single register

0x00 0x30 – Starting address (high byte, low byte) in which is the 0x30 for storing

calibration mode. 11 (in decimal) -one point calibration ; 12 (in decimal) -two points

calibration ; 13 (in decimal) - three points calibration.

0x00 0x0C – Data (high byte, low byte) in which 0x0C be converted to 12 in decimal ,

it means two points calibration.


0x89 0XF3 – CRC code

Sensor -> PC, the PC gets 0x06 0x06 0x00 0x30 0x00 0x0C 0x88 0X77 sent from the

sensor for acknowledgement.

(2)Getting the MV value from sensor at the 1st standard solution

PC -> Sensor: the PC sends 0x02 0x03 0x00 0x3C 0x00 0x02 0X04 0X34to the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x00 0x3C – Starting address (high byte, low byte), in which 0x3C is the holding register

for storing the MV value at point 1

0x00 0x02 – Total number of registers to read (high byte, low byte) in which 2 registers

will be read.

0X04 0X34 – CRC code

Sensor -> PC , the PC gets 0x02 0x03 0x04 0xXX 0xXX 0xXX 0xXX+ CRC codes sent from

the sensor

Where,

0x02 – Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x04 – Total number of bytes of data to follow, 4 bytes of data from 2 holding registers

0xXX 0xXX 0xXX 0xXX – 4 bytes of data

CRC code

Getting the measure data by sending the above command repeatedly,then do next step

after the measuring data are stable.

(3)Entering the 1st target value


PC -> Sensor: the PC sends 0X02 0X06 0X00 0X32 0X85 0X1F 0X40 0XDB 0XF7 0X47

to the sensor

Where,

0x02– Sensor ID, the PH7/RX7sensor

0x06 – FC for writing data into a single register

0X00 0X32 – Starting address (high byte, low byte) in which 0x36 is the holding

register for storing the 1st target value (concentration of standard solution 1)

0X85 0X1F 0X40 0XDB– Data (high byte, low byte) to be written, it is 6.86 in IEEE754

format , it is buffer solution 1

0XF7 0X47 – CRC code

Sensor -> PC, the PC gets 0X02 0X06 0X00 0X32 0X85 0X1F 0X40 0XDB 0XF7 0X47

sent from the sensor for acknowledgement.

(4)Getting the MV value from sensor at the 2nd standard solution

PC -> Sensor: the PC sends 0x02 0x03 0x00 0x3e x00 0x02 0XA5 0XF4 to the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x00 0x3E– Starting address (high byte, low byte), in which 0x3E is the holding register

for storing the current MV value at the point 2

0x00 0x02 – Total number of registers to read (high byte, low byte) in which 2 registers

will be read.

0XA5 0XF4– CRC code

Sensor -> PC , the PC gets 0x02 0x03 0x04 0xXX 0xXX 0xXX 0xXX+ CRC codes sent from

the sensor
Where,

0x02 – Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x04 – Total number of bytes of data to follow, 4 bytes of data from 2 holding registers

0xXX 0xXX 0xXX 0xXX – 4 bytes of data .

CRC code

Getting the measure data by sending the above command repeatedly ,then do next

step after the measuring data are stable.

(5)Entering the 2nd target value

PC -> Sensor: the PC sends 0X02 0X06 0X00 0X34 0X00 0X00 0X40 0X80 0X26 0X76to

the sensor

Where,

0x02– Sensor ID, the PH7/RX7sensor

0x06 – FC for writing data into a single register

0x 00 0x34 – Starting address (high byte, low byte) in which 0x38 is the holding

register for storing the 2nd target value (concentration of standard solution 2)

0X00 0X00 0X40 0X80– Data (high byte, low byte) to be written, it is 4.00 in IEEE754

format , it is concentration of buffer solution 2

0X26 0X76– CRC code

Sensor -> PC, the PC gets 0X02 0X06 0X00 0X34 0X00 0X00 0X40 0X80 0X26 0X76

sent from the sensor for acknowledgement.

After enter the two target values, sensor will be calculated the offset and slope for new

calibration , then store them into holding registers .

(6)Getting new offset and slope


PC -> Sensor: the PC sends 0x02 0x03 0x00 0x4a 0x00 0x04 0x65 0xEC to the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x00 0x4A – Starting address (high byte, low byte), in which 0x4A and 0x4B are the

holding registers for storing the offset value ; 0x4C and 0x4d are the holding registers

for storing the slope value .

0x00 0x04 – Total number of registers to read (high byte, low byte) in which 4 registers

will be read.

0x65 0xEC – CRC code

Sensor -> PC , the PC gets 0x02 0x03 0x08 0x00 0x00 0xC1 0x70 0x00 0x00 0x42 0xDC

0xFA 0XB0 sent from the sensor

Where,

0x02– Sensor ID, the PH7/RX7 sensor

0x03 – FC for reading data from the holding registers

0x08 – Total number of bytes of data to follow, 8 bytes of data from 4 holding registers

0x00 0x00 0xC1 0x70 0x00 0x00 0x42 0xDC – 8 bytes of data , in which 0x00 0x00 0xC1

0x70 can be converted to float format in IEEE 754 , it is -15, the value is offset of new

calibration; 0x00 0x00 0x42 0xDC can also be converted to float format in IEEE 754 , it

is 110, the value is slope value (110%) of new calibration

0xFA 0XB0 -CRC code

You might also like