SPT22WS Wireless Protocol - cMBRTU

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

SIER COMMUNICATION PROTOCOL

V3.0 cMBRTU

STATUS: TITLE: SPT22WS WIRELESS


[ ]DRAFT PROTOCOL_cMBRTU
[ √ ] PUBLISHED VERSION: V3.0
[ ] UNDER MODIFY APPROVED KENNY
BY:
DATE: 2020.10.01

SHAANXI SIER ELECTRONICS CO.,LTD


OCT. 2020
1. Available product range
This protocol is suitable for SPT22WS/SPT22S series wireless
pressure/level/temperature transmitters.

2. Wireless type available

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

Start: 0x69, 1 byte.


Application number: 2 bytes, used to identify customer code, application system
code, or supplier code, high byte first, and low byte last.
Instrument number: 4 bytes, the unique identification code of the instrument, set in
production, high byte first, and low byte last
Data length: 1 byte, identifying the data length (number of bytes) of subsequent
transmission, excluding CRC16 and terminator, length = 17 means there is no
flowmeter data, length ≥ 39 means there is flowmeter data.
Main instrument data: including instrument status, main measurement value,
ambient temperature value, sending period, signal strength, main unit
Main instrument data 1-Instrument status: 1 byte.

BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0


Upper Lower Battery percentage,
limit limit spar spare
alarm, alarm, e 0-empty,1-10%,2-20%, …every number
1 1 means 10% increase.
means means
alarm alarm

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.

5. The protocol frame format of the receiving device sends


5.1 Send confirmation frame

Application Instrument Data Status Date CRC16 termin


Starter number number Length confirmation and check ator
time

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 (the
number of bytes is 7), excluding CRC16 and terminator.
Status confirmation: 1 byte, 0x80 means receiving error, 0x81 means correct
receiving.
Date and time: date and time, 6 bytes, sequential year, month, day, hour, minute,
second; year first, second after;
year, 1 byte, 0-256, century is fixed as 21st century: 0 for 2000, 1 for 2001, 18 for
2018...n for 20n years, used to synchronize time.
CRC16 check: 2 bytes, starting from the start character, to the date and time area;
the low byte is first, the high byte is after. Terminator: 0x16.
5.2 Send set or read parameters command:

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

6.1 Upload data example when there is no flowmeter

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

<1>. 1 flow meter, data frame when communication is successful:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
27 ‐‐‐ Data Length
0A ‐‐‐pressure gauge status
3F AE 14 7B ‐‐ pressure gauge pressure value 1.36
01 2D ‐‐‐Temperature value 30.1
00 03 ‐‐‐sending cycle 3 minutes
38 ‐‐‐Signal Strength 56%
03 ‐‐‐pressure unit MPa
01 ‐‐‐Number of flow meters 1
01 ‐‐‐flow meter address 1
40 95 5B 27 EF 9D B2 2D ‐‐‐ No. 1 flow meter standard condition total 1366.789
3F 9D 70 A4 ‐‐‐ No. 1 flow meter standard condition instantaneous quantity 1.23
42 C9 33 33 ‐‐‐ No. 1 flow gauge pressure value 100.6 unit default KPa
41 D5 99 9A ‐‐‐ No. 1 flow meter temperature value 26.7 Unit default ℃
14 05 1C 0B 39 35 ‐‐‐ timestamp 5/28/20 11:57:53
6D AA ‐‐‐CRC16
16 ‐‐‐Terminator

<2>. 1 flow meter, data frame when communication fails:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
27 ‐‐‐ Data Length
0A ‐‐‐pressure gauge status
3F AE 14 7B - Pressure gauge pressure value 1.36
01 2D ‐‐‐Temperature value 30.1
00 03 ‐‐‐sending cycle 3 minutes
32 ‐‐‐Signal Strength 50%
03 ‐‐‐pressure unit Mpa
01 ‐‐‐Flow Meter Format 1
01 ‐‐‐flow meter address 1
FF FF FF FF FF FF FF FF -Connection failed
FF FF FF FF ‐‐‐connection failed
FF FF FF FF‐‐‐connection failed
FF FF FF FF ‐‐‐connection failed
14 05 1C 0D 25 27 ‐‐‐ timestamp 5/28/20 13:37:39
DA C1 ‐‐‐CRC16
16 ‐‐‐Terminator

6.3 The confirm command returned by server

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

6.4 Remote read parameter command frame sent by server

6.4.1 Server Send:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
01 ‐‐‐ data length
00 ‐‐‐ parameter setting identification 00 means read
6D E4 ‐‐‐CRC16
16 ‐‐‐Terminator

6.4.2 Instrument return:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
11 ‐‐‐ Data Length
00 ‐‐‐ parameter setting identification 00 means read
40 49 99 99 ‐‐‐ Upper limit alarm value 3.15
3E B3 33 33 ‐‐‐Lower limit alarm value 0.35
00 78 ‐‐‐sending interval 120 minutes
77 03 CC 13 ‐‐‐IP address 119.3.204.19
23 65 ‐‐‐port number 9061
10 EA ‐‐‐ CRC16
16 ‐‐‐Terminator
6.5 Remote setting command send by server

6.5.1 Server send:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
11 ‐‐‐ Data Length
04 ‐‐‐ parameter setting mark 04 means to set the sending interval
00 00 00 00 ‐‐‐ Upper limit alarm value
00 00 00 00 ‐‐‐Lower limit alarm value
00 1E ‐‐‐sending interval
00 00 00 00 ‐‐‐IP address
00 00 ‐‐‐ port number
B0 F3 ‐‐‐CRC16
16 ‐‐‐Terminator

6.5.2 Instrument return:


69 ‐‐‐starter
12 34 ‐‐‐application number
00 00 00 01 ‐‐‐meter number
11 ‐‐‐ Data Length
00 ‐‐‐ parameter setting identification 00 means read
40 49 99 99 ‐‐‐ Upper limit alarm value 3.15
3E B3 33 33 ‐‐‐Lower limit alarm value 0.35
00 1E ‐‐‐sending interval 30 minutes
77 03 CC 13 ‐‐‐IP address 119.3.204.19
23 65 ‐‐‐port number 9061
16 EC ‐‐‐CRC16
16 ‐‐‐Terminator

You might also like