Escolar Documentos
Profissional Documentos
Cultura Documentos
Industrial Electronics
NOR FAEZAH ADAN
Jabatan Kejuruteraan Elektrik, PPD
PROGRAMMABLE LOGIC
CONTROLLER
(PLC)
What is Programmable Logic Controller?
1. Processor
2. Memory unit
3. Power supply
4. I/O module
5. Programming
device
Basic PLC components
Typical PLC cabinet at
site
You might ask why not simply wire the switch to the light - and you might be
able to do that in some situations, but let's assume the switch must use low
voltage DC, and the stack light requires 110VAC. Now we have an application
where a relay might be used, and since a PLC is basically a collection of relays -
we can use a PLC!
PLC operations
1. A PLC monitors inputs, makes decisions based on its program,
and controls outputs to automate a process or machine.
2. The operation of the PLC system is simple and straightforward.
The processor or CPU completes three processes:
(1) Scans, or reads from the input devices,
(2) Executes or "solves" the program logic &
(3) Updates or writes to the output devices.
SCAN TIME
The scan time is a continuous and sequential process of reading the
status of inputs, evaluating the control logic and updating the
outputs. Scan time varies from 1msec to 30msec.
SCAN TIME
The scan time is a continuous and sequential process of reading the
status of inputs, evaluating the control logic and updating the
outputs. Scan time varies from 1msec to 30msec.
PLC advantages
PLCs are similar to computer but have certain features which are
specific to their use as controller. These are:
Answer
Activity
Convert the ladder diagram to mnemonic code
Answer
Activity
Convert the ladder diagram to mnemonic code
Hardware configuration of PLC
Hardware configuration of PLC
Lab training
set
Methods to upload programs to PLC
OMRON
CQM1H Programming
console
Programming
software:
CX programmer
MEMORY MAP / ADDRESS
OMRON
CQM1H
TIM
• Require a TIM number and a set value (SV).
• For Omron CQM1H, SV must be between
#0000 and #9999.
• Value of parameter SV is multiplied by 0.1s,
the result being total time in seconds.
PLC instruction : TIMER Timer / Counter address is
from TIM 000 - 511
PLC instruction : TIMER Timer / Counter address is
from TIM 000 - 511
Mnemonic code
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511
CNT
• Require a CNT number and a set value
(SV).
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511
CNTR(12)
• Require a CNT number and a set value
(SV).
• Can count up, down and reset function.
• CNTR is a reversible counter where
both up count and down count can be
down by the same counter
Timer / Counter address is
: COUNTER
PLC instruction from TIM 000 - 511
END
Activity – Timer & Counter
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.
Incoming Sensor 1
Sensor 3
Sensor 2
Outgoing
Activity – Timer & Counter
: MOVE
PLC instruction
MOV(21)
To move a data from one channel to another channel.
S : Source Channel
IR,SR,AR,DM,HR,TC,LR,#
D : Destination channel
IR,AR,DM,HR,LR
P_On MOV (21) Transfer data from
000 channel 000 to 100
100
00003
00001
MOV(21)
#0001 Alarm Code #1
101
00003 MOV(21)
#0003 Alarm Code #3
101
00006
MOV(21) Reset Alarm
#0000 Code Display
101
END
: COMPARE
PLC instruction
CMP(20)
Compare is used to compare the data in a specific channel with
the data in another channel or a four-digit hexadecimal constant.
Cp1: First Compare Word
CMP(20)
IR,SR,AR,DM,HR,TC,LR,#
Cp1
Cp 2: Second Compare Word
Cp2
IR, AR, DM, HR, LR
Example
ADDR OP CODE DATA
25313 TR0
0000 LD 25313
CMP(20) 0001 OUT TR0
#0020 0002 CMP (20)
HR1 #0020
IR,AR,DM,HR,LR
Example
ADD(30) ADDR OP CODE DATA
00007 0000 LD 00007
HR000
#1234 0001 ADD(30)
0002 HR000
HR000
#1234
HR000
1. The operation:
0003 END(01)
HR000 #0001
#1234
HR000 #1235
2. Add #0001 + #1234 = #1235
3. The result:
HR000 #1235
: SUBTRACT
PLC instruction
SUB(31)
To subtract data in two different channel.
IR,AR,DM,HR,LR
Example
SUB(31) ADDR OP CODE DATA
00007 0000 LD 00007
HR000
#1234 0001 SUB(31)
0002 HR000
HR000
#1234
HR000
1. The operation:
0003 END(01)
HR000 #3234
#1234
HR000 #2000
2. Sub #3234 + #1234 = #2000
3. The result:
HR000 #2000
PLC instruction: KEEP
KEEP(11)
• To replace normal latching.
• Has two input, set and reset.
• Better use HR so the output retain even though power fails.
Set =00000
KEEP (11)
Reset=00001 IR/Output
Port/HR
END
PLC instruction : DIFFERENTIATE UP
DIFU(13)
DIFU turns its output ON when it
detects an OFF to ON transition in its
input signal.
: DIFFERENTIATE DOWN
PLC instruction
DIFD(14)
DIFD turns its output ON when it
detects an ON to OFF transition in its
input signal or from HIGH to LOW
signal .
Exercise 1
Replace CNT with ADD and SUB.
YELOW LINE
ROBOT
sensor sensor
Answer
Exercise 3
Use DIFU and DIFD to solve the problem.
S2
S1
Garage Door
Answer