//pemanggilan dll untuk piranti interface// begin
function Inp32(Addr:Word):byte; stdcall;external'[Link]' data1:=$0f;
function Out32(Addr:Word;Data:byte):byte; end;
stdcall;external'[Link]'
//procedure untuk menutup atau mengecilkn tampilan
aplikasi// procedure TForm1.Button3Click(Sender: TObject);
procedure TForm1.SpeedButton14Click(Sender: TObject); begin
begin data1:=$0a;
[Link]; end;
end;
procedure TForm1.SpeedButton15Click(Sender: TObject);
procedure TForm1.SpeedButton13Click(Sender: TObject); begin
begin data:=data or $03;
[Link]:=TRUE; end;
tutup:=1;
end; procedure TForm1.SpeedButton16Click(Sender: TObject);
//procedure pengoprasian dari tombol pada tampilan monitor// begin
procedure [Link](Sender: TObject); data:=data and $fc;
begin end;
[Link]:=false;
out32 ($37a,$0a); procedure TForm1.SpeedButton17Click(Sender: TObject);
out32 ($378,$00); begin
if tutup = 5 then [Link] else data:=data or $04;
begin end;
[Link];
tutup:=tutup+1; end; procedure TForm1.SpeedButton18Click(Sender: TObject);
end; begin
data:=data or $0c;
procedure TForm1.Button1Click(Sender: TObject); end;
begin
data1:=$03; procedure TForm1.SpeedButton19Click(Sender: TObject);
end; begin
data:=data and $03;
procedure TForm1.Button2Click(Sender: TObject); end;
procedure TForm1.SpeedButton10Click(Sender: TObject); procedure TForm1.btm3Click(Sender: TObject);
begin begin
if [Link]=true then [Link]:=false;
[Link]:=false else [Link]:=true;
[Link]:=true; [Link]:=true;
[Link]:=false; [Link]:=true;
[Link]:=false; [Link]:=true;
[Link]:=false; end;
[Link]:=FALSE;
end; procedure TForm1.SpeedButton12Click(Sender: TObject);
begin
procedure TForm1.SpeedButton11Click(Sender: TObject); [Link]:=true;
begin [Link]:=false;
if [Link]=true then [Link]:=false;
[Link]:=false else [Link]:=false;
[Link]:=true; [Link]:=FALSE;
[Link]:=false; end;
[Link]:=false;
[Link]:=false; procedure TForm1.btm2Click(Sender: TObject);
[Link]:=false; begin
end; [Link]:=false;
[Link]:=true;
procedure TForm1.btm1Click(Sender: TObject); [Link]:=true;
begin [Link]:=true;
[Link]:=false; [Link]:=true;
[Link]:=false; end;
[Link]:=true; //prosedur pengoprasian secara otomatis saat program
diaktifkan//
[Link]:=true;
procedure [Link](Sender: TObject);
[Link]:=true;
begin
[Link]:=true;
[Link]:=true;
end;
IF STATUS2 AND $40=$00 THEN [Link]:=true;
begin [Link]:=true;
[Link]:=true; [Link]:=true;
[Link]:=false; [Link]:=true;
[Link]:=false; end;
[Link]:=false; end else //prosedur menonaktifkan program otomatis//
procedure [Link](Sender: TObject);
IF STATUS2 AND $20=$00 THEN begin begin
[Link]:=false; data:=$00;
[Link]:=true; data1:=$0a;
[Link]:=false; [Link]:=false;
[Link]:=false; end else out32 ($378, $00);
[Link]:=false;
IF STATUS2 AND $10=$00 THEN begin [Link]:=true;
[Link]:=false; [Link]:=false;
[Link]:=false; [Link]:=true;
[Link]:=false; [Link]:=false;
[Link]:=true; end else [Link]:=false;
begin [Link]:=false;
[Link]:=false; [Link]:=false;
[Link]:=true; [Link]:=false;
[Link]:=false; [Link]:=false;
[Link]:=false; [Link]:=false;
[Link]; end; [Link]:=false;
[Link]:=false;
[Link]:=false;
data1:=$0a; end;
[Link]:=true;
[Link]:=false; //prosedure indikator atau tampilan saat program otomatis
dijalankan//
[Link]:=true;
procedure TForm1.Timer1Timer(Sender: TObject);
[Link]:=false;
begin
[Link]:=true;
if [Link]=clred then begin
[Link]:=true;
[Link]:=clblue; [Link]:=true;
[Link]:=clblue; [Link]:=false;
[Link]:=clblue; end;
[Link]:=clred;
[Link]:=clred; end
else begin procedure [Link](Sender: TObject);
[Link]:=clred; begin
[Link]:=clred; [Link]:=true;
[Link]:=clred; [Link]:=false;
[Link]:=clblue; end;
[Link]:=clblue; end ;
end; procedure [Link](Sender: TObject);
begin
procedure [Link](Sender: TObject); if [Link] = 126 then begin
begin if [Link]=clred then
[Link]:=false; [Link]:=clwhite; end;
if STATUS1 AND $10=$00 then begin
[Link] :=150; if [Link] = 126 then begin
[Link] :=-77; if [Link]=clred then
data:=data and $f3; [Link]:=clwhite; end;
[Link]:=false;
[Link]:=true; end if [Link] = 14 then begin
else if [Link]=clred then
begin [Link]:=clwhite; end;
data:=data or $04;
[Link]:=false; if [Link] = 238 then begin
[Link]:=[Link] +1; if [Link]=clred then
[Link]:=[Link] -1; end; [Link]:=clwhite; end;
end;
if [Link]=clred then if [Link] =238 then
//prosedure pengoperasian buka tutup pintu lift// [Link]:=clwhite;
procedure [Link](Sender: TObject); if [Link]=clred then if [Link] =126 then
begin [Link]:=clwhite;
if [Link]=clred then if [Link] =14 then begin
[Link]:=clwhite; if [Link]=true then begin
[Link]:=true;
if [Link]=false then [Link]:=true;
if STATUS2 AND $80=$80 then begin [Link]:='Ready'; end else begin
[Link]:=77; [Link]:=false;
[Link]:=0; [Link]:=false;
data:=data and $f3; [Link]:='Dlm perbaikan'; end;
[Link]:=false;end else end;
begin
data:=data or $0c; procedure TForm1.CheckBox4Click(Sender: TObject);
[Link]:=[Link] -1; begin
[Link]:=[Link] +1; end; [Link]:=false;
end;
end;
//prosedur seting lantai yang dapat beroperasi//
procedure TForm1.CheckBox2Click(Sender: TObject); procedure TForm1.CheckBox5Click(Sender: TObject);
begin begin
[Link]:=false; if [Link]=true then begin
end; [Link]:=true;
[Link]:=true;
procedure TForm1.CheckBox1Click(Sender: TObject); [Link]:='Ready'; end else begin
begin [Link]:=false;
if [Link]=true then begin [Link]:=false;
[Link]:=true; [Link]:='dlm perbaikan'; end;
[Link]:=true; end;
[Link]:='Ready'; end else begin procedure TForm1.CheckBox6Click(Sender: TObject);
[Link]:=false; begin
[Link]:=false; [Link]:=false;
[Link]:='Dlm perbaikan'; end;
end; end;
procedure TForm1.CheckBox3Click(Sender: TObject); //prosedure naik turun lift//
end;
procedure TForm1.lt3Timer(Sender: TObject);
begin procedure TForm1.lt2uTimer(Sender: TObject);
begin
If [Link]=false then
if [Link]=false then
if [Link]=false then if [Link]=clwhite then
if [Link]=clwhite then if [Link]=false then
if [Link] = clred then begin if [Link]=false then
posisi:=238; if [Link]=false then
[Link]:=true; if [Link] = clred then begin
if [Link]=238 then begin posisi:=14;
[Link]:=true; [Link]:=true;
[Link]:=false; end; end; if [Link]=14 then begin
[Link]:=true;
if [Link]=false then [Link]:=false; end; end;
if [Link]=false then
if [Link]=false then if posisi=238 then
if [Link] = clred then begin if [Link]=false then
posisi:=126; if [Link]=false then
[Link]:=true; if [Link]=false then
if [Link]=126 then begin if [Link]=clwhite then begin
[Link]:=true; [Link]:=true;
[Link]:=false; end; end else [Link]:=false; end;
end;
if [Link]=clwhite then
if [Link]=false then
procedure TForm1.SpeedButton1Click(Sender: TObject); if [Link]=false then
begin if [Link]=false then
[Link]; if [Link] = clwhite then
if [Link] =14 then begin if [Link] = clred then begin
[Link]:=false; posisi:=238;
[Link]:=true; end; [Link]:=true;
if [Link]=238 then begin begin
[Link]:=true; [Link]:=clred;
[Link]:=false; end; end; [Link]:=clred;
end; if [Link] =238 then [Link]:=true;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin procedure TForm1.SpeedButton6Click(Sender: TObject);
[Link]; begin
if [Link] =126 then begin [Link]:=clred;
[Link]:=false; [Link]:=clred;
[Link]:=true; end; if [Link] =126 then [Link]:=true;
end; end;
procedure TForm1.SpeedButton3Click(Sender: TObject); procedure TForm1.SpeedButton7Click(Sender: TObject);
begin begin
data:=data or $01; [Link]:=clred;
end; [Link]:=clred;
if [Link] =14 then [Link]:=true;
procedure TForm1.SpeedButton9Click(Sender: TObject); end;
begin
[Link]; procedure TForm1.lt1Timer(Sender: TObject);
if [Link] =238 then begin begin
[Link]:=false;
[Link]:=true; end; if [Link]=false then
end; if [Link]=false then
if [Link]=false then
procedure [Link](Sender: TObject); if [Link]=clwhite then
begin if [Link] = clred then begin
[Link]:=true; posisi:=14;
[Link]:=false; [Link]:=true;
end; if [Link]=14 then begin
[Link]:=true;
procedure TForm1.SpeedButton5Click(Sender: TObject); [Link]:=false; end; end;
[Link]:=false; end;
if [Link]=false then
if [Link]=false then if [Link]=clwhite then
if [Link]=false then if [Link]=false then
if [Link] = clred then begin if [Link]=false then
posisi:=126; if [Link]=false then
[Link]:=true; if [Link] = clwhite then
if [Link]=126 then begin if [Link] = clred then begin
[Link]:=true; posisi:=14;
[Link]:=false; end; end; [Link]:=true;
if [Link]=14 then begin
end; [Link]:=true;
[Link]:=false; end; end;
procedure TForm1.lt2dTimer(Sender: TObject); end;
begin
procedure [Link](Sender: TObject);
if [Link]=clwhite then begin
if [Link]=false then [Link]:=false;
if [Link]=false then
if [Link]=false then if [Link] = posisi then
if [Link] = clred then begin [Link]:='Diam' else
posisi:=238; [Link]:='Naik';
[Link]:=true;
if [Link]=238 then begin if [Link] <= posisi then begin
[Link]:=true; data1:=$0a;
[Link]:=false; end; end; data:=data and $fc;
[Link]:=true;
if posisi=14 then [Link]:=false;end
if [Link]=false then else begin
if [Link]=false then [Link]:=[Link]-1;
if [Link]=false then data1:=$03;
if [Link]=clwhite then begin data:=data or $03; end;
[Link]:=true;
end; [Link];
procedure [Link](Sender: TObject); //inisialisasi untuk piranti masukan//
begin
[Link]:=false; out32 ($37a,data1 and $fe);
STATUS1:=INP32 ($379);
if [Link]=posisi then out32 ($37a,data1 or $01);
[Link]:='Diam' else STATUS2:=INP32 ($379);
[Link]:='Turun';
IF STATUS1 AND $80=$00 THEN
if [Link] >= posisi then begin [Link]:=CLRED
data1:=$0a; ELSE begin
data:=data and $fc; [Link]:=CLWHITE;
[Link]:=true; if [Link]=true then
[Link]:=false; [Link]; end;
end
else begin IF STATUS1 AND $40=$40 THEN
[Link]:=[Link]+1; [Link]:=CLRED
data1:=$0f; ELSE begin
data:=data or $01;end; [Link]:=CLWHITE;
end; if [Link]=true then
[Link]; end;
//prosedur pengenalan koneksi alat dengan program//
procedure [Link](Sender: TObject); IF STATUS1 AND $20=$20 THEN
begin [Link]:=CLRED
ELSE begin
IF STATUS2 AND $40=$00 THEN [Link]:=CLWHITE;
[Link]; if [Link]=true then
[Link]; end;
IF STATUS2 AND $20=$00 THEN
[Link]; IF STATUS1 AND $10=$10 THEN
[Link]:=CLRED ELSE
IF STATUS2 AND $10=$00 THEN [Link]:=CLWHITE;
IF data AND $01=$01 THEN
IF STATUS2 AND $80=$00 THEN [Link]:=CLRED ELSE
[Link]:=CLRED ELSE [Link]:=CLWHITE;
[Link]:=CLWHITE;
IF data AND $02=$02 THEN
IF STATUS2 AND $40=$40 THEN [Link]:=CLRED ELSE
[Link]:=CLRED [Link]:=CLWHITE;
ELSE begin
[Link]:=CLWHITE; IF data AND $04=$04 THEN
[Link]:='3'; [Link]:=CLRED ELSE
[Link] := 14; [Link]:=CLWHITE;
[Link]:='Lantai-3'; end;
IF data AND $08=$08 THEN
IF STATUS2 AND $20=$20 THEN [Link]:=CLRED ELSE
[Link]:=CLRED [Link]:=CLWHITE;
ELSE begin
[Link]:=CLWHITE; IF data AND $10=$10 THEN
[Link]:='2'; [Link]:=CLRED ELSE
[Link] := 126; [Link]:=CLWHITE;
[Link]:='Lantai-2'; end;
IF data AND $20=$20 THEN
IF STATUS2 AND $10=$10 THEN [Link]:=CLRED ELSE
[Link]:=CLRED [Link]:=CLWHITE;
ELSE begin
[Link]:=CLWHITE; IF data AND $30=$30 THEN
[Link]:='1'; [Link]:=CLRED ELSE
[Link] := 238; [Link]:=CLWHITE;
[Link]:='Lantai-1'; end;
IF data AND $40=$40 THEN
//inisialisasi untuk piranti keluaran// [Link]:=CLRED ELSE
[Link]:=CLWHITE;
out32 ($378,data);
out32 ($37a,data1);
begin
if [Link]=clred then decodedate(date,tahun,bulan,hari);
data:=data or $20 else decodetime(time,jam,menit,detik,milidetik);
data:=data and $df; [Link]:= inttostr(hari)+'-'+
inttostr(bulan)+'-'+
if [Link]=clred then inttostr(tahun)+ ' / '+
data:=data or $40 else inttostr(jam)+':'+
data:=data and $bf; inttostr(menit)+':'+
inttostr(detik);
if [Link]=clred then
data:=data or $80 else end;
data:=data and $7f;
if data1=$03 then [Link]:=clred
else [Link]:=clwhite; end.
if data1=$0f then [Link]:=clred
else [Link]:=clwhite;
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
[Link]:=TRUE;
[Link]:=false;
[Link]:=false;
[Link]:=false;
[Link]:=FALSE;
end;
//prosedure tampilan jam dan tanggal//
procedure [Link](Sender: TObject);
var
jam,menit,detik,milidetik,tahun,bulan,hari:word;