发表于:2003-08-10 17:53:00
楼主
Data format
Each transmission block consist of the following bytes:
1. STX (02h) Start of Text
2. Address Pump address ‘00’ - ‘99’ ASCII, can be set on the pump
3. Data block ASCII symbol order according to command description
4. ETX (03h) End of Text
5. VRC Checksum
Each receiver block consists of the following bytes:
1. STX (02h) Start of Text
2. Data block All data are in ASCII format
3. ETX (03h) End of Text
4. VRC Checksum
The checksum is the last byte in a command string. All bytes (except the line synchronisation character and the checksum (VRC)) are linked to the XOR. The receiver of a message compares the transmitted checksum with the calculated checksum from the transmitted data; if the values are identical, the transmission is considered to be error-free.
?SI for Pump address 00:
Command: #200?SI#3$ [$ = CHR(36)]
Answer: #6#2KNF00#3B [B = CHR(66)]
? for Pump address 01:
Command: #201?SI#3% [% = CHR(37)]
Answer: #6#2KNF01#3C [C = CHR(67)]
我不会算checksum 啊,求救各位大侠!