如果用RS232连接要‘跳线’,在ONCOMM事件中实现?
var
i1:integer;
rbuf:array of byte;
RtBufferleVariant;
xyi:variant;
begin
SetLength(rbuf,0);
InCount:= Comm1.InBufferCount;
setlength(rbuf,InCount);
RtBuffer:= Comm1.Input;
xyi:=VarArrayCreate([0,inCount],varByte);
xyi:=RtBuffer;
for i1:=0 to InCount-1 do
begin
//do something
end;
end;