Anda di halaman 1dari 18

Departement of Engineering Physics-ITB Agustus 2004

Fundamental of PLC’s
Programming
Industrial Automation Research Group
Instrumentation and Control Laboratory
Bandung Institute of Technology
2004

Programmable Logic Controller (PLC) 4-1


Departement of Engineering Physics-ITB Agustus 2004

Objektif :
 Mengidentifikasikan dan mendefinisikan fungsi dari pemetaan
memori di PLC
 Menggambarkan input dan output dalam image table files
 Menggambarkan sekuensial pen-scan-an program
 Memahami bagaimana bahasa ladder program, Boolean, SFC dapat
mengkomunikasikan informasi ke PLC
 Mendefinisikan dan mengidentifikasi fungsi instruksi relay
 Mengidentifikasikan mode operasi yang sering ditemukan di PLC
 Membuat ladder program

Programmable Logic Controller (PLC) 4-2


Departement of Engineering Physics-ITB Agustus 2004

Memory Space

Data Table :
I/O Locations
101010011011011
101101101010110
100010101000010
Timer/Counter Locations
100010110111010
User Program :
Ladder Logic, SFC, IL, ST, FBD

Housekeeping Memory :
Functions

Programmable Logic Controller (PLC) 4-3


Departement of Engineering Physics-ITB Agustus 2004

Processor Files
 Processor Files adalah kumpulan dari kedua file data dan file program. Terdiri
dari semua instruksi, data dan informasi konfigurasi
Word Address Bit Address

Processor work Area #1 000 00


Output Image Table File
Bit/Word Storage
Reversed
Timer/Counter
Processor Work Area #2
Output Image Table File
Bit/Word Storage
Reversed
Timer/Counter
Expanded File End Of Memory
Programmable Logic Controller (PLC) 4-4
Departement of Engineering Physics-ITB Agustus 2004

Processor Files
 System Program (file 0) - file ini selalu ada dalam setiap sistem
processor, mengandung informasi yang berkaitan dengan tipe
processor, konfigurasi I/O, file name processor, dan password
 Reserved (file 1) – file temporari space untuk processor
 Main Ladder Program (file 2) - program yang dibuat User untuk
mendefinisikan bagaimana processor bekerja dengan baik
 Subroutine Ladder Program (file 3) – subroutine yang hanya bisa
diaktivasi oleh instruksi subroutine dalam ladder

Programmable Logic Controller (PLC) 4-5


Departement of Engineering Physics-ITB Agustus 2004

Data Files
Program
Files
Program
Files

0 Output Image
1 Input Image
0 System Functions 2 Status
3 Bit
1 Reserved 4 Timer
5 Counter
2 User Program
6 Control
3 Subroutine Program 7 Integer
3 – 255 8 Reserved
Bit
Timer
Counter
Integer
10 - 255
Programmable Logic Controller (PLC) 4-6
Departement of Engineering Physics-ITB Agustus 2004

Data File Organization for Allen Bradley PLC


O0:000 – O0:037 Address Range 0 Output Image 32 (size in Element)

I1:000 – I1:037 1 Input Image 32

S2:000 – S2:031 2 Status 32

B3:000 – B3:999 3 Bit 1-1000

T4:000 – T4:999 4 Timer 1-1000

C5:000 – C5:999 5 Counter 1-1000

R6:000 – R6:999 6 Control 1-1000

N7:000 – N7:999 7 Integer 1-1000

F8:000 – F8:999 8 Float 1-1000

Programmable Logic Controller (PLC) 4-7


Departement of Engineering Physics-ITB Agustus 2004

Typical Address Format


 Output data file dan Input data file merepresentasikan lokasi dari channel
dan modul dalam chassis PLC
 Status data file mengandung informasi mengenai status prosesor
 Bit data file menyimpan status bit. Bisa juga digunakan untuk internal
output, sequencer, instruksi bit shift dan intruksi logika :
 Timer file menyimpan status timer dan data timer. Elemen timer terdiri dari 3
word, yaitu : control word, preset word dan accumulate word.
 Counter file menyimpan counter status dan data counter. Elemen counter
terdiri dari 3 word, yaitu : control word, preset word dan accumulate word
 Control file menyimpan status elemen control dan data, digunakan untuk
mengontrol berbagai instruksi file. Elemen control terdiri dari 3 word, yaitu :
control word, length word dan position word.
 Integer file dapat menyimpan besaran data integer dengan rentang -32.768
