unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, CPortCtl, StdCtrls, CPort;
type
TForm1 =
class(TForm)
ComTerminal1: TComTerminal;
ComPort1: TComPort;
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Button3: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
comport1.Open;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
comport1.Close;
end;
procedure TForm1.Button3Click(Sender: TObject);
var s:ansistring;
begin
comPort1.
Write(pchar(edit1.Text),1);
comport1.
Write(#13,1);
s := ansistring(edit2.Text);
comport1.WriteStr(s);
comport1.
Write(#13,1);
end;
end.