黑
黑夜沉淀
Unregistered / Unconfirmed
GUEST, unregistred user!
用spcom控间,写了个接收程序,程序老是将别人发送过来的‘11’(十六进制)这个字节屏蔽掉呢,无法接收该字节。例如发送过来的数据是2121001121,那么实际接收到的只有
21210021,中间的11不见了。不知道问题出在哪里。请教大家了,拜托!
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
viewstr:string;
i:integer;
ad,style:byte;
begin
viewstr:='';
move(buffer^,pchar((@rbuf)^),bufferlength);
for i:=1 to bufferlength do
viewstr:=viewstr+inttohex(rbuf,2)+'' ;
memo1.lines.add(viewstr);
memo1.lines.add('');
end;
21210021,中间的11不见了。不知道问题出在哪里。请教大家了,拜托!
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
viewstr:string;
i:integer;
ad,style:byte;
begin
viewstr:='';
move(buffer^,pchar((@rbuf)^),bufferlength);
for i:=1 to bufferlength do
viewstr:=viewstr+inttohex(rbuf,2)+'' ;
memo1.lines.add(viewstr);
memo1.lines.add('');
end;