1. 怎樣實現在Delphi 7中實現spcomm控制項接收串口助手V2.1發送的數據請各位指教,謝謝!
打開埠,在接收事件里寫代碼就行了啊。
procere TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
begin
ShowMessage(PChar(Buffer));
end;
procere TForm1.Button1Click(Sender: TObject);
begin
try
Comm1.StopComm;
Comm1.CommName:= 'COM2'; //設置埠版號
Comm1.BaudRate:= 9600;//設置波權特率
Comm1.StartComm;
except
ShowMessage('埠錯誤!');
end;
end;