sampai 32.767. disimpan dalam bentuk desimal. Elemen integer adalah
elemen tunggal word 16 bits.
 Floating-point file menyimpan besaran dengan rentang
 1.1754944e 38 sampai  3.402837e 38
Programmable Logic Controller (PLC) 4-8
Departement of Engineering Physics-ITB Agustus 2004

Koneksi Input Image dengan Table File


Input Module

Processor secara kontinyu membaca input


status dan mengupdatenya di image table
file

0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

1 Input Image

000000000000100

0 Output Image
Data Table File
Programmable Logic Controller (PLC) 4-9
Departement of Engineering Physics-ITB Agustus 2004

Koneksi Output Image dengan Table File


Output Module

Processor secara kontinyu membaca


Output status dan mengupdatenya dari
image table file

0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0

0 Output Image

000000000000100

1 Input Image
Data Table File
Programmable Logic Controller (PLC) 4 - 10
Departement of Engineering Physics-ITB Agustus 2004

Program Scan
Program Scan adalah POWER ON

siklus kontinyu dari Scanning


Real Input
Input
pembacaan input PLC,
memecahkan logika LLD,
kemudian mengubah
output

Scanning
New
Operation
Output
Execution!

Programmable Logic Controller (PLC) 4 - 11


Departement of Engineering Physics-ITB Agustus 2004

Scan Process
Input Module Output Module

Output Signal
Input Signal

word 000000000000011 000000000000001 word

Input Image Output Image


Table File Table File

I:000/0 I:000/1 O:000/0

Programmable Logic Controller (PLC) 4 - 12


Departement of Engineering Physics-ITB Agustus 2004

Bahasa Pemrograman PLC


 Ladder Logic (LL)
 Sequential Function Chart (SFC)
 Function Block Diagram (FBD)
 Structured Text (ST)
 Instruction List (IL)

Programmable Logic Controller (PLC) 4 - 13


Departement of Engineering Physics-ITB Agustus 2004

Ladder Logic
 Bahasa Ladder Logic adalah bahasa yang paling sering digunakan di
sebagian besar PLC

Programmable Logic Controller (PLC) 4 - 14


Departement of Engineering Physics-ITB Agustus 2004

Sequential Function Chart


 SFC adalah metoda pemrograman sistem kontrol yang
menggunakan pendekatan lebih tersetruktur.
 SFC terdiri dari function block (step dan unit transisi)

Start
Step

unit transisi

End

Programmable Logic Controller (PLC) 4 - 15


Departement of Engineering Physics-ITB Agustus 2004

Function Block Diagram


 FBD adalah unit program terorganisasi dalam sauatu block yang
dapat menyediakan besaran keluaran berdasarkan besaran input,
parameter dan algoritma dalam unit ini
 Dapat digunakan secara berulang pada beberapa bagian program
dengan harga masukan yang berbeda sehingga menghasilkan
keluaran yang berbeda pula

Input A ADD_INT

Input B MUL_INT
Result

Input C SUB_INT

Input B

Programmable Logic Controller (PLC) 4 - 16


Departement of Engineering Physics-ITB Agustus 2004

Instruction List
 Penulisan program berbasis teks
 Mirip dengan bahasa pemrograman tingkat rendah lain seperti
Assembly

 Contoh Program :

>>>>>>>>>>>>>>>>>>>>Instruction List
Start>>>>>>>>>>>>>>>>>>>>
Start LD 100000
AND 100001
AND NOT 100002
OUT 000001
>>>>>>>>>>>>>>>>>>>>Instruction List End>>>>>>>>>>>>>>>>>>>>

Programmable Logic Controller (PLC) 4 - 17


Departement of Engineering Physics-ITB Agustus 2004

Structured Text
 Penulisan program berbasis teks
 Mirip dengan bahasa pemrograman tingkat tinggi lain seperti Basic,
Pascal
 Contoh Program :

>>>>>>>>>>>>>>>>>>>>Structured Text Start>>>>>>>>>>>>>>>>>>>


(*Invocation*)
(*Int*) :- DIV_INT (IN1 :=, (*INT*)
IN2 := (*INT*));
LD 100000
ADD 100001
OUT 000002
>>>>>>>>>>>>>>>>>>>>Structured Text End>>>>>>>>>>>>>>>>>>>

Programmable Logic Controller (PLC) 4 - 18

Anda mungkin juga menyukai