You are on page 1of 94

Introduction to

Basic Programmable Logic


Controller Training
Presented by

Elcomp Trading Sdn Bhd


Course Contents
 Introduction of Control System
~ Control Panel, Input, Output
 Conventional Hardwired Logic
 Introduction to PLC
 What PLC can do?
 The Advantages of using PLC
 Application of PLC
Theory of Operation
What is a PLC?
 A PLC is a device that was invented to replace the
necessary sequential relay circuits for machine
control.
 The PLC works by monitor its inputs and
depending upon their state, turning on/off its
outputs.
 The user enters a program, usually via software,
that gives the desired results.
Relay
Replacing Relays
Contact Symbol
PLC History

 In the late 1960's PLCs were first introduced to


replace complicated relay based control systems.
 In 1970's, the dominant PLC technologies were
sequencer state-machines. Communications
abilities began to introduced for PLCs.
 In 1980's, an attempt to standardize
communications with Manufacturing Automation
Protocol(MAP).
 In 1990’s, an attempt to standardize PLC
programming languages under one international
standard: IEC 1131-3.
Input signals from sensors, switches,etc
Inside the PLC
Relays
Redundancy

Voltage Hardwire
PLC
Regulator Logic

Relays

Isolation
Output signals to pump, mixer, etc
Inside the PLC
 Input Relays - (contacts)
– connected to the outside world
– physically exist and receive signals from
switches, sensors, etc..
 Internal Relays - (contacts)
– do not receive signals from the outside world
nor do they physically exist
– simulated relays and are what enables a PLC to
eliminate external relays
– also some special relays that are dedicated to
performing only one task
Inside the PLC

 Counters
– do not physically exist
– simulated counters and they can be
programmed to count pulses
– limited in their counting speed
– high-speed counters that are hardware based
 Timers
– do not physically exist
– on-delay and off reset
– increments vary from 10ms through 100ms
Inside the PLC
 Output Relays (coils)
– connected to the outside world
– physically exist and send on/off signals to
solenoids, lights, etc
– can be transistors, relays, or triacs depending
upon the model chosen
 Data Memory
– registers assigned to store data for math or data
manipulation
– can also typically be used to store data when
power is removed from the PLC
Types of Memory

 ROM: Read Only Memory


 RAM: Temporary storage area, need battery
backup
 EPROM: Erasable Programmable Read Only
Memory
 EEPROM: Electrical Erasable Programmable Read
Only Memory

 Note :Battery is used for backup the data


in the RAM in PLC when Power Off
How PLC Work?
Power Supply

Signals
I Memory O
u Signals to
n
from t solenoids,
p
Switches, u CPU p
u motor,
Sensors, t t lamps,
etc etc.

Programming
Device

A PLC monitors inputs, makes decisions based on its program, and


controls outputs to automate a process or machine.
How PLC Work?
Response Time (Scan Time)
Types of PLC

1. Nano Brick Style


2. Compact PLC Series
3. Modular PLC Series
4. Rack PLC Series
Nano Brick Style

ZEN

Expandable to 44 I/O
Low Cost Model 20 I/O max
Compact PLC Series

CP1H CPM1A CPM2A


The all in one PLC Compact & economical The universal small
machine controller

CPM2B CPM2C
Brick Style Micro The versatile slim-line
Controller Board Package controller
Modular PLC Series

CQM1H CJ1
The original backplane-less The entry-level modular PLC
modular PLC with a big potential
Rack PLC Series

CS1 CS1D
Suitable for any job: the The dual-redundant PLC
rack-based PLC with over system for never-fail control
200 types of I/O units
Omron CPM1A CPU Models

Numbers of Power M odel Inputs Outputs


I/O Terminal Supply
10 AC CPM 1A-10CDR-A 6 points 4 points
DC CPM 1A-10CDT-D
20 AC CPM 1A-20CDR-A 12 points 8 points
DC CPM 1A-20CDT-D
30 AC CPM 1A-30CDR-A 18 points 12 points
DC CPM 1A-30CDT-D
40 AC CPM 1A-40CDR-A 24 points 16 points
DC CPM 1A-40CDT-D
Expansion Unit Example

• CPM1A-20EDR
12 Input / 8 Output point

• CPM1A-SRT21 CompoBus/S I/O unit


Connect the I/O in 500m away

• CPM1A-MAD01 Analog I/O unit


2 analog Input : 0~10V, 1~5V, 4~20mA.
1 analog Output : 0~10V, -10~10V, 4~20mA
CPU Status Indicators

Indicator Status Meaning


