of 36
8/14/2019 plc-2009
1/36
IE 262
Programmable Logic Controllers andPLC Programming
8/14/2019 plc-2009
2/36
8/14/2019 plc-2009
3/36
8/14/2019 plc-2009
4/36
PLC System
8/14/2019 plc-2009
5/36
8/14/2019 plc-2009
6/36
8/14/2019 plc-2009
7/36
8/14/2019 plc-2009
8/36
8/14/2019 plc-2009
9/36
8/14/2019 plc-2009
10/36
8/14/2019 plc-2009
11/36
8/14/2019 plc-2009
12/36
input output
Ladder Diagram
8/14/2019 plc-2009
13/36
8/14/2019 plc-2009
14/36
Example 1
Example 2
8/14/2019 plc-2009
15/36
8/14/2019 plc-2009
16/36
SensorSensor
Output
8/14/2019 plc-2009
17/36
8/14/2019 plc-2009
18/36
accumulated value
done bit
The number of time units or counts that have accrued. When the accumulated valueequals the preset value, the done bit is enabled. .
A bit that ends the time delay or counter count when the accumulated value is equalto the preset value. The done bit is one of the most frequently used status bits.
preset value
A value set in advance that triggers a timer or counter action. When the accumulatedvalue equals the preset value, the done bit is enabled.
enable bit
A bit that begins timer timing when the bit is true (1). The enable bit is one of themost frequently used status bits.
PLC timer
PLC counter
A control device that automatically starts or stops machines and other devices when
a preset time period has been exceeded. PLC timers do not exist in the real world,but rather as a set of instructions inside the PLC microprocessor.
A device that counts, calculates, or keeps a record of the number of times somethinghappens. PLC counters do not exist in the real world, but rather as a set of instructionsinside the PLC microprocessor.
8/14/2019 plc-2009
19/36
PLC TIMERS PERFORMS VARIOUS FUNCTIONS
They delay an action They cause an operation to run a predetermined period of time They record the total accumulated time of continuous or intermidiate events
ACTIVATING A TIMER
A timer is activated by a change in the logic continuity of its rung
8/14/2019 plc-2009
20/36
8/14/2019 plc-2009
21/36
1
2
3
5
7 END
T4:2/ENEN
DN
DN
EN
EN
DN
6
O:2/0
T4:3/EN T4:1/DNTON
T4:1/EN
TON
TON
T4:1/EN T4:3/EN T4:2/DN
T4:1/EN T4:2/EN T4:3/DN
T4:2/EN
T4:3/EN
O:2/1
O:2/2
T4:1Pre:30 Acc:0
T4:2Pre:10 Acc:0
T4:3Pre:20 Acc:0
RED
YELLOW
GREEN
8/14/2019 plc-2009
22/36
An ON-delay timer is enabled when its rung is true. A rung is truewhen there is at least one path made by the instructions that are truefrom the left rail to the timer instruction.
An OFF-delay timer is enabled when its rung is false. When a timer isenabled, its Accumulate value shows how many Time Base intervals
have elapsed since the timer was activated.A timer is done when its Accumulate value reaches its Preset value.
When an ON-delay timer or an OFF-delay timer is timing, its rungcondition change, i.e. a rung changes from true to false for an ON-delay timer or a rung changes from false to true for an OFF-delaytimer, will cause the timer to stop and its Accumulate value to bereset to zero.
8/14/2019 plc-2009
23/36
Each timer instruction has three very useful status bits. These bits are Timer Enable (TE), Timer Timing(TT) and Timer Done (TN). Each of these bits has one bit of memory and the memory is affected by thecorresponding bit status. For an ON-delay timer and a retentive timer,
The Timer Enable bit is high when the timers rung is true; it is low when the rung is false.
The Timer Timing bit is high when the timers rung is true and the Accumulate value is less than the Preset
value. This bit is low when the rung is false or after the Accumulate value equals the Preset value.
The Timer Done bit is high when the rung is true and the timer is done. It is low when the rung is false orbefore the timer is done.
For an OFF-delay timer,
The Timer Enable bit is high when the timers rung is false; it is low when the rung is true.
The Timer Timing bit is high when the timers rung is false and the Accumulate value is less than thePreset value. This bit is low when the rung is true or after the Accumulate value equals the Preset value.
The Timer Done bit is high when the rung is false and the timer is done. It is low when the rung is true orbefore the timer is done.
8/14/2019 plc-2009
24/36
8/14/2019 plc-2009
25/36
8/14/2019 plc-2009
26/36
I:1/0
I:1/1B:3/0
B:3/0
TON
T4:0EN
DN
T4:0/EN
T4:0/TT
T4:0/DN
B:3/0
O:2/0
O:2/1
O:2/2
8/14/2019 plc-2009
27/36
8/14/2019 plc-2009
28/36
PLC COUNTER INSTRUCTIONS
Counters are output instructions that are internal to a PLC
Counters simply count and store the number of events that occur
The two common type of counters are up-counters and down-counters
Up-counters increment and down counters decrement each time thecounters rung goes from FALSE to TRUE
8/14/2019 plc-2009
29/36
8/14/2019 plc-2009
30/36
8/14/2019 plc-2009
31/36
8/14/2019 plc-2009
32/36
I:1/0
I:1/2
I:1/1
C5:1/CU
C5:1/CD
C5:1/DN
C5:1
O:2/0
O:2/1
O:2/2
CU
CD
DN
DN
RES
l
8/14/2019 plc-2009
33/36
Example:1
When the start pushbutton is pressed, the red pilot light turns on and the conveyor
starts running. Light bulbs travel along a conveyor and when the 6th light bulb issensed via proximity sensor, the conveyor stops. An operator picks up the light bulbsand restarts the machine by pressing Start button. Pressing Stop shuts down thewhole process.
8/14/2019 plc-2009
34/36
STARTI: 1/0 STOP
I: 1/1 B3:O
O:2/0
O:2/1C5:1/DN
I:1/2
B3:O
B3:O
O:2/1CTU
C5:1Preset:6 Acc. DN
CU
RESETC5:1
I:1/1
1
2
3
5
6 ENDC5:1/DN
B3:O (internal bit)
Red Pilot
Conveyor
Count Up
Reset the counterif/when STOP is
pressed
If START is pressed andcounter preset is notequal to 6
DN:Done bit. BecomesTRUE (1) when Accumulator value isequal to preset value.FALSE(0) otherwise.
E l 2
8/14/2019 plc-2009
35/36
Example:2
I: 1/0
8/14/2019 plc-2009
36/36
I: 1/1 B3:O
O:2/0
O:2/1
I:1/5
T4:1/DN
B3:O
O:2/1CTU
C5:1Preset:6 Acc. DN
CU
RESETC5:1
I:1/1
1
2
3
5
6 END
T4:1/DN
B3:O
C5:1/DN
C5:1/DN
T4:1
TCNP:5 sec
EN
DN