SM1212B-12 Us er Ma nual
http://www.sonbus.com/
Sha nghai Son
best Industrial Co., Ltd Page2
core color is for reference.
Communication Protocol
The product uses RS485 MODBUS-RTU standard protocol format, all operation or reply commands
are hexadecimal data. The default device address is 1 when the device is shipped, the default baud rate is
9600, 8, n, 1
1. Read Data (Function id 0x03)
Inquiry frame (hexadecimal), sending example: Query 1# device 1 data, the host computer sends the
command:01 03 00 00 00 0C 45 CF .
Device ID
Function id
Start Address
Data Length
CRC16
01
03
00 00
00 0C
45 CF
For the correct query frame, the device will respond with data:01 03 18 00 79 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 A5 E8 , the response format is parsed as follows:
Device
ID
Function
id
Data
Length
数
据
1
数
据
2
数
据
3
数
据
4
数
据
5
数
据
6
01
03
18
00
79
00
7A
00
7B
00
7C
00
7D
00
7E
Data Description: The data in the command is hexadecimal. Take data 1 as an example. 00 79 is
converted to a decimal value of 121. If the data magnification is 100, the actual value is 121/100=1.21.
Others and so on.
2. Data Address Table
Address
Start Address
Description
Data type
Value range
40001
00 00
1#temperatureregister
Read only
0~65535
40002
00 01
2#humidityregister
Read only
0~65535
40003
00 02
3#temperatureregister
Read only
0~65535
40004
00 03
4#humidityregister
Read only
0~65535
40005
00 04
5#temperatureregister
Read only
0~65535
40006
00 05
6#humidityregister
Read only
0~65535
...
...
...
...
...
40023
00 16
23#temperatureregister Read only
0~65535
40024
00 17
24#humidityregister
Read only
0~65535
40101
00 64
model code
read/write
0~65535
40102
00 65
total points
read/write
1~20
40103
00 66
Device ID
read/write
1~249
40104
00 67
baud rate
read/write
0~6
40105
00 68
mode
read/write
1~4
40106
00 69
protocol
read/write
1~10
3 read and modify device address
(1) Read or query device address
If you don't know the current device address and there is only one device on the bus, you can use the
command FA 03 00 64 00 02 90 5F Query device address.
Device ID
Function id
Start Address
Data Length
CRC16
FA
03
00 64
00 02
90 5F
FA is 250 for the general address. When you don't know the address, you can use 250 to get the real
device address, 00 64 is the device model register.