SPT22WS Wireless Protocol - cMBRTU
SPT22WS Wireless Protocol - cMBRTU
SPT22WS Wireless Protocol - cMBRTU
V3.0 cMBRTU
Lora、Lorawan、GPRS、LTE、NB-IOT、WIFI、433MHz, etc.
3. Mode of this protocol
The instrument uploads data actively, and the receiving device needs to respond within
2 seconds after receiving the data. There are two types of response content: one is to
confirm that the correct or wrong data is received; the other is to send a parameter setting
command.
4. Instrument upload protocol frame format
Star Appl Instr Dat Main Qua Flow Flow Sen CRC1 term
ter icati ume a Instru ntity meter mete d 6 ina
on nt Len ment of No.1 r time check tor
num num gth data flow data no.X
ber ber met data
ers
Main instrument data 2- Main measurement value (pressure value, liquid level value
or main temperature value, etc.): 4-byte floating point number (float AB CD format),
high byte first, low byte last.
Main instrument data 3-Ambient temperature value: 2 bytes signed integer, the
actual temperature value is to use this value divided by 10, high byte first, and low
byte last.
Main instrument data 4-Sending interval: 2 bytes, unit is minute, high byte first, and
low byte last.
Main Instrument Data 5-Signal Strength: 1 byte, 0-100%.
Main Instrument Data 6-Main unit:1 byte (00-pa 01-Hpa 02-Kpa 03-Mpa 04-PSI 05-PSF 06-
Kg/cm2 07-mH2O 08-mmH2O 09-Bar 10-mBar 11-mmHg 12-inHg 13-atm 14-℃ 15-℉ 16-
%(Humidity) 17-mm
18-cm 19-m 20-km 21-mg 22-g 23-kg 24-T 25-N 26-KN 27-ml 28-l 29-m³30-user(customized) ).
Note: Pressure type: 0~6,9~13;
Level Type: 7,8; Temperature type: 14,15;
Humidity(Temp.+Hum.):16;
Distance type: 17~20;
Mass type 21~24;
Force type:25,26
Volume type:27~29
Customized type:30-user
Flowmeters quantity:1 byte,The number of information contained in the data
frame, that is, the number of devices connected (1-4)。
Flowmeter data:21 byte,Including 1-byte address, 8-byte floating-point standard
total amount (m³), 4-byte floating-point standard instantaneous volume (m³/h), 4-byte
floating-point pressure value (KPa), 4-byte floating-point Temperature value (°C).
All data ff indicates that the flowmeter of this address is failed of connection
Sending time: 6 bytes, sequential year, month, day, hour, minute, second; year first,
second second; year 1 byte, 0-256, century is fixed as 21st century: 0 represents
2000, 1 for 2001, 18 for 2018...n for 20n years.
CRC16 check: 2 bytes, starting from the start character, to the data 6 area; low byte
first, high byte after.
CRC16 calculation method:
(1) Preset a 16-bit register as hexadecimal FFFF (that is, all 1s); call this register a
CRC register;
(2) XOR the first 8-bit binary data (that is, the first byte of the communication frame)
with the lower 8 bits of the 16-bit CRC register, and place the result in the CRC
register;
(3) Shift the contents of the CRC register to the right by one bit (toward the lower bit),
fill the highest bit with 0, and check the shifted out bit after the right shift;
(4) If the shift out bit is 0: repeat step 3 (shift right one bit again);
If the shift-out bit is 1: XOR the CRC register with the polynomial A001 (1010 0000
0000 0001);
(5)Repeat steps 3 and 4 until the right shift is performed 8 times, so that the entire 8-
bit data has been processed;
(6)Repeat steps 2 to 5 to process the next byte of the communication frame until all
bytes are processed;
(7)The content of the obtained 16-bit CRC register is: CRC code;
(8) When the message is finally placed, the low byte of CRC16 is first, and the high
byte is at the end. Terminator: 0x16.
para
Star Appl Instr Dat met Par Par Par Par Par CRC1 Ter
ter icati ume a er a a a a a 6 mi
on nt Len setti m m m m m check na
num num gth ng et et et et et tor
ber ber iden er er er er er
tifier 1 2 3 4 5
Starter: 0x69, 1 byte.
Application number: 2 bytes, used to identify customer code, application system
code, or supplier code, which is consistent with the received code.
Instrument number: 4 bytes, the unique identification code of the instrument, which is
consistent with the received one.
Data length: 1 byte, identifying the data length of subsequent transmission (1 or 17
bytes), excluding CRC16 and terminator. Description: After reading or setting
parameters, the instrument returns all parameters, namely parameters 1 to 5
Parameter setting identifier:
BIT BI BI BIT4 BIT3 BIT2 BIT1 BIT0
7 T6 T
5
Spa Sp S If it is 1 If it is 1 If it is 1 If it is 1 If it is 1
re ar pa
e re set set parameter 4 set set set
parameter paramete paramete paramete
5 r3 r2 r1
Note: If BIT0-BIT7 is all 0,It means to read instrument parameters
Parameter 1: Upper limit alarm, 4-byte floating point number, high byte first, low byte
last. Parameter 2: Lower limit alarm, 4-byte floating point number, high byte first, low
byte last.
Parameter 3: Sending interval time, 2 bytes, in minutes, high byte first, low byte last.
Parameter 4: IP address, 4 bytes, high byte first, low byte last.
Parameter 5: Port number, 2 bytes, high byte first, low byte last.
CRC16 check: 2 bytes, starting from the start character, to the parameter 5 area; the
low byte is in the front, and the high byte is in the back.
Terminator: 0x16.
6. Protocol frame example
69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
11 ‐‐‐ Data Length
0A ‐‐‐pressure gauge status
3F AE 14 7B ‐‐pressure value 1.36
01 2D ‐‐‐Temperature value 30.1
00 03 ‐‐‐sending cycle 3 minutes
35 ‐‐ Signal Strength 53%
03 ‐‐‐pressure unit MPa
14 05 1C 0B 30 35 ‐‐‐ timestamp 5/28/20 11:48:53
00 87 ‐‐‐CRC16
6.2 Upload data example when there is flowmeter
69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐instrument number
7 ‐‐‐data length
81 ‐‐‐received correctly
15 05 1C 0B 30 35 ‐‐‐time stamp 5/28/21 11:48:53
05 09 ‐‐‐CRC16
16 ‐‐‐terminator