Professional Documents
Culture Documents
PLC Programming Topic 3 - 2: Dr. Mahesh S. Narkhede Electrical Engineering Department Government Polytechnic, Mumbai
PLC Programming Topic 3 - 2: Dr. Mahesh S. Narkhede Electrical Engineering Department Government Polytechnic, Mumbai
PLC Programming Topic 3 - 2: Dr. Mahesh S. Narkhede Electrical Engineering Department Government Polytechnic, Mumbai
PLC Programming
2
Classification of PLC Instructions
• Each symbol in ladder logic is an instruction.
The Ladder Logic instructions are classified
below along with some examples.
• Bit type instructions- XIC, XIO, OTE, OTL, OUT,
OSR.
• Logical instructions- OR, AND, NOT, XOR.
• Comparison instructions- EQU, NEQ, LES, LEQ,
GRT, GERQ, LIM.
• Timer instructions- TON, TOFF, RTO.
• Counter instructions- CTU, CTD.
• Scaling instructions- SCP.
3
Classification of PLC Instructions
Bit type instructions
• These instructions regulate and control the
status of bits in a data table, such as input bits or
bit words for timer controls
4
Bit type PLC Instructions
XIC Examine if Closed
7
Bit type PLC Instructions
OTL Output Latch
9
Bit type PLC Instructions
OTU Output Unlatch
11
Bit type PLC Instructions
OSR One-Shot Rising
12
Logical Instructions
OR
13
Logical Instructions
AND
14
Logical Instructions
NOT
15
Logical Instructions
XOR
16
Comparison Instructions
EQU - Equal
17
Comparison Instructions
NEQ – Not Equal
23
Comparison Instructions
• If the Test parameter is a program constant,
both the Low Limit and High Limit parameters
must be word addresses.
• If the Test parameter is a word address, the Low
Limit and High Limit parameters can be either a
program constant or a word address.
24
Timer Instructions
TON – Timer On Delay
26
Timer Instructions
• Word 2 stores the preset value. (PRE)
• The programmer specifies this value. When the
accumulated time reaches the preset value the
controller sets the done bit. When the
accumulated value becomes equal to or greater
than the preset value, the done bit is set. Usually
preset value is from 0 - 32,767
• If a timer-preset value is negative an error will
occur.
27
Timer Instructions
• Word 3 stores the accumulated value. (ACC)
• This is the time elapsed since the timer was last
reset. When enabled the timer updates this
continually.
• Time Base: is the timing update interval, this can
vary from 0 - 1 second.
28
Timer Instructions
TOF – Timer Of Delay
30
Timer Instructions
• Word 2 stores the preset value. (PRE)
• Specifies the value, which the timer must reach
before the controller sets the done bit. When the
accumulated value becomes equal to or greater
than the preset value, the done bit is se.
• Preset value is from 0 - 32,767
• Word 3 stores the accumulated value. (ACC)
• This is the time elapsed since the timer was last
reset. When enabled the timer updates this
continually.
• Time Base: is the timing update interval, this can
vary from 0 - 1 second.
31
Timer Instructions
RTO – Retentive Timer
33
Timer Instructions
• Each Retentive Timer is made of a 3-word
element.
• Word 1 is the control word
• Bit 0-12: Internal Use
• Bit 13: DN- Done
• Bit 14: TT - Timer Timing
• Bit 15: EN - Timer is enabled
34
Timer Instructions
• Word 2 stores the preset value. (PRE)
• Specifies the value, which the timer must reach
before the controller sets the done bit. When the
accumulated value becomes equal to or greater
than the preset value, the done bit is se.
• Preset value is from 0 - 32,767
• Word 3 stores the accumulated value. (ACC)
• This is the time elapsed since the timer was last
reset. When enabled the timer updates this
continually.
• Time Base: is the timing update interval, this can
vary from 0 - 1 second.
35
Counter Instructions
CTU – Count Up
41
Scaling Instruction
SCP – Scale with parameters
42
Bottle Filling Plant
43
Bottle Filling Plant
44
Bottle Filling Plant
• Once the start button is pressed the green light (L1)
turns ON and remains ON until stop button is
pressed. As light turns ON out feed motor(M2)
starts running. After M2 runs and if either limit
switch(LS) has not signalled or filled bottle condition
is fulfilled motor(M1) starts. After limit switch has
signalled timer,T1 gets activated. After T1 gives
done (DN)signal and photo detector (PE) is
disabled ,solenoid valve gets in operation. As PE
signals solenoid stops and buzzer(B1) sounds after
which timer,T2 gets enabled which stops the
process for 0.7 seconds. Once the filled bottle
condition is activated the cycle starts again.
45
Traffic Light Control
RED
GREEN
YELLOW
RED
GREEN
YELLOW
46
Traffic Light Control
Logic:
• Press Start Push Button to start the function.
• Red lamp should be ON for 25 seconds.
• After 25 seconds Red lamp should be OFF. Then
Green lamp should be ON for 35 seconds.
• After 35 seconds Green lamp should be OFF. Now
Yellow lamp should be ON for 15 seconds.
• After 15 seconds Yellow lamp should be OFF.
Again Red lamp should be made ON for next 25
seconds.
• Repeat the cycle from step 2, to autostart.
• Press Stop Push Button to stop the function.
47
Traffic Light Control
48
Starting of an Induction Motor with
Forward and Reverse control
49
Starting of an Induction Motor with
Forward and Reverse control
50
Starting of an Induction Motor with
Forward and Reverse control
51
Starting of an Induction Motor with
Forward and Reverse control
52
Here Time delay is provided by timers TD1 and TD2
53
References
• https://realpars.com/plc-programming-
languages/
• https://automationforum.in
54
HAPPY LEARNING!
Dr.Mahesh S. Narkhede
Electrical Engineering Department
Government Polytechnic, Mumbai
msnarkhede@ymail.com
https://drmaheshsnarkhede.wordpress.com/ 55