PWR (Green) ON Power supply to PLC
OFF Power not supply to PLC
RUN (Green) ON RUN or MONITOR mode
OFF PORGRAM mode or Fatal error occurred
ERR/ALM (Red) ON Fatal error (PLC operation stops)
Flash Non-fatal error (PLC operation continue)
COMM (Orange) ON Data being transfer
OFF Data not being transfer
Memory Area Functions
Data Area Function
Bits are allocated to external I/O
IR (Internal Relay) terminals. Some can be freely
used within program
Serve for specific function such
SR
as flags & control bits.
Used to temporarily store status at
TR
program branches.
Serve for specific function such
AR
as flags & control bits.
Used for data link with another
LR
PLC
Same numbers are used for timers
TC
& counters.
Word values are retained when
DM
power off.
Assignment of I/O

• I/O Numbers
- The input and output device (I/O device) are
managed by number only.
- These numbers are called I/O numbers and are
composed of channel (CH) and bits (bit).
PLC Channel Register

• Storage location in PLC


• 16 bits
• Each bit holds the status of True or False (1 or 0)
• PLC Address 000.01 = channel 000 bit 01
• PLC Address 010.00 = channel 010 bit 00
PLC I/O Addressing
For CPM1A & CPM2A
(5 digit) Channel Bit

000 00
Input
CH 0 : 000.00, 000.01, 000.02, 000.03, …, 000.11
(000.12, 000.13, 000.14, 000.15)
CH 1 : 001.00, 001.01, 001.02, …, 001.14, 001.15
Output
CH 10 : 010.00, 010.01, 010.02, …, 010.07
(010.08, 010.09, …, 010.14, 010.15)
CH 11 : 011.00, 011.01, 011.02, …, 011.14, 011.15
Introduction to Control System
(Control Panel)

Start & Stop


Operation
What is inside the control panel?

Contactors, relays, timers & counters


in the control panel
Control System
(Input)

Flow Rate

Float Level

Oxygen Level
Control System
(Output)

Motor pump

Valve

Mixer
Input Device

Proximity Photoelectric Fiber Optic


Switch Sensor Sensor

Limit Switches Encoder


Output Device

Injection Molding
Machine Tower Light
NS Series Touch screen
NT Series Touch Screen
Positioning Control with PLC
Conventional
Hardwire Logic
Hardwire Logic Control Circuit

Start Stop
Relay 1
Relay 1

Relay 1 Solenoid
Timer
Timer
Pump
Conventional Relay Control Panel
What PLC can do?
1. Sequence Control

Relays

Timers & Counters


2. Sophisticated Control
+
-
x
/
Arithmetic Operation

Prod Pass Reject 2


3 4
5
AA 33 4 1

BB 27 3
CC 43 8

Analog Control
Information Handling
3. Supervisory Control

Computer

Printer
FA
Network
Pager
Process Monitoring
The advantages of Using PLC
 Smaller physical size than hard-wire solutions.
 Easier and faster to make changes.
 Diagnostics are centrally available.
 Applications can be immediately documented.
 Applications can be duplicated faster and less
expensively.
 Fast project implementation time
 Low operating cost
 Increase productivity
PLC Vs Relay Based Control System
Control Device
Wired Logic PLC

General Purpose
Specific Purpose
Control sequence can be
Control sequence is changed from time to time
fixed for one design without rewire
Control Scale
Small & Medium Medium & Large

Wired Logic PLC


Modification
The same example for PLC control system

Mnemonic Code
LD START
Relay 1 OR RELAY 1
Relay 1 AND NOT STOP
OUT RELAY1
Relay 1
Solenoid OUT SOLENOID
Timer
LD RELAY 1
TIM 000
Timer #0020
Pump LD TIM 000
OUT PUMP
Modification
The same example for PLC control system

Mnemonic Code
LD START
OR RELAY 1
AND NOT STOP
OUT RELAY1
OUT SOLENOID
LD RELAY 1
LD STOP
CNT 000
#0030
LD CNT 000
OUT PUMP

Only need to change the ladder program


Delivery Period

Several days Almost Immediate

Wired Logic PLC


Maintenance
Easy
Difficult

Programming
LED indicator Console
Input/output connector
can be remove easily
without using screw driver
Wired Logic
PLC
Economic Efficiency

Advantage on Advantage on
small scale small, medium
and large

Wired Logic
$$$ PLC
Power Consumption

High Low

> 2 Amp 0.2 Amp

Wired Logic PLC


Applications Of PLC

 Material Handling  Power Plant


 Packaging Machine  Disk Drive
 Pump Control Manufacturing
 Water Treatment  Traffic Light System
 Paper & Pulp  Car Manufacturing
