7. PLC Addressing & Basic Instruction
(
Omron, Siemens, Schneider)
Handy Wicaksono
Jurusan Teknik Elektro
Universitas Kristen Petra
Sasaran
Mahasiswa mampu :
{ Memahami bermacam – macam sistem
bilangan
{ Memahami macam – macam
pengalamatan dan instruksi PLC Omron, Siemens, Schneider
{ Memahami instruksi – instruksi dasar
Sistem Bilangan
1.
Sistem bilangan desimal
2.Sistem bilangan biner
3.
Sistem bilangan BCD (binary coded
desimal)
4.
Sistem bilangan oktal
Sistem Desimal
Bilangan desimal menggunakan 10 digit
bilangan : 0 - 9 2 2 710 Å bilangan desimal 7 x 100 = 7 2 x 101 = 20 2 x 102 = 200 Bilangan Desimal Æ 22710 1s 10s 100s 1000s
Sistem Bilangan Biner
Bilangan biner hanya menggunakan 2 digit bilangan
: 0 dan 1
1s 2s
4s 8s
Bobot pada Sistem Biner
3 1 1 0 0 2 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1s 2s 4s 8s Desimal Biner
Sistem Bilangan Biner
Å bilangan biner 1 x 20 = 1 0 x 21 = 0 1 x 22 = 4 Bilangan Desimal Æ 20510 1 0 1 1 0 0 1 1 7 6 5 4 3 2 1 0 Nomor bit 1 x 23 = 8 0 x 24 = 0 0 x 25 = 0 1 x 26 = 64 1 x 27 = 128 Least Significant Bit Most Significant BitSistem
Binary Coded Decimal
BCD : Pencampuran antara sistem
biner dan desimal
4 bit digunakan untuk menampilkan
bilangan desimal (0 sampai 9)
Pada PLC, umumnya digunakan untuk
operasi matematis, karena manusia
umumnya menggunakan desimal
Sistem
Binary Coded Decimal
Bilangan Desimal 9 7 3
0111 0011
1001
Binary Coded Decimal
Perhatian : BCD tidak sama dengan bilangan biner!
973 (desimal) ialah 1001 0111 0011 (BCD) sedangkan biner 0011 1100 1101
Sistem
Octal
Menggunakan 8 digit (0 – 7).
1s 8s 64s 512sBobot pada Sistem Oktal
3 2 0 78 Å bilangan oktal 7 x 80 = 7 0 x 81 = 0 2 x 82 = 128 Bilangan Desimal Æ 167110 3 x 83 = 1536
Sistem
Octal
Beberapa pembuat PLC
menggunakan sistem oktal untuk
penomoran memory
Sistem Heksadesimal
Menggunakan 16 digit { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 1s 16s 256s 4096sBobot pada Sistem Heksadesimal
2 0 D16 Å bilangan hex D x 160 = 13
0 x 161 = 0
2 x 162 = 512
Sistem Heksadesimal
Konversi hexadesimal Æ binary
Hex 7 D 3 F 1101 0011 0111 0111110100111111 1111 Binary
Sistem Heksadesimal
Beberapa pembuat PLC
menggunakan sistem heksadesimal
untuk penomoran memory
{ Contoh : Omron, Modicon – Schneider,
Pengalamatan PLC –
Banyak sekali merk PLC!
Banyaknya merk PLC menyebabkan :
{ PLC addressing yang berbeda – beda
{ Instruksi – instruksi yang berbeda
{ …..
Namun semuanya perlu dikuasai
Perlu mempelajari berbagai
merk PLC
Kuliah :
{ PLC Schneider : Zelio, Concept (PLC
simulator) { PLC Omron,…
Praktikum :
{ PLC Omron { PLC Siemens { PLC SchneiderAddressing
Address/alamat
:
{ Identitas untuk komponen – komponen
ladder diagram.
Masing – masing vendor punya
PLC Omron Addressing (1)
IR 000 00
Data Area/ Memory Area Channel/ Word BitPLC Omron Addressing (2)
Data area / Memory area :
{ Wilayah memori / alamat tertentu
{ Sebagai identitas
Channel / word
{ Mewakili 16 bit data
Bit
PLC Omron Addressing (3)
Channel IR 000, terdiri dari :
IR 00000 IR 00008 IR 00001 IR 00009 IR 00002 IR 00010 IR 00003 IR 00011 IR 00004 IR 00012 IR 00005 IR 00013 IR 00006 IR 00014 IR 00007 IR 00015 16 bit!
PLC Omron Addressing (4)
00000 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 1 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 CH 000 Channel 000 Bit 00 to Bit 15 8 7 9 B (heksa) 1 0 1 1 Æ B (heksa) 1 0 0 1 Æ 9 (heksa) 0 1 1 1 Æ 7 (heksa) 1 0 0 0 Æ 8 (heksa) Least Significant Bit (LSB)PLC Omron Addressing (5)
Alamat berbasis sistem bilangan
heksadesimal (1 word = 16 bit)
Dalam beberapa hal juga
PLC OMRON - Memory Area
Internal Relay Special Relay Temporary Relay Holding Relay Area Relay Link Relay Timer/ Counter Data MemoryPLC OMRON CPM1
Memory Area
PLC OMRON CPM1
Memory Area
OMRON-Memory Area
IR (Internal Relay)
1. Input Area Æ bit terminal input eksternal
2. Output area Æ bit terminal output
eksternal
3. Work area Æ bit internal yang dapat
digunakan dalam programming
Merupakan alamat yang paling sering
digunakan dalam pemrograman
OMRON - Memory Area
SR (Special Relay) –
AR (Area Relay)
{ Bit yang menjalankan fungsi khusus dari
PLC
{ Contoh :
SR 25313 : flag yang selalu bernilai 1 SR 25502 : flag yang memberikan pulsa
setiap 1 detik
SR 25504 : carry flag yang menyala untuk
OMRON – Memory Area
TR (Temporary Relay)
{ Bit yang hanya menyimpan data
sementara saja
{ Umumnya muncul dalam operasi
aritmetika
HR (Holding Relay)
{ Bit yang tetap menyimpan data dan
kondisinya (ON/OFF) meskipun PLC dimatikan
OMRON – Memory Area
LR (Link Relay)
{ Alamat yang digunakan untuk kebutuhan
jaringan PLC one to one
Timer/Counter
{ Alamat untuk timer dan counter
{ Karena disimpan dalam 1 area, maka
nomor timer dan counter tidak boleh sama
OMRON – Memory Area
DM (Data Memory)
{ Untuk pengolahan data dalam word
{ Untuk pengaturan setting PLC
{ Untuk menampilkan error code saat
terjadi error
Hanya dapat dibaca dalam word, bukan bit
Contoh : DM 0000 Æ dapat diisi data word
Basic instruction –
General contact & coil
Harus diberikan pada akhir program
Alamat menunjuk pada IR
0000 = IR00000 1000 = IR01000
Contoh :
1.
Basic instruction –
Transition Contact
Positive Trans. : Differential Up DIFU(13)
Negative Trans. : Differential Down DIFD(14)
Basic instruction –
Transition Contact
IR 20001 akan menyala selama 1 scan time saat IR 00005 aktif
Basic instruction –
Latch Coil
Latching coil : KEEP(11)
Aktifkan KEEP
Reset KEEP
IR 00000 IR 00006 HR 0100
PLC Siemens
I 3 . 4
Bit of byte or bit number Period separates byte address from bit number Byte address Area Identifier 7 6 5 4 3 2 1 0 MSB LSB I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 MSB = Most Significant Bit
Data Memory for SIEMENS
S7-200 CPU 212
C0 to C63 Counter C T0 to T63 Timer T V0.0 to V1023.7 Variable memory V SM0.0 to SM45.7 Special memory bitSM
M0.0 to M15.7 Internal memory bit
M Q0.0 to Q7.7 Output Q I0.0 to I7.7 Input I SIEMENS S7-200 CPU 212 Data Area Area Identifier
Data Memory for SIEMENS
S7-200 CPU 212
Input
{ Merupakan terminal untuk input fisik.
Output
{ Merupakan terminal untuk output fisik.
Internal Memory
{ Mewakili control relay, tidak ada barang fisik
yang terhubung.
{ Digunakan untuk menyimpan status
Data Memory for SIEMENS
S7-200 CPU 212
Special Memory
{ Ditentukan oleh manufacturer.
{ Memberikan status dan fungsi kontrol untuk
PLC.
Variable Memory
{ Untuk operasi baca ataupun tulis. Terbagi
menjadi 2 :
Bagian pertama dari V memory (Data Block 1/DB1),
terdiri dari 128 bit (V0 – V127). Selain disimpan di RAM, data juga dibackup ke EEPROM (non-volatile memory).
Bagian ke dua dari V memory (Data Block 1/DB1),
terdiri dari 896 bit (V128 – V1023). Data disimpan di RAM saja.
Data Memory for SIEMENS
S7-200 CPU 212
Timer
{ Alat untuk menghitung pertambahan
waktu
Counter
{ Alat untuk menghitung jumlah
perpindahan dari low ke high pada input
Contoh
Counter
PLC Schneider
Konfigurasi
Addresing
Instruksi dasar, normal dan special
coild dan contact
Addressing I/O module objects in
Addressing I/O module objects in
TSX 37
TSX 37
-
-
10/21/22
10/21/22
Addressing of the main word and bit objects in I/O modules is defined as follows :
% I or Q X, W, or D x . i Symbol Type of object I = Input Q = Output Position 1 to 8 (TSX 37-10) 1 to 10 (TSX 37-21/22) Format X = Boolean W = Word D = Double Word Channel Number
EXAMPLE :
Addressing I/O module objects in TSX
Addressing I/O module objects in TSX
37
37
-
-
10/21/22
10/21/22
1 2 3 4 5 6 7 8 % Q4.0 % I1.3 % IW5.3Input Word from Position 5 channel 3
Input Bit from
Position 1 channel 3
Output Bit from Position 4 channel 0
Data Memory Structure
Data Memory Structure
37-10 37-21/22
default 1 Kwords 2 Kwords
max 1 Kwords 17.5 Kwords Data
Program Constants
System words 128 words std. function blocks per block
Timer %TMI 4 words Timer %Ti 4 words Counter %Ci 3 words Monostable %MNi 4 words Registers %Ri 4 words Drum controller
%DRi 4 words
Internal words %MWi 1 word
%MDWi 2 words per module and per channel
%IW : 0 to 127 words (input)
%QW : 0 to 127 words (output)
%MW : 0 to 127 words (internal)
%KW : 0 to 127 words (constants)
%NW{j}k : common words