Exercise 1
Exercise 1
5
Review Question
Exercise 1 lab2
10s
3
4
Review question
once
Repeat
Lab c
hold close
PRESS OPEN
HOLD OPEN
PRESS CLOSE
STOP TENGAH
LABC EXERCISE 2
closing
open half
fully open
half close
Introduction and Literature Review
PLC
A programmable logic controller (PLC) is a unique way of micro-processor-based controller
that uses a programmable memory to store instructions and to implement functions such as
logic, sequencing, timing counting and arithmetic to control machines and processes. [1]
1. The central processing unit (CPU), containing the microprocessor. It evaluates the
incoming signals and executes the control operations in accordance with the programe
that is stored in its memory and sending action signals to outputs.
2. In order to provide the CPU and the circuits in the input and output interface modules
with the low DC voltage (5 V) they require, the power supply unit must convert the
main AC voltage.
3. The necessary program is loaded into the processor's memory using the programming
device. The PLC's memory unit receives the programme after it has been created in
the device.
4. The memory unit is where the programme that will be utilised for the
microprocessor's control activities, as well as data stored from the input for processing
and for the output for outputting, is stored.
5. Input and output sections are where the processor receives data from external devices
and give out specific information to external device. It acts as the entrance and the
exit of the PLC system respectively.
6. Communications interface receives and transfer data on communication networks
from or to other remote PLCs to verify other devices and to synchronise action
between users.
Exercise 1
Observation Discussion
Switch 0 (I:1/0) has a normally open contact.
When it is switched ON, the contact will close
and Lamp 0 (O:2/0) will energize. This ladder
diagram is applied on simple mechanism such as
pushing a button to turn on a motor.
Switch 0 Lamp 0
0 0
1 1
Exercise 2
Observation Discussion
When Switch 0 (I:1/0) is ON, Lamp 0 (O:2/0) will
be energized due to the closing of the normally
open contact. Switch 1 (I:1/1) has a normally closed
contact; the contact opens when triggered and de-
energizes Lamp-1 (O:2/1). In this exercise,
normally-closed contacts is shown to be useful in
situations where an output is expected to always be
ON unless a certain condition is triggered. For
example, a system can always be in operation
unless a component is malfunctioned, when this
happens, the NC switch will be triggered to stop the
operation.
Switch 0 Switch 1 Lamp 0 Lamp 1
0 0 0 1
0 1 0 0
1 0 1 1
1 1 1 0
Exercise 3
Observation Discussion
When the start
button (I:1/2) is
triggered (NO)
Lamp -2 is
energized. Lamp – 2
has a latching
characteristic, hence
Lamp-2 remains ON
even after Start-NO
is switched OFF.
Start - Stop - NO Lamp 2 (L) Lamp 2
When Stop-NO is
NO (U)
triggered, only then
0 0 0 0 Lamp-2 will OFF.
1 0 1 1 Latching output is
0 0 1 1 useful when a
0 1 0 0 process will be
1 1 0 0 stopped only when a
stop signal is
received. For an
example, when a
motor is operated
(Lamp -2) by a
switch, a respective
stop switch can be
used to unlatch it
and stop the motor.
Exercise 4
Observation Discussion
When Start-NO(I:1/3) is ON, Lamp-2 (O:2/2) will
ON. Lamp-2 is in a ON state, therefore even when
Start-NO is OFF, Lamp-2 acts as an input for its own
output. Thus, this creates a self-latching output. To
turn OFF Lamp-2, Stop-NC (I:1/4) must be
triggered. Although I:1/4 is illustrated as a NO input,
it is used as a NC switch. This is useful to provide
Start – NO Stop – NC Lamp - 2 additional safety, for example it can be used to
0 0 0 monitor a conveyor belt system, the NC switch will
1 0 1 be triggered to change into an open state and stop the
0 1 0 operation.
1 1 0
Exercise 5
Observation Discussion
Exercise 5 differs from Exercise 4 by an addition of
a new rung connected parallel to Lamp- 2 (O:2/2).
Switch-0 (I:1/0) and O:2/3 is connected parallel to
Lamp-2. The purpose of this is to allow O:2/3 to be
triggered only when Lamp -2 is triggered. This can
be applied when an output can only be expected
when certain condition is achieved. For example, an
infrared sensor to detect presence of human in a
space can be taken as an output trigger (O:2/2)
while an air-conditioner is O:2/3. The air
conditioner can only be ON when O:2/2 is detected
to be TRUE.
Start – Stop – Switch – Lamp – O:
NO NC 0 2 2/3
0 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 1 1 0 0
1 0 0 1 0
1 1 0 0 0
1 0 1 1 1
1 1 1 0 0
Review Questions:
1. List the different types of PLC programming languages. [2]
Ladder Diagram (LD) Instructions are
arranged in rungs like
ladder-formatted
schematic diagram. It
is the most used PLC
language. It defines
control actions in
terms of relay
contacts and coil.
Function Block Diagram (FBD) Graphical depiction of
process flow using
interconnecting
blocks. The
instructions are wired
together in a block to
accomplish certain
functions.
Sequential Function Chart (SFC) Graphical depiction of
interconnecting steps,
actions and
transitions. It works
like a flow chart and
used to accommodate
the programming of
more advanced
processes.
3. Write a PLC ladder diagram to control a staircase lamp from two switches.
Observation Discussion
Switch 1 (I:1/0) is in series
with Switch 2 (I:1/1), which
has a NC contact, the same
goes for Switch 2 which has a
NO contact. When both
switches are ON, the
respective NC switches will
prevent Lamp-1 (O:2/0) from
turning ON. Thus, it can be
controlled on 2 different
floors.
Switch 1 Switch 2 Lamp 1
0 0 0
1 0 1
0 1 1
1 1 0
One-Shot Rising is a retentive input instruction that triggers an event to occur one time. It is used when
an event must start based on the change of state of the rung from FALSE to TRUE. OSR instruction is
placed in the ladder logic before output instruction. The output is referenced as the one-shot within the
program. A bit address is entered for the OSR whether it is a binary file or an integer file address. The
bit address cannot be used anywhere else in your program. The address assigned to the OSR is not the
address referenced by the program, nor does it indicate the state of the OSR. The address only allows
the OSR to remember which state the rung was previously in. When the rung conditions preceding the
OSR goes from False to True, the OSR instruction goes true for 1 scan only. [1]
Lab 2B: Programmable Logic Controller Timer Functions
Observation Discussion
Timer-On Delay (T4:1) starts accumulating when
input (I:1/0) is ON. At the same time, the Timer-
Enable Bit (T4:/1 EN) and Timer-Timing Bit
(T4:1/TT) acts as a switch in its ON state, energizing
the output (O:2/0 and O:2/1). After 10 seconds which
is set by the preset value, T4:1/EN Bit and T4:/1 TT
Bit will be in their OFF state, while Timer Done Bit
(T4:/1 DN) will ON and energize the output (O:2/2).
This program can be applied in situations where a
delayed action occurs after a countdown. For
example, to turn on a gas supply after the ON switch
is triggered.
Observation Discussion
Timer-On Delay starts accumulating when input
(I:1/0) is ON. After 10 seconds, the Timer-Done bit
(T4:/1 DN) contacts closes and trigger the Timer-On
Delay (T4:2). Due to the pre-set value being 80, after
8 seconds, T4:2 will stop accumulating. When I:1/0
is OFF, T4:1 and T4:2 will restart their accumulation
from 0. This program can be applied to a conveyor
belt system, T4:1 could have a pre-set time value for
an object to travel to the designated point. At the
designated point, T4:2 would be triggered to time the
process of checking the product, it will only initialise
the next process after the 8 seconds (preset time).
When there is no product in the belt system, both
timers can be reset to 0.
Observation Discussion
When input (I:1/0) is closed, the first Timer-On
Delay (T4:1) will trigger and starts accumulating.
After 10 seconds, the Timer-Done Bit (T4:1/DN) will
ON. Hence, Timer- On Delay (T4:2) will starts
accumulating. After 8 seconds, the Timer-Done Bit
(T4:2 DN) will open. At this instance, T4:2/DN
opens and remain as its closed state. T4:1 will restart
its accumulation from 0. When I:1/0 is opened, both
timer’s accumulation will reset to 0. This is applied
to control movement of boxes along a conveyor belt
to ensure each box is weighed and inspected as set.
Exercise 4 – Timer Off Delay
Observation Discussion
When input (I:1/0) is ON, the Timer-Enable Bit
(T4:1/EN) and the Timer-Done Bit (T4:1/ DN) will
ON and energizes output (O:2/0 and O:2/2). When
I:1/0 is OFF, the Timer-Off Delay (T4:1) will starts
accumulating. Hence, the Timer-Timing Bit (T4:1/
TT) will energize the output (O:2/1). At this moment,
T4:1/EN will de-energize O:2/0. After the pre-set 10
seconds, all bits will be OFF and all output is de-
energized. It can be used when a conveyor belt needs
to be stopped after a certain amount of time to
prevent overloading. When a product reaches the end
of the conveyor, the motor will turn off and activate
the Timer-Off Delay to ensure efficient operation.
Observation Discussion
Retentive On Timer will not reset its
accumulation value when it is not
enabled. Toggle Switch 0 (I:1/0) is used
to energize the Retentive Timer On
(T4:1), output (O:2/0 and O:2/2) are
energized. When T4:1 has accumulated
for 20 seconds, the Timer Done Bit
(T4:1/DN) is closed, de-energizing
output O:2/1. When Toggle-Switch 1 is
closed, the reset output will be ON, thus
it will reset the accumulation of T4:1.
RTO is used to monitor the run time of a
machine to ease the maintenance
scheduling before any breakdown
occurs.
Review Questions:
1. List the different types of PLC timer functions. [1]
On-delay timer Activated when the instruction is true.
4. Write a PLC ladder diagram to control a set of 2 running lights. Maintain a 5s light on interval.
Observation Discussion
Exercise 1
Observation Discussion
When door is fully closed, the SHUT lamp (O:2/4) is
energized. This is because LS 2 (I:1/4) is fully
closed. This changes the state of LS 2 in rung 001 to
be opened, this prevent the motor from going further
downwards.
1. https://www.etf.ues.rs.ba/~slubura/Procesni%20racunari/Programmable%20Logic
%20Controllers%204th%20Edition%20(W%20Bolton).pdf
2. https://lib-ugtasiwfbmws47z3vw35fefu.1lib.fr/book/2849210/8d510a
3. https://www.electricalvolt.com/2022/08/difference-between-compact-plc-and-modular-plc/
#:~:text=A%20compact%20PLC%20is%20a,modules%20in%20a%20single%20package.
4. https://instrumentationtools.com/difference-between-compact-plc-and-modular-plc/
#:~:text=Modular%20Type%20PLC%20is%20a,number%20of%20inputs%2C%20and
%20outputs.