Blame | Last modification | View Log | Download
unit Unit1;
interface
uses
Portinc,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Tabs, ComCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
CheckBox3: TCheckBox;
StaticText1: TStaticText;
StaticText2: TStaticText;
Timer1: TTimer;
Edit1: TEdit;
Button3: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
TXD (1);
CheckBox1.Checked:=True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
TXD(0);
CheckBox1.Checked:=False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OPENCOM (Pchar('COM1,1200,N,8,'));
Timer1.Interval:=1;
Timer1.Enabled:=True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if DCD=1 then CheckBox3.Checked:=True
else CheckBox3.Checked:=False
end;
procedure TForm1.Button3Click(Sender: TObject);
var i,c:integer;
b:string;
begin
b:=Edit1.Text;
for c:=1 to len(b)
b:=Edit1.Text[c];
ord (i,b);
SENDBYTE (i);
edit1.text:=i
end;
end.