Professional Documents
Culture Documents
PDA Chapter 3
PDA Chapter 3
ntlon: An
2.3
24
Numbering System of Inputs ant Outputs
Pogram Rormat
Iritrty
25 ntroduction to Logic
2.5.1 Fquivalent Ladder Diagram of AND Gate
2.5.2 Equivalent Ladder Diagram of OR Gate
2.5.3 Equivalent Ladder Diagram of NOT Gate
2.5.4 Equivalent Ladder Diagram of XOR Gate
2.5.5 Equivalent Ladder Diagram of NAND Gate
2.5.6 Equivalent Ladder Diagram of NOR Gate
2.5.7 Equivalent Ladder Diagram to Demonstrate De Morgan's Therwe
2.6 Ladder Design orem
Sobed Problems
Exercises
27 Switches
Sobed Problems
Chapter 3 PLC Timers and Counters
3.1 Definition and Classification of a Timer
3.2 Characteristics of a PLC Timer
3.2.1 Punctions ina Timer
3.2.2 Resetting-Retentive and Non-retentive
3.3 Classification of a PLC Timer
3.4 On-Delay and Off-Delay Timers
3.5 Timer On-Delay
3.6 Timer Off-Delay
3.7 Retentive and Non-retentive Timers
3.8 Format of Timer Instructions
Solved Problems
3.9 PLC Counter
3.10
Operation of a PLC Counter
3.11 Counter Pararneters
3.12 Overview of Counter Instructions
3.12.1 Count Up (CTU)
3.12.2 Count Down
Solued Problems (CTD)
Exercises
Chapter 4 Advanced
4.1 Introduction Instructions
4.2 Conparison Instructions
4.3 Discussions on Comparison lnstruc tions
4.3.1 "EQUAL" or "EQU" Instruction
4.3.2 "NOT EQUAL" or "NEQ" Instruction
4.3.3
"LESS THAN " or "LES" Instrnuction 54
4.3.4 "IESS THAN OR EQUAL" or "LEQ" Instruction
"GREATER THAN" or "GRT" Instruction 55
4.3.5
4.3.6 "GREATER THAN OR EQUAL TO" or "GRQ" Instruction
4.3.7 "MASKED cOMPARISON FOR EQUAL" or "MEQ" Instruction
4.3.8 "LIMIT TEST "or "LIM" Instruction
Sohed Poblems
57
Logic
P r o g r a m m a b l e
I n s t r u c t i o n
79
SCL
Scale
Data or
I n s t r u c t i o n 80
4.11.3 or
ABS
Absolute I n s t r u c t i o n
4.11.4 CPT
Compute
or
I n s t r u c t i o n
81
4.11.5
Swap
or
SWP
Instruction
81
4.11.6 ASN
Arc Sine o r Instruction 82
4.11.7 ACS
Cosine o r 33
Arc Instruction
4.11.8 o r ATN
Arc Tangent
4.11.9 Instruction
Cosine o r COS 4
Instruction
4.11.10 LN
or
Natural Log Instruction
4.11.11 10 o r LOG
Base
4.11.12 Log to the 85
Instruction
COUNTERS
TIMERS AND
PLC
Classification of a Timer
3.1 Definition and unng its ON or OFF
time delay in a circuit or a system
is device that introduces a
e r aTimers can be classified as follows:
condition.
An electromechanical electronic
timer uses a n circuit for
An electronic
Soon as an electrical signal initiates it. introduced by programmina
PLC timer, the time delay is
incorporating a time delay and in a
TIMER
(EN)
Timebase (DN)
Preset
Accumulator
The contacts on the left side of the timer function block are the
timer enable contac
When they are closed, power passes to the left terminal of the timer, its clock is enabled
it starts tining. When they are
a
open, power stops flowing through this terminal, and the
stops functioning. u
35
PLC Tmers and Counters
A timer function block has three output contacts. When the timer is tirned out, Done Bt
(DN) is set. The enable bit follows the input enable contact status. 1f the enable contact is true
then output Enable Bit (EN) is true. The Timer Timing (TT) bit is set when the tirner is operatirng
ON Delay Tiner
OFF Delay Timer
TON
TIMER On-Delay EN-
Timebase
Preset DN
Accumulator (TT
Tirner Done Bit (DN) Accumulator value is normally Rung condition becomes false.
greater than the preset value.
Tirner Enable Bit (EN) Rung conditions are true. Rung conditions become false.
Timer Tining Bit (TT) Rung conditions are true and the Rung conditions become false
all values are less than the or when the done bit is
PRESET value. set.
PLC Timers and Counters 37
TOF
Timer OFF-Delay
Time base
Preset
Accumulator
To reset the retentive tirner accumulated value and status bit after the RTO rung becomes
false, a reset (RES) program is carried out. The timer function is shown in Table 3.3.
38 Programnable Logle Controllers and Industrial Automation: An Introduction
RESET (RES) When the reset instruction is executed, it resets the data having the same
address as the RES instruction.
Using Reset instruction
Accumulator value is reset to 0
DN bit is reset
TT bit is reset
EN bit is reset
Function block
Each timer address is made up of a 3word element. Word '0' is the control word, Word
T stores the preset value and Word 2' stores the accumulated value.
EN timer enable bit
TT timer timing bit
DN -timer done bit
Table 3.4 Explanation of Tmer Words
15 14 13 12 11 109 8
Word 0 EN T DN Internal bit
Word 1 Preset value (PRE)
Word 2 Accumulator value (ACC)
EN, TT, DN are bit storage. EN is stored in bit 15 Word 0', TT is bit 14 and DN is bit 13
of Word 0. 0-7 bits of Word 0 are the internal bits. Each preset value (PRE) and accumulated
value (ACC) are 16 bit Words stored in Word I and Word 2 of the timer file.
PLC Tmers and Counters 39
Problem 3.1: Draw a ladder diagram for a two-motor system having the following conditions:
(1) Starting push button starts motor -
(2) After 10 seconds, motor-2 is ON
(3) Stopping the switch stops motor 1 and 2
Time base = 1 sec.
Input Output
Start I:0/10 M1 = 0:0/1
Stop I:0/1 M2 = O:0/2
Based on the above inputs, outputs and time base, the ladder diagram has been
developed as shown in Fig. 3.6.
O:0/1
0:0/1
TON E
T4:0
Time Base Is
DN
Pr-10
T4:0/DN O:0/2
The start
a
switch starts motors 1 and 2. The stop switch stops motor 16..
ollowing
irst, after
motor 2 stops. \s *
Input Output
M1 = O:0/1
Start= 1:0/1
Stop= 1:0/2 M2=O:0/2
Based on the above inputs and outputs, the ladder diagram has been des.
in Fig. 3.7.
developed as stsh
1:0/1 1:0/2 O:0/1
TOF
O:0/1
T4:1
Time Base Is
Pr-15
T4:0/DNN O:0/2
Probiem 3.3: Draw a ladder diagram for a two-motor system having the following conditions
The start svwitch starts motor 1; and 10 seconds later motor 2 starts; the stop switchstos
motor 1 and 15 seconds later motor 2
stops.
Input Output
Start = I:0/1
MI = O:0/1
Stop = I:0/2
M2= O:0/2
Timers and Counters
41
PLC
TON
1:0/1
T4:0
Time Base is
Pr-10
TON
1:0/1
T4:1
Time Base 1s
Pr-15
T4 0/DN O o/2
L T4 1/DN 0 / 2
Ladder Diagram for Problem 3.3
Fig. 3.8
conditions:
for a three-1notor systen having the following
Problem 3.4: Draw a ladder diagram
(M1) starts, when M2 is running, Motor
start 5 seconds after Motor 1
Motor 2 (M2) can
lo develop the ladder diagram, the following inputs and outputs are conskdered
Input Output
Start :0/10 MI MI O:00
Stop :0/1uorMI1
Start I2For N2 M2 O:0/1
Stop =l:0/13
Start 1014For M3 M3 O:0/2
Stop =:0/15 For M3
Based on the above inputs and outputs, the ladder diagram has been developed as shown
in Fig. 3.9.
0:0/0
TON
O:0/0
T4:0
Time Base ls
Pr5
O:0/1
I:0/14
0:0/2
Fig. 3.9 Ladder Diagram for Problem 3.4
Problem 3.5: Draw a ladder diagram for a three-motor system having the folowing concitions
Motor 1 (M1) starts as soon as the start switch is on; after 10 seconds, Ml goes ofl aid
motor 2 (M2) starts. After 5 seconds, M2 goes off and M3 starts. After 10 seconds, M3 goes off
MI starts and the cycle is repeated.
PLC Tmers and Counters 43
To develop the ladder diagram, following inprts and onutputs are considered:
Input Output
Start=1:0/1 M1 = O:0/1; M2 = O:0/2; M3 = O:0/3; Systern=O:0/4
Stop l:0/2
Based on the above inputs and outputs, the ladder diagram has been deveoped as shwn
in Fig. 3.10.
0:0/4 TON
T4:2/DN
T4:0
Time Base Is
| Pr=10
T4:0/DN|TON
HH T4:1
Time Base 1s
Pr-5
T4:1/DN TON
T4:2
TimeBase 1s|
Pr 10
T4:0/TT O:0/1
T4:1/TT O:0/2
T4:2/TT O:0/3
Problem 3.6: Draw a ladder diagram for a three-motor system having the following conditions:
off and
Motor 1 (M1) starts as soon as the start switch is on, after 10 seconds, M1 goes
off and
M2 starts. After 5 seconds, M2 goes off and M3 comes on. After 10 seconds, M3 goes
M2 comes on; and after 5 seconds, M2 goes off and M1 comes on, and the cycle is repeated.
considered.
To develop the ladder diagram, the following inputs and outputs are
Input Output
Start I:0/1 M1 = 0:0/1; M2 = O:0/2; M3 = 0:0/3; System=0:0/4
Stop = I:0/2
44 Programmable Logie Controllers and Industrial
Automation: An lIntroduuti
Baxed on the alwe inpmits anul outuls, tlhe ladder diagran Jhas been devekped as shrses
in Fig 31
102 O04
JON
140
limeBase Is
O04 14 DN
P10
TON
T4:1
TimeBase Is
14:0DN Pr 5
TON
T4:2
Time Base 1s
T4:1 DN
Pr- 10
TON
T4:3
Time Basc ls
T4:2/DN
Pr5
T4:0/TT O:0/1
O:0/2
14:3/TT
T4:2 TT O:0/3
Problem 3.7: Draw a ladder diagram for an agitator-motor system having the foliowing
conditions:
Agitator starts; After 5 seconds the pump can be started; when the pump is switched ofi,
the agitator also stops; when the agitator goes off, it cannot be started for 3 seconds.
To develop the ladder diagram, the following inputs and outputs are considered.
Input Output
Start Switch = !:0.1
Agitator on = 1:0/10; Agitator off = 1:0/11 Agitator = 0:0/1
pump on = I:0/12 ; pump off I:0/13 Pump O:02
Based on the above inputs and outputs, the ladder diagram has been developed as shown
in Fig. 3.12.
TON
T4:1
TimeBase Is
Pr-3
3.12 Ladder Diagram for Problem 3.7
Fig.
circuit
Problem 3.8: Blinking indicator lights are used quite extensively in industry. Design a
Starting Light 2
Instant
TH:0DN 0:0/24 -
T4:0/TT
T4:0/DN TON EN
T4:1
Time Base Is
Pr-5
Scan cycleC
Based on the above inputs and outputs, the ladder diagram has been developed as
shown in Fig. 3.13.
can stay closed for any amount of time after a transition. What is important is that the transition
has taken place.
Preset and accumulated values for counters range from-32,768 to +32,767 and are stored
as signed integers. Negative values are stored as 2's compliment form.
15 14 13 12 11 10 9 8 7
Word 0
cuCD DN Ihternal use
Word 1 Preset value (PRE)
Word 2 Accumulator value (ACC)
CU' is count-up bit, 'CD' is count down bit and 'DN' is done bit. A few counter instructions
are given in the subsequent sections.
48 Programmable Logic Controllers and Industrial Automation: An Introduction
CTU
Count up
Counter
Preset
Accumulator
Fig. 3.14 Function Block of a CIU
CTD
Count down
Counter
Preset
Accumulator
Fig. 3.15 Function Block of a CTD
PLC Timers and Counters
49
When the reset
instruction is used for
CU bit is reset, and CD bit is a
counter, the ACC value is '0' and DN bit
reset. is reset,
Problem 3.9: Draw a ladder
conditions. diagram for a box packaging system having the following
Five boxes are stacked at a time and then
The
bound with a
wrapper.
input and
output are as follows:
Box present signal
:0/1 =
i ) Go to step
Based on the above
inputs and outputs, the ladder
in Fig. 3.16. diagram has been developed as shown
101 CTU
C5:1 CU
Pr-5
C5:1 DN TON
T4:1
Time Base 0.1s
Pr 50
T4:1/TT
O.01
T4:1 DN
C5:1
-RES
n is the number of
program cycle
Based on the above inputs and outputs, the ladder diagram has been developed as showr
in Fig. 3.17.
TON
I0/1 C5 0DN T4:1/DN
T4:0
Time Base 0.01s
Pr 50
T4:0/DN TON
T4:1
Time Base 0.01s
Pr 50
T4:0/TT 0:0/1
0:0/1 CTU
C5:0
Pr 10
C5:0/DN TON
T4:2
TimeBase ls
Pr 20
T4:2/DN O:0/2
C5:0
(Res)
T4:2/DN