Professional Documents
Culture Documents
Sec4 PLC
Sec4 PLC
Sec4 PLC
is the most commonly used timer. The operation of that timer can be summarized as follows:
Note,
PT is the Duration of the on-delay, The
value of the PT parameter must be
positive.
According to the relay ladder schematic, lube-oil pump motor starter coil
M1 is energized when the start pushbutton PB2 is momentarily actuated.
• As a result, M1-1 control contact closes to seal in M1, and the lube-oil
pump motor starts.
• When the lube-oil pump builds up sufficient oil pressure, the lube-oil
pressure switch PS1 closes.
• This in turn energizes coil M2 to start the main drive motor and energizes
coil TD to begin the time delay period.
• After the preset time-delay period of 15 s, TD-1 contact closes to energize
coil M3 and start the feed motor.
OFF-Delay timer (TOF)
The off-delay timer (TOF) operation will keep the output energized for a time period after the rung containing
the timer has gone false.
If logic continuity is lost, the timer begins counting time-based intervals until the accumulated time equals the
programmed preset value. Then the output becomes”0”
If +ve edge is detected then the timer reset to zero and waits until negative
edge is detected to start counting till PT is detected
You can use the "Generate pulse" instruction to set the output Q for a programmed
duration. The instruction is started when the result of logic operation (RLO) at input IN
changes from "0" to "1" (positive signal edge).
The timer
generates pulse of
width “TP” when
it detects the +ve
edge of the input
Reset to ‘0’
Traffic lights control sequence
1- Red >>14sec
2- Red &Amber >> 8sec
3- Green >> 10sec
4- Yellow >> 8sec
on pressing start button(i0.0),
1- timer0 starts and at the same time red is on for 14sec.
2- at the end of PT of timer0,M0.0 becomes (1)
3- when M0.0 becomes(1) yellow is on and timer1 starts
counting(yellow&red are on for 8sec)
4- at the end of timer1 m0.1 becomes (1) Which turns
(red&yellow)off and opens green, at the same time the timer2
starts and green is on for 10seconds
5- at the end of timer2 m0.2 is now on, green is off and returns to
open yellow led, at the same time timer 3 is on (yellow is on for
8 seconds) till m0.3 is on .
6- at m0.3 is on (turns off all timers)
7- when all timers are off >> m0.3 becomes off and the cycle is
repeated .
Counters Programmed counters can serve the same function as mechanical
counters. Figure (1) shows the construction of a simple mechanical counter. Every time the
actuating lever is moved over, the counter adds one number; the actuating lever then returns
automatically to its original position. Resetting to zero is done with a pushbutton located on the
side of the unit.
1- Up-Counter(CTU)
2- Down- Counter(CTD)
3-UP-Down Counter(CTUD)
1- Up-Counter(CTU)
Q
CU:counting input signal
R :Reset the counter RR
PV:preset Value
Q :output signal when the counter is dine
CV: counting value PV
CV
On each +ve edge in CU from I0.0 The counter is
incremented by 1 till the CV>=PV
Q becomes “1”
On supplying signal at reset address ( R )the counter is reset
and the output signal is removed
2- Down-Counter(CTD)
• When the signal state at the CD input changes from "0" to "1" (positive signal
edge), the instruction is executed and the current counter value at the CV output
is decremented by one.
CD:counting input signal
• Each time a positive signal edge is detected, the counter value is decremented
LD :Load input
until it reaches the low limit of the specified data type (INT).
PV :preset Value
• When the low limit is reached, the signal state at the CD input no longer has an
Q :output signal when the cou
effect on the instruction.
CV : counting value
• You can query the counter status in the Q output. If the current counter value is
less than or equal to zero, the Q output is set to signal state "1". In all other cases,
the Q output has signal state "0". You can also specify a constant for the
parameter PV.
On each +ve edge in CD from I0.3 The counter is
decremented by 1 till the CD<=0
Q becomes “1”
• You can use the "Count up and down" instruction to increment and decrement the counter value at the CV output.
• If the signal state at the CU input changes from "0" to "1" (positive signal edge), the current counter value is
incremented by one and stored at the CV output.
• If the signal state at the CD input changes from "0" to "1" (positive signal edge), the counter value at the CV
output is decremented by one.
• If there is a positive signal edge at the CU and CD inputs in one program cycle, the current counter value at the
CV output remains unchanged
When the counter When the counter
value is “0” the value is “5” the
output Qd =true output Qu =true
Parking garage counter.
Many PLC applications use both the counter function and the timer function. The Figure illustrates an automatic
stacking program that requires both a timer and counter.
In this process, conveyor M1 is used to stack metal plates
onto conveyor M2. The photoelectric sensor provides an
input pulse to the PLC counter each time a metal plate
drops from conveyor M1 to M2. When 15 plates have
been stacked, conveyor M2 is activated for 5 s by the PLC
timer. The operation of the program can be summarized
as follows:
• When the start button is pressed, conveyor M1 begins running.
• After 15 plates have been stacked, conveyor M1 stops and
conveyor M2 begins running.
• After conveyor M2 has been operated for 5 s, it stops and the
sequence is repeated automatically.
• The done bit of the timer resets the timer and the counter and
provides a momentary pulse to automatically restart conveyor M1.
Intro to Factory I/O Simulator
System construction
Inputs: outputs:
Start Button conveyor
Stop Button
Diffuse sensor
Writing plc program on
Tia Portal
Start Simulator in
tia Portal
Connect Factory i/o with
tia portal
Run Simulation on
Factory I/O
Manipulate your
simulation using start-
and sop buttons
Queue of items on the
roller conveyor
Inputs:
• Item Ready retroreflective sensor
(NC).(not used in that task)
• entry retroreflective sensor (NC).
• at exit retroreflective sensor (NC).
Output
• (entery roller conveyor motor)
• (buffer roller conveyor motor)
All plc Tags
1- on start, entry conveyor is set on to move items to
the next stage.
1- entery sensor detects the items.
2- at detection of items up counter counts .
3- on passing entry sensor, the buffer conveyor
is turned on till the signal is removed by the
sensor(box gets away of the sensor signal)
4- after counting up to 3 boxes, the entery
conveyor is stopped and the buffer conveyor is
turned on until al items are removed from the
exit sensor.
5- on counting in exit sensor (3 boxes) counters
are reset and resets the input counter and the
cycle starts again
Simple Sorting By Height
Example
Inputs & Outputs
All plc Tags
on pressing Start Button, conveyor
motor is latched and start led is on,
Warning light is on.
If the correct height is detected by
diffuse sensor, the pusher works to push
away that box as seen, if not it allows
the item to pass.
Simple Sorting By Height Example) supply conveyor)
controlling the sequence of the operation
Add that function block before simulation of
Factory IO with S7 1200