Professional Documents
Culture Documents
RS485 or RS232 Communication Protocol
RS485 or RS232 Communication Protocol
Protocol I
1.1 Structure (Baud rate: 9600; no parity check; 8 data bits; 1 stop bit ;):
Orders from the terminal to the sensor consist of following 5 parts:
Head of data: 2 bytes, fixed ASCII $! (0x24 0x21);
Order: 2 bytes, variant, e.g. DO (0x44 0x4F);
ID number: 2 bytes, ASCII refers to the serial number, e.g. 01 (0x30 0x31), and maximum
is 99;
Check: 2 bytes, add all the characters from head of the data to the ID number together,
get the last 8 bits and turn it into ASCII which is represented by hexadecimal, for example,
if add the characters from head of the data to the ID number together and it gets 0x0245,
then only the last 8 bits are kept, that is 0x45, so it will be45 (0x34 0x35) when turn it
into ASCII which is represented by hexadecimal.
End of data: 2 bytes, the line break, i.e. 0x0D 0x0A
Orders from the sensor to the terminal consist of following 6 parts:
Head of data: 1 byte, fixed *, i.e. 0x2A;
Identification: 3 bytes, which indicates the data type being reverted at the moment;
ID number: 2 bytes, ASCII refers to the serial number, e.g. 01 (0x30 0x31), and maximum
is 99;
Value: 6 bytes, which indicates the value being reverted at the moment, with the fixed
length of 6 bytes;
Check: 2 bytes, add all the characters from head of the data to the ID number together,
get the last 8 bits and turn it into ASCII which is represented by hexadecimal, for example,
if add the characters from head of the data to the ID number together and it gets 0x0245,
then only the last 8 bits are kept, that is 0x45, so it will be45 (0x34 0x35) when turn it
into ASCII which is represented by hexadecimal.
End of data: 2 bytes, the line break, i.e. 0x0D 0x0A;
1.2 Contents:
1.2.1 Liquid level reading percentage
Orders from the terminal or the computer to the sensor (no filtering):
ASCII: $! DO0139
01 stands for ID number.
Of which, 39 is the check sum, the last 8 bits by adding the bit from $ (0x24) to the bits
before check sum, and turn the 8 bits into ASCII, for example, add $!DO01, it will get
0x0139, then the check value will be 39, that is 0x33 0x39.
Hexadecimal: 24 21 44 4F 30 31 33 39 0D 0A
Sensor reverts:
ASCII: *RFV01000.0198
1.2.2
1.2.3
1.2.4
1.2.5
2 20 seconds;
3 40 seconds;
4 80 seconds;
5 160 seconds;
6 320 seconds;
Sensor reverts:
ASCII: *SZN01OKOKOK54, which indicates success;
*SZN01NONONO5D, which indicates failure.
Hexadecimal: 2A 53 5A 4E 30 31 4F 4B 4F 4B 4F 4B 35 34 0D 0A
2A 53 5A 4E 30 31 4E 4F 4E 4F 4E 4F 35 44 0D 0A
Setting the uploading time automatically, optional parameters is 0065, the other is
invalid.
Hexadecimal: 24 21 53 54 30 30 34 43 0D 0A
Time range for automatical uploading: 1 ~ 65 seconds:
00 not upload automatically;
01 1seconds;
02 2 seconds;
03 3 seconds;
04 4 seconds;
05 5 seconds;
Sensor will revert the data at that time automatically in the set time interval (no
filtering)
ASCII: *RFV01000.0198
RFV is the returning sign of liquid level reading.
000.01
000.01 is the fuel level value at the moment, in percentage, with the maximum of
100.00., always being showed as XXX.XX, put 0 in front when the bytes are less than 3
before the dot, e.g. 012.21, it can be showed as 12.21%.
98 is the sum of the check.
Hexadecimal: 2A 52 46 56 30 31 30 30 30 2E 30 31 39 38 0D 0A
Protocol II
Inquiry command: *020600#
Return: $XROIL0202DDDDXX\n,
of which, DDDD is
XX is
'\n' is the end mark;
For example, $XROIL02025678XX\n,
The percentage of the fuel level is 56.78%, reading of the percentage of current liquid level is
*020600#.