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

RS – 232 Protocol of Dispenser

CheckSum = NOT (Command + Data1 + … + Data9) + 1, the addition has no carry bit.
The setting of computer (PC) COM port is “9600, n, 8, 1”; the mode of input is binary; the handshaking is none.
From Computer (PC) to Dispenser (All data in the following table is Hex, ‘XX’ stands for a Hex datum, such as ‘37’):

枪号 Data1 Command Data2 Data3 Data4 Data5 Data6 Data7 Data8 Data9 CheckSum Memo
XX 00 B8 00 00 00 00 00 00 00 00 48 Query State
XX 00 A0 00 00 00 00 00 00 00 00 60 Control Dispenser
XX 00 B0 00 00 00 00 00 00 00 00 50 Uncontrol Dispenser
XX 00 A1 00 00 00 00 00 00 00 00 5F Fueling
XX 00 B1 00 00 00 00 00 00 00 00 4F Stop
XX 00 A2 XX XX XX 00 00 00 00 00 Fueling with fixed cash(1)
XX 00 A3 XX XX XX 00 00 00 00 00 Fueling with fixed liter(2)
XX 00 A4 XX XX 00 00 00 00 00 00 Setting Price(3)
XX 00 A6 XX 00 00 00 00 00 00 00 Setting Pre-valve(4)
XX 00 A8 00 00 00 00 00 00 00 00 58 Clear Shift Sum
XX 00 A9 00 00 00 00 00 00 00 00 57 Query Shift Sum
XX 00 AC 00 00 00 00 00 00 00 00 54 Query Total Cash
XX 00 AD 00 00 00 00 00 00 00 00 53 Query Total Liter

(1): The maximal value of fixed cash is 9999.99. For example, if the fixed cash is 2356.47 in decimal system, the data2, data3, and data4 will be 0x23, 0x56, and 0x47
respectively.
(2): The maximal value of fixed liter is 9999.99. For example, if the fixed liter is 9876.32 in decimal system, the data2, data3, and data4 will be 0x98, 0x76, and 0x32
respectively.
(3): The maximal value of price is 99.99. For example, if the price is 25.43 in decimal system, the data2 and data3 will be 0x25 and 0x43 respectively.
(4): The maximal value of pre-valve is 0.99. For example, if the pre-valve is 0.50 in decimal system, the data2 will be 0x50 respectively.

1
From Dispenser to Computer (PC) (All data in the following table is Hex, ‘XX’ stands for a Hex datum, such as ‘37’):

枪号 Data1 Command Data2 Data3 Data4 Data5 Data6 Data7 Data8 Data9 CheckSum Memo
Price Cash Liter State
XX 00 Query State(1)
XX XX XX XX XX XX XX XX XX
XX 00 A0 Control Dispenser
XX 00 B0 Uncontrol Dispenser
XX 00 A1 No Feedback Fueling
XX 00 B1 No Feedback Stop
XX 00 A2 No Feedback Fueling with fixed cash
XX 00 A3 No Feedback Fueling with fixed liter
XX 00 A4 No Feedback Setting Price
XX 00 A6 No Feedback Setting Pre-valve
XX 00 A8 No Feedback Clear Shift Sum
Shift Liter Sum Shift Money Sum
XX 00 A9 Query Shift Sum(2)
XX XX XX XX XX XX XX XX
XX 00 AC XX XX XX XX XX XX XX XX Query Total Cash(3)
XX 00 AD XX XX XX XX XX XX XX XX Query Total Liter(4)

(1): If the command and data2 are 0x06 and 0x43 respectively, the price will be 6.43 in decimal system. If the data3, data4, and data5 are 0x16, 0x27, and 0x43 respectively,
the current cash will be 1627.43 in decimal system. If the data6, data7, and data8 are 0x23, 0x47, and 0x18 respectively, the current liter will be 2347.18 in decimal system.
If the data9 is 0x02, the dispenser is fueling now; if the data9 is 0x01, the dispenser is stopping now.
(2): If the data2, data3, data4, and data5 are 0x98, 0x76, 0x53, and 0x43 respectively, the shift liter sum will be 987653.43 in decimal system. If the data6, data7, data8, and
data9 are 0x89, 0x45, 0x63, and 0x23 respectively, the shift liter sum will be 894563.23 in decimal system.
(3): If the data2, data3, data4, and data5, data6, data7, data8, and data9 are 0x98, 0x76, 0x54, 0x32, 0x10, 0x12, 0x 45, and 0x43 respectively, the total cash will be
98765432011245.43 in decimal system.
(4):If the data2, data3, data4, and data5, data6, data7, data8, and data9 are 0x01, 0x02, 0x45, 0x30, 0x10, 0x13, 0x 65, and 0x00 respectively, the total liter will be

2
1024530101365.00 in decimal system.

NOTICE : USING 11.0592M CRYSTAL


状态位 的第七位 1/0 做为提枪/放枪状态
状态位 的第六位 1/0 联机/脱机状态
枪号为 01H---FFH

增加
状态位 的第 5 位 1=有预制 0=没有

B2 L 凑整
B3 P 凑整

3
新增或者修改的部分功能:

说明:1. 所有新增命令匹配原协议格式,默认 hex 数据,默认数字为 BCD 码,默认数据长度都沿用原有协议。


2. 与加油机通讯的设备统称 POS。
3. 所有参数无特殊说明,均 Data2 开始占用参数位,一直到 Data9,参数不会多于 8 位。

修改细节如下:

1. A1,B1,A2,A3 等没有反馈的命令,需要加油机提供回复(可以无参数) ,比如定量,需要加油机在定量成功后给出回复,若不成功,可不回复。新增命


令中,涉及无返回参数的(加油机不回复参数)的操作,加油机回复命令,POS 认为操作成功,不回复,认为操作失败。
2. 关于 B8 命令状态位,根据测试现有状态为要么是 0x01,要么是 0x02,即只用了 bit1,bit0 两位,其他位的新增如下:
状态位:
bit4:预置状态 0-有 1 无
bit5:是否处于加油状态 0-否 1-是
bit6:加油模式 0-自由模式 1-需要授权模式
bit7: 提枪状态 0-挂枪 1-提枪
3. 新增命令 0xB2 升数凑整,无发送参数,无返回参数
4. 新增命令 0xB3 金额凑整,无发送参数,无返回参数
5. 新增命令 0xB4 班累查询,无发送参数,返回班累数据,4 字节的 BCD 码(XX XX XX XX)
6. 新增命令 0xB5 班累清除,无发送参数,无返回参数 清楚后查询班累计依然还是原来的值
7. 新增命令 0xB6 停电复显,用于加油过程中因停电停机,需要重新显示加油量,无发送参数,无返回参数 95478
8. 新增命令 0xB7 查询当前时间,用于查询税控时间,无参数
9. 新增命令 0xB9 查询日累或月累,发送参数:1 个字节,0x00 日累,0x01 月累,其他无效;返回参数无
10. 新增命令 0xBA 用油确认,发送参数:1 个字节,0x00 出厂拥有确认,0x01 现场用油确认

You might also like