[plug] OT: Data check digits
Leon Brooks
leon at brooks.fdns.net
Tue Jun 1 15:27:51 WST 2004
On Tue, 1 Jun 2004 14:43, Adam Davin wrote:
> Thanks for the response. Sorry for the ambiguity I didn't want to
> mess up the example file with annotations ;-). I have included the
> same file with annotations above each line this time. Hope this makes
> things a bit clearer. :) '0' = ttyS0 = PDT
> '1' = ttyS1 = Host Computer
> ## PDT sends ENQ(0x05) to Host
> 0>1: \x05
> ## Host ACK's(0x06) ready for data.
> 1>0: \x06
> ## (0x01) Start of Header, BHTQTYS.DAT - name of file to save as on
> host computer, 00003- 3 records, 05 13 04 08 08 08 - length of each
> field, (0x03) - ETX end of transmission, '5' - some sort of data
> check digit 0>1: \x01BHTQTYS.DAT 00003051304080808\x035
> ## Host received transmission ok ACK
> 1>0: \x06
> ## Next bit is the same for each line.
> ## PDT Record 1, 0x02 -STX start transmission, 00001 Record 1,
> 9311742999380 - barcode, 0005 - Quantity of 5, 8 Spaces, 8 Spaces, 8
> Spaces - last 3 records, 0x03 - ETX, 0x07 - check digit. 0>1:
> \x020000193117420003800005 \x03\x07 1>0: \x06
> 0>1: \x0200002742709112010 0003 \x03\x1e
> 1>0: \x06
> 0>1: \x0200003637407193402 0015 \x03\x18
> 1>0: \x06
> ## End of Transmission
> 0>1: \x04
> ## ACK
> 1>0: \x06
Turns out to be an XOR sum including the record number and ETX but not
STX.
Cheers; Leon
More information about the plug
mailing list