Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
unit Unit1;
2
 
3
interface
4
 
5
uses
6
  Portinc,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7
  Dialogs, StdCtrls, ExtCtrls, Tabs, ComCtrls;
8
 
9
type
10
  TForm1 = class(TForm)
11
    Button1: TButton;
12
    Button2: TButton;
13
    CheckBox1: TCheckBox;
14
    CheckBox3: TCheckBox;
15
    StaticText1: TStaticText;
16
    StaticText2: TStaticText;
17
    Timer1: TTimer;
18
    Edit1: TEdit;
19
    Button3: TButton;
20
    Label1: TLabel;
21
    procedure Button1Click(Sender: TObject);
22
    procedure Button2Click(Sender: TObject);
23
    procedure FormCreate(Sender: TObject);
24
    procedure Timer1Timer(Sender: TObject);
25
    procedure Button3Click(Sender: TObject);
26
  private
27
    { Private declarations }
28
  public
29
    { Public declarations }
30
  end;
31
 
32
var
33
  Form1: TForm1;
34
 
35
implementation
36
 
37
{$R *.dfm}
38
 
39
procedure TForm1.Button1Click(Sender: TObject);
40
begin
41
 
42
  TXD (1);
43
  CheckBox1.Checked:=True;
44
end;
45
 
46
procedure TForm1.Button2Click(Sender: TObject);
47
begin
48
  TXD(0);
49
  CheckBox1.Checked:=False;
50
end;
51
 
52
procedure TForm1.FormCreate(Sender: TObject);
53
begin
54
  OPENCOM (Pchar('COM1,1200,N,8,'));
55
  Timer1.Interval:=1;
56
  Timer1.Enabled:=True;
57
end;
58
 
59
procedure TForm1.Timer1Timer(Sender: TObject);
60
begin
61
  if DCD=1 then CheckBox3.Checked:=True
62
    else CheckBox3.Checked:=False
63
end;
64
 
65
procedure TForm1.Button3Click(Sender: TObject);
66
  var i,c:integer;
67
 
68
      b:string;
69
begin
70
  b:=Edit1.Text;
71
  for c:=1 to len(b)
72
  b:=Edit1.Text[c];
73
  ord (i,b);
74
  SENDBYTE (i);
75
  edit1.text:=i
76
end;
77
 
78
end.