![background image](http://html.mh-extra.com/html/king-pigeon/s175/s175_user-manual_1969937033.webp)
Page 33 of 55
King Pigeon Hi-Tech. Co., Ltd.
Ver 1.3
GSM/SMS/GPRS/3G/4G
Cellular IoT Gateway
Content
Bytes
Data
(H: HEX)
Description
Device Address
1
01H
01H Device, Range: 1-247, according to setting address
Function Code
1
04H
Read input register
Return Bytes Qty
1
04H
Return data length
Returning Data
2
0B 0E 19 DCH
Returning temperature and humidity value
16 CRC Verify
2
92 6AH
CRC0 CRC1 low byte in front, high behind
Example: Inquiry device address,2*16 Bit register start from 18H. Match to device temperature, humidity,
then:
Server send:
01 04 00 18 00 02 F1 CC
01= Device address; 04= Read input register value; 00 18= Temperature starting register address; 00 02= Serial
reading 2 input register value; F1 CC= CRC verify.
Device answer:
01 04 04 0B 0E 19 DC 92 6A
01= Device address; 04= Read input register value; 04= Returning data bytes;
0B 0E 19 DC=
Returning
temperature and humidity value. 2 bytes in front stands for temperature, 2 bytes behind stands for humidity,
and the value expand 100 times (Real value= this value/100). Converter to Decimal as:
Temperature
0B 0E
2830
Real value= this value/100
Humidity
19 DC
6620
Real value= this value/100
So temperature and humidity real value is 28.3
℃
, 66.2%.
92 6A=
CRC verify.
8.4 Modbus RTU Master Application
When RS485 as Modbus RTU Master, can extend I/O tags, support slaves for connecting Remote I/O data
acquisition module, Smart meter, Power monitoring module, Smart transducer...; Can mapping register value
from Slave to Master, these registers’ can be setup high or low threshold value, and NC/NO type, moreover,
can enable to send SMS to users once alarm occurrence by the registers if required. Also can remote control
Slaves by writing coil.
Mapping Register Table and function code:
Reminder:
1.Use this function code when connect to Modbus RTU/Modbus TCP upper computer via GPRS/3G/4G (Device as Modbus
RTU Slave). Stands for when Cloud communication with S17X/S37X, the S17X/S37X is Modbus RTU Slave of Cloud Server.
2. When device connect to Modbus RTU/Modbus TCP upper computer via GPRS/3G/4G (Device as Modbus
RTU Slave). The I/O of S17X/S37X itself refer to "Modbus RTU Slave Application" above.
For example, when device as Modbus RTU master,as below:
Step1:
Connect the slave to device RS485 port.
Step2:
Find the salve port communication parameter and register address from user manual.
Step3:
Write device RS485 parameter according to slave port communication parameter, pls ensure both
parameter are same, others communication failure, refer to "port setting" part.