Industries  Building Automation
 Cement  IC Manufacturing
Manufacturing  Amusement Park
 Electroplating Plants Control
The Programming Console

Operating Mode
PROGRAM - Used for inserting or

Mode of for modification

Selection existing program.


MONITOR - Changing the contents
of the memory while
PLC is operating.
RUN - To execute program.
No changes can be made.
Start
Programming
Password Input

< PROGRAM>
PASSWORD!

CLR MONITOR CLR 0000


Clearing All Program

< PROGRAM>

CLR 0000

* PLC program and memory will be cleared after the following stroke!!!

CLR SET NOT RESET

0000 MONITOR CLR


MONTR CLR
END HR CNT DM
Overview of Instruction

FUN NOT SHIFT

LD OUT 0

AND TIM CHG

OR CNT WRITE
Basic Instruction
1. LD / LD NOT
2. OUT / OUT NOT
3. END
4. AND / AND NOT
5. OR / OR NOT
6. AND LD
7. OR LD
8. TIM
9. CNT
LD / LD NOT
 The first condition that starts any logic block within
a ladder diagram corresponds to a
LD or LD NOT instruction.

 LD - Normally Open contact,


examine if On

 LD NOT - Normally Close contact,


examine if Off
OUT / OUT NOT

 The OUT instruction is like a relay coil.


 When there is a path of True instruction
preceding this on the ladder rung, it will also be
True.
 When the instruction is True it is physically On.
 We can think of this instruction as a normally
open output.
 This instruction can be used for internal coils and
external outputs.
 The OUT NOT instruction is the reverse logic of
OUT instruction.
END (01)

 The last instruction required to complete a


simple program is the END instruction.
 When the CPU scan the program, it executes all
instructions up to the first END instruction
before returning to the beginning of the program
and begin the execution again.

END
AND / AND NOT

 When 2 or more conditions lie in series on the


same instruction line, the first one correspond
to a LD or LD NOT instruction, and the rest of
the conditions, to AND or AND NOT
instructions.
 AND - taking the logical AND of the execution
condition
 AND NOT - taking the logical AND between its
execution condition and the inverse of its
operand bit.
OR / OR NOT

 When 2 or more conditions lie on separate


instruction line running in parallel and joining
together, the first one correspond to a LD or LD
NOT instruction, and the rest of the conditions
correspond to OR or OR NOT instructions.
 OR - taking the logical OR of the execution
condition.
 OR NOT - taking the logical OR between its
execution condition and the inverse of its
operand bit.
AND LD & OR LD Instructions
AND LD
 The AND LD instruction logically AND the
execution conditions produced by two logic
blocks.

OR LD

 The OR LD instruction logically OR the


execution conditions produced by two logic
blocks.
Timer (TIM)

 Timer is an instruction normally used for time delay.


It can be ON delay or OFF delay.
 The timer is based on a decrement method.
 On-Delay-Timer after our sensor (input) turns on we
wait x-seconds before activating a solenoid valve
(output).
 Timer number 000 to 127 (Must not coincide with
counter)
 Set value #0000 to #9999 (0 - 999.9 sec)
 If the start input becomes OFF or the power is turned
