SM2120B Us er Ma nual
http://www.sonbus.com/
Sha nghai Son
best Industrial Co., Ltd Page3
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.
For the correct query command, the device will respond, for example the response data is: 01 03 02
07 12 3A 79, the format of which is as shown in the following table:
Device ID
Function id
Start Address
Model Code
CRC16
01
03
02
55 3C 00 01
3A 79
Response should be in the data, the first byte 01 indicates that the real address of the current device is,
55 3C converted to decimal 20182 indicates that the current device main model is 21820, the last two bytes
00 01 Indicates that the device has a status quantity.
(2)Change device address
For example, if the current device address is 1, we want to change to 02, the command is:01 06 00 66
00 02 E8 14 .
Device ID
Function id
Start Address
Destination
CRC16
01
06
00 66
00 02
E8 14
After the change is successful, the device will return information: 02 06 00 66 00 02 E8 27 , its format
is parsed as shown in the following table:
Device ID
Function id
Start Address
Destination
CRC16
01
06
00 66
00 02
E8 27
Response should be in the data, after the modification is successful, the first byte is the new device
address. After the general device address is changed, it will take effect immediately. At this time, the user
needs to change the query command of the software at the same time.
4 Read and Modify Baud Rate
(1) Read baud rate
The device default factory baud rate is 9600. If you need to change it, you can change it according to
the following table and the corresponding communication protocol. For example, read the current device's
baud rate ID, the command is:01 03 00 67 00 01 35 D5 , its format is parsed as follows.
Device ID
Function id
Start Address
Data Length
CRC16
01
03
00 67
00 01
35 D5
Read the baud rate encoding of the current device. Baud rate encoding: 1 is 2400; 2 is 4800; 3 is 9600;
4 is 19200; 5 is 38400; 6 is 115200.
For the correct query command, the device will respond, for example the response data is: 01 03 02
00 03 F8 45, the format of which is as shown in the following table:
Device ID
Function id
Data Length
Rate ID
CRC16
01
03
02
00 03
F8 45