L
lcl_003
Unregistered / Unconfirmed
GUEST, unregistred user!
接收到的数据好想是16进制的,看不太懂。
接收的代码如下:
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
viewstring:string;
rbuf:array[0..16] of byte;
begin
viewstring:='' ;
move(buffer^,pchar((@rbuf)^),bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+ inttohex(rbuf,2)+'' ;
viewstring:='接收'+ viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('' );
end;
接收的代码如下:
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
viewstring:string;
rbuf:array[0..16] of byte;
begin
viewstring:='' ;
move(buffer^,pchar((@rbuf)^),bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+ inttohex(rbuf,2)+'' ;
viewstring:='接收'+ viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('' );
end;