OFF during operations before time up (current value
#0000), the current value will be reset to the value set.
Timers

LD 0000
TIM 000
#0100
LD TIM000
OUT 1000
END (01)

*#0100 = 10s
Timer present value can be monitored by :

CLR TIM 0 MONTR


Counter (CNT)

 CNT is a preset decrement counter.


 It decrements one count every time an input signal
goes from OFF to ON.
 The counter must be programmed with a count input,
a reset input, a counter number and set value.
 Set value can range from #0000 - #9999
 Counter number 000 to 127 (Must not coincide with
counter)
 Its current value will not be reset even if the PC power
supply is turned OFF. It will preserve the count until
then.
COUNTER

LD 0001
LD 0002
CNT 010
#010
LD CNT01
OUT 1000
END (01)

* Counter present in decrement method. Once reach zero it


signal goes from OFF to ON. The Counter & Timer share the
same memory location.
Useful Basic
Command
Program Search

CLR

CONT
SHIFT 0
#

SRCH

INSTRUCTION
SEARCH CLR

OUT

SRCH
Inserting & Deleting Instruction

BIT SEARCH

<Instruction> INS

BIT SEARCH

<Instruction> DEL

Note : Only in PROGRAM mode, instruction that display can be


delete or insert.The instruction once deleted, it cannot be
recovered !
Bit & Word Monitoring

Bit Monitor
CONT
SHIFT # 00000 MONTR

Word Monitor HEXADECIMAL

CH
SHIFT 010 MONTR
#DM

BINARY

SHIFT MONTR

* Monitor the status (ON/OFF) of bit & word in any PLC operating mode
Forced Set/Reset

PLAY REC
SET RESET

ON OFF
HEX / BCD DATA MODIFICATION

PRESS VAL ?
CHG
01000 ???/

WRITE 02000 01000

* Change the BCD or


Hexadecimal value of
status being monitor in
MONITOR mode or
PROGRAM mode.
Various Relays
Internal Relay (IR)

I/O Relay
- Corresponds to input terminals and output
terminals.
- 00000 to 00915 (Input relay)
- 01000 to 01915 (Output relay)

Internal Auxiliary Relay


- Can be used freely on the program
- 20000 to 23115
IR Application Example
Self-Holding / Latching Circuit

000.01 010.00
000.00

SW1 SW2
010.00 LAMP1

000.01 200.00
000.00
LAMP1
END
SW1 SW2
200.00

010.00
200.00

LAMP1
END
Special Relay (SR)
- Special functions are assigned.
- 23200 to 25515
- Example :
 25313 ----- Always ON
 25314 ----- Always OFF
 25315 ----- 1 cycle ON when operations start
 25500 ----- 0.1 sec. clock pulse
 25501 ----- 0.2 sec. clock pulse
 25502 ----- 1.0 sec. clock pulse

25500 (0.1 sec. clock pulse)


SR Application Example

000.01 255.02 010.00


000.00

SW1 SW2 1.0 sec clock


010.00 pulse LAMP1

LAMP1
END

* Lamp 1 will starts blinking after SW1 was being trigger.


Holding Relay (HR)

- Maintains the ON/OFF state even when the


power is cut off.
- HR0000 to HR01915
HR Application Example
Temporarily Relay (TR)

- Coincidence memory circuits


- Temporarily memorizes the ON/OFF states at
the branching of circuits.
- Up to 8 (TR0 to TR7) can be used for one block.
TR Application Example

TR0 TR1
INTERLOCK CIRCUIT
000.03 010.02 010.01
000.01

SW 1 RESET
MOTOR MOTOR
010.01 REVERSE FORWARD

MOTOR FORWARD
000.03 010.01 010.02
000.02

SW 2 RESET MOTOR
MOTOR
FORWARD
010.02 REVERSE

MOTOR REVERSE

END
Programming Instruction

1. Latch Instruction
2. DIFU (13) / DIFD (14)
3. MOV (21)
4. CMP (20)
Latch Instruction
– SET, RSET
 Used momentary switches to latch and reset
output.

SET
1000
00

RSET
1000
01
Latch Instruction
– KEEP (11)
 Used momentary switches to latch and reset
output.
 Operates like a latching relay that is set by S
and reset by R.
 Remains ON or OFF state of a bit until one of its
two inputs sets or reset.

00 00 LD 000.00
KEEP (11) S 01 LD 000.01
01
10.02 R 02 KEEP (11) 010.02
03 END (01)
Differentiation Up & Down
DIFU (13) and DIFD (14)

 DIFU turns its output ON when it detects an


OFF > ON transition in its input signal.
 DIFD turns its output ON when it detects an
ON > OFF transition in its input signal.
One Shot-DIFU (13) and DIFD (14)

000.00
DIFU

SW1 200.00
200.00 010.00
000.00

DIFU
000.00
DIFD DIFD

SW2 200.01

200.01 010.01

• DIFU and DIFD only turns an output ON


for only one scan/pulse.
Differentiation Monitor
0000
CLR

CONT 20000
SHIFT 20000 MONTR
#
^ OFF

DIFU Monitor 20000


SRCH
U@ OFF

DIFD Monitor 20001


SRCH
D@ OFF

20000
^ OFF

* Buzzer will sound when the specified bit status change.


MOV(21)

Channel 100 - Source Word


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0
Channel 101 - Destination Word
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0
CMP (20)
 CMP is used to compare the data in a specific
channel, with the data in another channel, or a
4-digit, hexadecimal constant.

00000
CMP(20)
CP1 First compare word
CP2 Second compare word

25505
1000
Greater Than
25506
Equal To
1001
25507
Less Than
1002
Exercise
Upper Limit Sensor
000.01 Ware House
Door Open Output 010.00
Door Close Output 010.01

Truck
Door Close Sensor
000.03
Door Open Sensor Lower Limit Sensor
000.00 000.02

How to ensure the truck pass into the ware house


correspondent to those input signals? The control circuit will
controls the outputs that drive the motor for open or close the
door.

You might also like