Академический Документы
Профессиональный Документы
Культура Документы
DEK 3113
Fundamental of
Programmable Logic
Controller
Chapter 4
Taaruf Session
Office : 07-4537868
E-mail : reza@uthm.edu.my
HP:016-7585859
PLC Advantages
PLC Operation
1.
2.
Memory map/address
TIMER (TIM)
MNEMONIC
FUNCTION
COUNTER (CNT)
The address sharing with
timer
Mnemonic
00004
CP
00002
CNT 007
#10
CNT 007
10010 (siren)
END
LD
00004
LD
00002
CNT 007
#10
LD
CNT 007
OUT
10010
Fun (01)
CNTR (12)
down
reset
CNTR (12)
DIFU(13) DIFFERENTIATION UP
DIFD(14) DIFFERENTIATION
DOWN
DIFD turns its output ON when it detects
an ON to OFF transition in its input signal
or from HIGH to LOW signal
Car
park
system
A simple
car park
control system allows only a
IR/Output
Port/HR
END
Example
An incoming bar for a parking lot will raise up for 20 seconds when sensor 1
detects an incoming car. After passing the bar, sensor 2 will start count up
the number of cars that parks in the parking lot. At the exit sensor 3 will
deduct out going cars from the parking lots. If at one time the number of
cars in the parking lot is 20 then the full sign light will be on.
I/O assignment:
i/p
o/p
Sensor 1
Bar (Motor)
Sensor 2
Timer 1 (TIM 1 = #200)
Sensor 3
CNTR (#20)
Reset button
Full Sign
Tim 1 contact
CNTR contact
Sensor 1
Sensor 3
Sensor 2
Outgoing
Ladder Diagram
MOV(21)
S : Source Channel
IR,SR,AR,DM,HR,TC,LR,#
D : Destination channel
IR,AR,DM,HR,LR
25313
MOV(21)
000
100
Bit
Channel/
Word
15
000
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
001
002
.
.
.
100
.
999
Example
00002
Alarm
00003
00001
MOV(21)
#0001
101
00002
00003
00006
MOV(21)
#0002
101
Alarm
Code #2
MOV(21)
#0003
101
Alarm Code
#3
MOV(21)
#0000
101
END
Alarm Code
#1
Reset Alarm
Code Display
CMP(20)-compare
Compare is used to compare the data in a specific channel with the
data in another channel or a four-digit hexadecimal constant
CMP(20)
Cp1
Cp2
IR,SR,AR,DM,HR,TC,LR,#
Example
25313
TR0
CMP(20)
ADDR
OP CODE
DATA
0000
LD
25313
0001
OUT
TR0
0002
CMP (20)
#0020
#0020
HR1
HR1
25507 ( < )
10001
Green Light
25506(=)
10002
Red Light
0003
AND
25507
0004
OUT
10001
0005
LD
TR 0
0006
AND
25506
0007
OUT
10002
Add(30)
ADD(30)
00007
HR000
#1234
HR000
The operation:
ADDR
OP CODE
DATA
0000
LD
00007
0001
ADD(30)
0002
1.
HR000
#1234
HR000
HR000
HR000
0003
END(01)
#1235
#1234
#0001
#1235
Sub(31)
Opposite of add
Continue..
Exercise
YELOW
LINE
sensor
sensor
ROBOT
sensor
Solution
Exercise 2
An automatic home garage is equipped with sensor 1, S1, that
detects the approaching car and will open the garage until sensor
2, S2,detects the whole car body has safely parks inside the
garage. Use DIFU and DIFD to solve the problem.
S2
S1
Garage Door
Solution
Exercise 3
A conveyor belt is used to transfer red and blue balls for
sorting by initially pressed the start button. A colour sorter
system is designed to sort red balls and blue balls. If
sensor 1 detects red ball, the ball will be pushed into bin 1
by cylinder 1 (CY1) for 2 seconds. If sensor 2 detects blue
ball then the ball will be pushed into bin 2 by cylinder 2
(CY2) for another 2 seconds. If the counter has counted 10
red balls, then red light is on and when counter has
counted 10 blue balls then green light is on. When either
lights is on the conveyor stops the transferring of the balls.
The conveyor will start again when reset button is pressed
to empty the adder of full ball and the system restart. Use
ADD, MOV, CMP instead of CNT.
Assignment
A conveyor belt is used to transfer red and blue balls for sorting by
initially pressed the start button. A color sorter system is designed to
sort red balls and blue balls. If sensor 1 detects red ball, the ball will
be pushed into bin 1 by cylinder 1 (CY1).If sensor 2 detects blue ball
then the ball will be pushed into bin 2 by cylinder 2 (CY2). If the
counter has counted 10 red balls, then red light is on and when
counter has counted 10 blue balls then green light is on. When
either lights is on the conveyor stops the transferring of the balls.
Use CNT instead of ADD and SUB.
Assume traveling time for cylinder from original position to full
extension(vice versa is 0.2 sec) and all cylinder is single acting
cylinder.
All cylinder will go back to its original position after transferring the
ball.
Assignment
Two different item need to be sort out. It is been placed along a
conveyor belt. Conveyor belt will turn on when sensor 1 detect the first
item present on that conveyor belt at its origin. When sensor 2 detect
item A, it will be transferred by single acting cylinder, CY1 to first path.
When LS1 detect the full extension of CY1,it will return to its initial
position. When sensor 3 detect item B,it will be transferred by single
acting cylinder,CY2 to second path.When LS2 detect full extension of
CY2,it will return to its intial position.If the counter has counted 30 item A,
green light will be on.If the counter counted 30 item B,blue light will be
on.When one of the counter has count 30 item no matter item A or item B,
the conveyor belt will be turn off. It will be turn on again when the adder
of full ball is reset to zero then the system will restart again. Use DIFU,
ADD, MOV, and CMP instead of CNT.
BREAK TIME !
Any Questions
So far???