procedure TForm1.Comm1ReceiveData(Sender: TObject;
Buffer: Pointer;
BufferLength: Word);
type Rev=array[1..64] of byte ;
var
A:array [0..63] of byte;
B:array [1..64] of byte;
myRev:^Rev;
i,x,y,j,k:integer;
s,s1,s2,s3,s4:String;
R:myCRC;
begin
myRev:=buffer;
for i:=1 to bufferLengthdo
begin
s:=s+intToHex(byte(myRev),2);
B:=strtoint(intToHex(byte(myRev),2));
end;
R:=Crc16(B);
if (B[62]<>R[1]) or (B[63]<>R[0]) then
exit;
memo1.Lines.Add(s);
memo1.Lines.Add(#13);
end;