0% found this document useful (0 votes)
135 views53 pages

PLC Programming

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 53

PLC PROGRAMMING

PLC PROGRAMMING

• Ladder and functional block programming


• Internal relays

2
Criteria for PLCs
• Easy to program
• Easy to maintain
• Highly reliable in an industrial environment
• Expandable
• Cost competitive
• Compact
• Communicate
• Accept 120 VAC input signals
• Operate 120 VAC devices
• Over 4k memory
3
Signals in PLCs

• Inputs: describe the status of the process to the


controller (external)
• States: discrete modes the controller can be in
(internal)
– State transitions: functions of the current state
and the inputs
• Outputs: actions initiated by the controller based on
the current state (external)

4
Ladder and functional block programming

5
Ladder and functional block programming
• PLC are intended to be used by engineers without any great
knowledge of programming as compare to C or other high
level language.
• Standards for PLC programming was done by IEC 1131-3
( International Electro technical Commission).
• IEC 1131-3 programming language are
– Ladder Diagram (LAD).
– Instruction List(IL).
– Sequential Function Chart (SFC).
– Structured Text (ST).
– Functional Block Diagram (FBD).

6
Introduction To Ladder Diagram

• switching on or off an electric motor

7
Motor Control Ladder Diagram
+ RAIL VOLTAGE
RAIL NEUTRAL

control circuit voltage


START
STOP

Normally Normally Control


Open Switch Closed Switch Relay 8
Motor Control Ladder Diagram
START
STOP

output
EQUIVALENT DIAGRAMS

START STOP

output
Normally Normally
9
Open Contact Closed Contact
Convention of Ladder Diagram
• The vertical lines of the diagram
represent the power rails between
which circuits are connected. The
power flow is taken to be from the
left-hand vertical across a rung.
• Each rung on the ladder defines one
operation in the control process.
• A ladder diagram is read from left to
right and from top to bottom.
• The end rung might be indicated by a
block with the word END or RET for
return, since the program promptly
returns to its beginning.

10
Convention of Ladder Diagram
• Each rung must start with an input or inputs and must
end with at least one output.
• Electrical devices are shown in their normal condition.
• A particular device can appear in more than one rung of
a ladder.
• The inputs and outputs are all identified by their
addresses.

11
Standard IEC 1131-3
Basic symbols Of Ladder Diagram

12
Addresses Of Element In Ladder Diagram

13
Addresses Of Element In Ladder Diagram
Input
Output
MS1 R1
01 11
C1 02 12 R2
C2 R3
03 13
C3 R4
04 14
C4 Programmable
05 Controller 15
PLC

01 14 11

02 14

14 04 03 12

05 03 13
Logic Function

• AND Gate

15
Logic Function
cont…………

• OR Gate

16
Logic Function
cont…………

• NOT Gate

17
Logic Function
cont…………
• NAND Gate

18
Logic Function
cont…………
• NOR gate

19
Logic Function
cont…………
• Exclusive OR (XOR)

20
Latching

21
Motor on-off, with signal lamps
example of latching
• X401 is closed when the program is
started.
• When X400 is momentarily closed,
Y430 is energised and its contacts
close.
• This results in latching and also the
switching off of Y431.
• Y432 will be switched on.
• To switch the motor off, X401 is
pressed and opens.

22
Multiple outputs

23
Entering programs

• To enter an INPUT

• To enter an OUTPUT

• The start of a junction

• The end of a junction path

• To indicate horizontal circuit links

24
Function blocks

25
Few more Function blocks

26
Ladder diagram and equivalent functional
block diagram

27
Boolean algebra

• A+B.C=Q

• A+B=Q

28
Boolean algebra

29
PROGRAMMING EXAMPLE 1

30
PROGRAMMING Bar code reader

EXAMPLE 2
microswitch Stopper

Part Conveyor

Robot
Machine

id description state explanation


MSI microswitch 1 part arrive
R1 output to bar code reader 1 scan the part
C1 input from bar code reader 1 right part
R2 output robot 1 loading cycle
R3 output robot 1 unloading cycle
C2 input from robot 1 robot busy
R4 output to stopper 1 stopper up
C3 input from machine 1 machine busy
C4 input from machine 1 task complete
SOLUTIO
MS1
Input

