procedure TForm1.FormCreate(Sender: TObject);
var
Mscomm1:TMSComm;
begin
Mscomm1:=TMSComm.Create();
Mscomm1.InBufferCount :=0; // 清空接收缓冲区
Mscomm1.InputLen :=0; // Input读取整个缓冲区内容
Mscomm1.RThreshold :=1; // 每次接收到字符即产生OnComm事件
end;
procedure TForm1.ComGetData(Sender:TObject);
begin
if (sender is TMSComm) then
if (sender is TMSComm).CommEvent = 2 then
Memo1.text:=Memo1.Text+(sender is TMSComm).Input;
end;