unit comm interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SPComm, StdCtrls, ExtCtrls type TFcomm = class(TForm) Comm1: TComm GroupBox1: TGroupBox Memo1: TMemo Memo2: TMemo GroupBox2: TGroupBox Button1: TButton Btn_send: TButton Button2: TButton procedure Button1Click(Sender: TObject) procedure Button2Click(Sender: TObject) procedure Btn_sendClick(Sender: TObject) procedure Comm1ReceiveData(Sender: TObject Buffer: Pointer BufferLength: Word) private { Private declarations } public { Public declarations } end