01
N Output
11 R1
C1 02 12 R2
C2 R3
03 13
C3 R4
04 14
C4 Programmable
05 Controller 15
PLC
Rung 1. If part arrives and no
part is stopped, trigger the
bar code reader.
01 14 11 Rung 2. If it is a right part,
activate the stopper.
14
Rung 3. If the stopper is up, the
02
machine is not busy and the
robot is not busy, load the
14 04 03 12
part onto the machine.
Rung 4. If the task is completed
05 03 13
and the robot is not busy,
unload the machine.
Internal relays
To distinguish internal relay outputs from external relay outputs, they

are given different types of addresses .

33
Control Relay
normally open relay
contact contacts
relay
coil
normally closed relay
contact core

relay coil

34
Control Relay
normally open relay
contact contacts
relay
coil
normally closed relay
contact core
1) Control relays are the
basic component of
relay coil ladder diagram logic
(control relay logic)
2) Control relays are35
simulated by PLCs
Control Relay
relay
contacts
relay
relay
not coil
activated relay
core

36
Control Relay
relay
contacts
relay
relay coil
activated
relay
core

37
Motor Control Ladder Diagram
relay
contacts
relay
control coil
circuit
relay
core

motor
power
circuit
38
Motor Control Ladder Diagram
relay not relay
activated contacts
relay
motor not control coil
activated circuit
relay
control circuit voltage core

START STOP CR1 motor


power
circuit
relay coil
39
Motor Control Ladder Diagram
relay relay
activated contacts
relay
motor coil
activated
relay
core
"activated"
START STOP CR1 motor
power
circuit
relay coil
"pushed" 40
Motor Control Ladder Diagram
relay not relay
activated contacts
relay
motor not control coil
activated circuit
relay
core

START STOP CR1 motor


power
circuit
relay coil
"released" 41
Motor Control Ladder Diagram
relay not relay
activated contacts
relay
motor not control coil
activated circuit
relay
core

START STOP CR1 motor


power
circuit
CR1 relay coil
42
Motor Control Ladder Diagram
relay relay
activated contacts
relay
motor coil
activated
relay
"pushed" core
"activated"
START STOP CR1 motor
power
CR1 circuit
relay coil
43
Motor Control Ladder Diagram
relay relay
activated contacts
relay
motor coil
activated
relay
"released" core
"activated"
START STOP CR1 motor
power
CR1 circuit
relay coil
44
“held”
Motor Control Ladder Diagram
relay not relay
activated contacts
relay
motor not control coil
activated circuit
relay
core
“pushed”
START STOP CR1 motor
power
circuit
CR1 relay coil
45
Motor Control Ladder Diagram
relay not relay
activated contacts
relay
motor not control coil
activated circuit
relay
core
“released”
START STOP CR1 motor
power
circuit
CR1 relay coil
46
Battery-backed relays
(retentive memory coil)

• some internal relays have battery back-up so that they can


be used in circuits to ensure a safe shutdown of plant in the
event of a power failure and so enable it to restart in an
appropriate manner.

When In1 is closed IR1


o/p is energised.
This will closed IR1 I/p
This result in o/p OUT1
When power fail IR1
I/p will latch, so there
will be a output 47
One-shot operation
• Its contacts are activated for just one cycle

• When trigger I/p occur it gives trigger o/p on rung 1.


• In rung 2 it gives cycle control o/p
• The trigger o/p can only occur again when the trigger o/p is switched
off and then switched on again.

48
positive transition-sensing and negative
transition-sensing coils.

• the positive transition-sensing coil, if the power flow to it


changes from off to on, the output is set on for one ladder
rung evaluation.

49
Set and reset/Latch unlatch

• The SET coil is switched on when power is supplied to it


and remains set until it is RESET.
• The SET coil is switched on when power is supplied to it
and remains set until it is RESET.
50
Set and reset/Latch unlatch

• example

51
Set and reset/Latch unlatch

52
Master control relay
• With no input to input 1, the
output internal relay MC 1 is not
energised and so its contacts are
open, so rungs 2 and 3 are off.
• When input 1 contacts close, the
master relay MC 1 is energised.
• Then all the rungs between it and
the rung with its reset MCR 1 are
switched on.

53

You might also like