Module PLC
Module PLC
I. Introduction
For decades, manufacturing and other production industries rely in operating manually using
human labor. Nowadays, it was replaced by machine automation. Human labor is very effective yet it has
inevitable disadvantages. For example, in pencil manufacturing, a stage in the process is to place an eraser
at the pencil’s end, and it is done repeatedly for a thousand times and more. If a human labor is assigned
in this work, he will eventually get tired and bored, and it will significantly affect the efficiency of
production.
Programmable Logic Controller (PLC) is the primary technology used nowadays that provides
automation. In this module, you will be learning what composes PLC, its architecture, functions and
operation.
II. Objectives
After completion of the course the student should be able to:
Being a controller, PLC has the capacity to power and control different output devices to perform
specific functions. By programming, PLC is integrated with a certain machine logic while performing such
functions. Figure 4.1 shows the structure of PLC, the entire system is composed of five modules. Let us
describe each of them:
Source: SlidePlayer
Processor Module
Contains a memory, where the program is stored, and CPU, that makes decisions and executes
control instructions based on the program instructions in memory.
Programming Device
Used to input the desired instructions. These instructions determine what the PLC will do for
a specific input. Several methods are available in programming a PLC, where ladder programming is
most common.
Input Module
Accepts a variety of digital and analog signals from various field devices and converts them
into a logic signal that can be used by the CPU. Different kinds of switches, sensors and transducers
are the primary devices under this module.
Output Module
Converts control instructions from the CPU into a digital or analog signal that can be used to
control or power various field devices. These include indicators like lamps and alarms, and actuators
like motors, valves, solenoids, hydraulics, pneumatics, etc.
Supply the necessary power for the PLC and its peripherals. Most PLC system is powered
by 24 𝑉dc.
PLC can be compared to a personal computer (PC), it can perform various functions and do it
simultaneously. However, PCs excel in the processing and some advance features that a requires large
memory capacity. PLCs are limited in memory and can perform few functions, that why its best in
industrial processes where only basic operations are required. Moreover, PLCs are designed to be rugged
that is able to withstand industrial conditions.
PLC Applications
PLC are widely used is even outside the production industry. You may be familiar with
several day-to-day operation yet you may be surprised that those are PLC applications. Here are
some:
(a)
(b)
Bottling System
(c)
Such process may require additional sensors for error Source: Slideshare
detection and safety features. PLC can integrate such
features.
(d)
PLC Setup
Source: Festo
Figure 4.3. Basic PLC Trainer
Figure 4.5 shows one of the PLC used in our laboratory – Allen Bradley Micrologix 1000. It
has one (1) Input terminal with ten (10) ports – numbered 0 to 9, and (1) Output terminal with
six (6) ports – numbered 0 to 5. This model is powered by 24V dc power. The Serial port is used
to connect the PLC to a computer for programming and monitoring. Input indicators corresponds
to the input terminal. When a port is activated, its corresponding indicator lights up. Output
indicators have the same function. Status indicators tells the current status or operation of the
PLC. Power indicator indicates that the PLC is on. Run indicates when the PLC is doing its function
based on the program instruction. Fault indicates if the PLC detected error in the system and
connection. Force indicates if the input-output (IO) force functions are present or enabled.
Source: Google
Figure 4.5. Parts of PLC
Every operation done by the system is handled by the PLC. By concept, the controller
simply provides different ways of connecting an input to an output based on the instructions given
by the program. All training module requires a computer that will be used to write a program and
to download the program to the PLC.
Instruction List
It is a text-based low-level type of programming language which is based on how the
processor works. Instruction list is consisting of series of control instructions or commands like
using machine code in microprocessor. Every instruction consists of an operator and an operand.
Structured Text
Considered as high-level programming language. A textual language based on the
programming language PASCAL, BASIC or C. It is eventually used for more complex problems and
data structures. It uses comprehensive constructs to allow a very compact formulation of the
programming task and the ability to evaluate complex mathematical expression.
It offers the advantage that it allows a clear program structure. The disadvantage of this
language is its lower efficiency. The programs are slower and longer.
Ladder Diagram
A graphical programming language which was referenced from circuit diagrams. It is
combined with binary variables (digital logic operations) used for addressing, and it resembles the
circuit diagram of earlier relay control systems with contacts and coils.
Ladder logic is the main programming method used for PLCs and has been developed to
mimic relay logic so that the amount of retraining needed for engineers and programmers was
greatly reduced.
Source: Slideshare
In FBD, binary (digital) logic operations as well as timer, counter and comparator functions
and program and module jumps can be displayed.
Source: Slideshare
Figure 4.7. Functional Block Diagram
V. Ladder Programming
The PLC Ladder Program is a planned set of instructions resembling a hardwired ladder diagram.
It is the only component that will be downloaded to a PLC. Figure 4.9 shows the components of a ladder
program.
Vertically, the ladder program is divided into two parts – the left-half side is for the inputs and the
right-half side for the outputs. Other components are defined as follows:
Rail – are the two vertical lines on each side. Those are also called as Power rails, representing
the supplied power (left) and the ground (right).
Rung – are the horizontal lines where instructions are placed. It can simply be approximated as a
line connecting the supply and the ground to create a complete electrical loop.
Branch – refers to the line where input 5 is placed in Figure 4.9. Used to create a parallel path
with a rung.
Instructions – refers to the input and output symbols placed in a rung. Input instructions generally
represent logic switches or contacts. Output Instructions have a lot of options, it generally uses a
coil that represents any output device such as lamps and motors. It also has special logic
instructions that perform arithmetic and logic operations. Logic switches are also utilized in the
output as internal variable to perform subprocesses such as looping.
Logical Continuity
The output device of a rung is energized if electric power can conceptually flow from the
left side of the rung to the right side. Input devices are conditions, and if it is satisfied, the rung
becomes true. Otherwise, inputs are assumed to block the flow of power. It is called logical
continuity, if the left power rail has a continuous path of true condition to the output instruction.
Source: SlidePlayer
Figure 4.9. Logic Continuity
The PLC scans the ladder program rung by rung from top-to-bottom and left-to-right. This
basic sequence is altered whenever a jump or subroutine instructions are executed.
Source: LinkedIn
Figure 4.11. XIO Instruction
(a)
Source: LinkedIn
Output Latch (OTL)
Similar to OTE, it represents any output device like motor or lamp.
However, this instruction is activated when the input conditions are
true, and remains activated even if the conditions becomes false.
(b)
Instruction Addressing
While creating a PLC program, specific names are used to identify the instructions, similar
to what is shown in preceding figures. These names function as the address of an instruction, and
most of it corresponds to each port of the PLC I/O terminals shown on Figure 4.5, and to an
internal variable. The Allen-Bradley PLCs uses the following format:
Instruction Type – identifies the type of instruction or internal variable used. The following table
are some of the codes used to name an instruction.
Instruction Code
Input I
Output O
Status S2
Binary B3
Timer T4
Control R6
Integer N7
Float F8
Terminal Number – refers to a particular terminal of the PLC – input and output. A terminal
contains several ports or slots. Some PLC models particularly those used in larger systems have
many terminals. For the PLC shown in Figure 4.5, it has one input terminal and one output
terminal. Terminals are numbered starting from zero. Internal variables are assigned with a
specific terminal number.
o From the example given, ‘0’ refers to the first or only input terminal.
Port Number – refers to a specific slot on the terminal. For the PLC shown in Figure 4.5, the input
terminal has 10 ports and the output terminal has 6 ports. Ports are numbered starting from zero.
o From the example given, ‘4’ refers to the fourth slot of terminal 0.
(a)
(b)
NAND Function – the output is ON if any of the two inputs are OFF.
(c)
(d)
XOR Function – the output is ON if any of the two inputs is ON, but not both.
(e)
XNOR Function – the output is ON only if both of the two inputs are either OFF or ON.
(f)
Set / Reset Latch using Momentary Switch – used for continuous loops.
Source: LinkedIn
(g)
Accumulated Value – refers to the current value of the timer that has been accumulated from
the moment it was energized.
Preset Value – a value set by the programmer on the timer. When the accumulated value
equals the preset value, a status bit is set which can be used to control an output device.
Time Base Value – an interval for which the timer is going to use. It can be set to 1s, 0,01s or
0.001s. The actual time can be determined by multiplying the preset value and the time base
value. It also dictates the speed of accumulated value.
Timer Enable Bit (EN) – a status bit which is set when the input conditions to the left of the
timer instruction are true.
Timer Done Bit (DN) – a status bit which is set when the accumulated value equals the preset
value. It is reset when the input conditions become false.
Timer Timing Bit (TT) – a status bit which is set only when the timer is timing. It is reset when
the timing is done.
There are three types of timer instruction: TON, TOF and RTU.
For the ladder program shown in Figure 4.14, the TON preset value is 7.
Source: LogixPro
Figure 4.14. TON Ladder Program
The operation is illustrated in Figure 4.15. When the input switch (I:1/0) is activated, the
rung condition becomes true and the TON instruction (T4:0) activates. Timer starts, EN bit is set
and activated with the input. The accumulated value also starts and when the preset value is
reached, the DN bit is set. In rung 1, the DN bit is addressed as T4:0/DN and used to control the
output (O:2/0). Every time DN bit is set, the output is activated.
Source: LinkedIn
For the ladder program shown in Figure 4.16, the TOF preset value is 7.
Source: LogixPro
Figure 4.16. TOF Ladder Program
The operation is illustrated in Figure 4.17. While the input is true, the DN bit is set. When
the input switch (I:1/0) changes from true-to-false, the TOF instruction (T4:0) activates. Timer
starts, EN bit responds with input. The accumulated value also starts and when the preset value
is reached, the DN bit is reset. In rung 1, the DN bit is addressed as T4:0/DN and used to control
the output (O:2/0). Every time DN bit is set, the output is activated.
Source: LinkedIn
For the ladder program shown in Figure 4.18, the RTO preset value is 7.
Source: LogixPro
Figure 4.18. RTO Ladder Program
The operation is illustrated in Figure 4.19. When the input switch (I:1/0) is activated, the
rung condition becomes true and the RTO instruction (T4:0) activates. Timer starts, EN bit is set
and activated with the input. The accumulated value also starts but stays on its current value
when the input conditions becomes false, then continue its timing when the condition becomes
true again. When the preset value is reached, the DN bit is set. In rung 1, the DN bit is addressed
as T4:0/DN and used to control the output (O:2/0). Every time DN bit is set, the output is activated.
Source: LinkedIn
Accumulated Value – refers to the current value of the counter that increments by 1 every
false-to-true transition of inputs conditions. The initial value is zero.
Preset Value – a value set by the programmer on the counter. When the accumulated value
is equal or greater than the preset value, a status bit is set which can be used to control an
output device.
Counter Enable Bit (EN) – a status bit which is set when the input conditions become true,
and resets when becomes false.
Counter Done Bit (DN) – a status bit which is set when the accumulated value is equal or
greater than the preset value. It is normally reset using a reset instruction.
Overflow Bit (OV) – a status bit which is set when the maximum count is reached. Its value
varies with the PLC manufacturer. In Allen-Bradley PLCs, the overflow is reached when the
count is equal to 32,768.
For the ladder program shown in Figure 4.20, the CTU preset value is 10.
Source: LogixPro
The operation is illustrated in Figure 4.21. When the input switch (I:1/0) is activated, the
rung condition becomes true and the CTU instruction (T4:0) activates. EN bit is set and is activated
with the input. The accumulated value increments by 1. When the input condition becomes false,
EN resets.
The similar process occurs when the input conditions become true again. When the preset
value is exceeded, the DN bit is set. In rung 1, the DN bit is addressed as T4:0/DN and used to
control the output (O:2/0). Every time DN bit is set, the output is activated. The accumulated value
continues to increment in every count unless reset by a reset instruction.
Source: LinkedIn
Figure 4.21. CTU Operation
For the ladder program shown in Figure 4.22, the CTD preset value is −10.
Source: LogixPro
The operation is illustrated in Figure 4.23. When the input switch (I:1/0) is activated, the
rung condition becomes true and the CTD instruction (T4:0) activates. EN bit is set and is activated
with the input. The accumulated value decrements by 1. When the input condition becomes false,
EN resets.
The similar process occurs when the input conditions become true again. Compare to
CTU, the done bit is initially set or activated, but when the preset value is exceeded, the DN bit is
reset. In rung 1, the DN bit is addressed as T4:0/DN and used to control the output (O:2/0). Every
time DN bit is set, the output is activated. The accumulated value continues to decrement in every
count unless reset by a reset instruction.
Source: LinkedIn
Figure 4.23. CTD Operation
Figure 4.24 shows a rung added to the program to reset a counter. It is done by naming
the reset instruction with the address of the instruction (C5:0). The switch I:1/1 is used to activate
the reset.
Source: LogixPro
Set/Reset
Latch using
Momentary
Switch
Source: LogixPro
Figure 4.25. 2-second alternate sequence
Rung 0 is a set/reset latch using momentary switch. Input 1 (I:1/0) is used to start the sequence
while input 2 (I:1/1) is used to make the rung false, thus, stopping the sequence. The
internal variable (S:0/0) is placed both in the input and output to create a continuous
loop.
Rung 1 contains S:0/0 as input that activates the timer (T4:0) whose timing function (T4:0/TT) is
used to activate output 1 (O:2/0) in Rung 2.
Rung 3 contains the DN bit of T4:0 that activates the second timer (T4:1). The corresponding
timing function (T4:1/TT) is used to activate output 2 (O:2/1) in Rung 4.
The DN bit of T4:1 is placed in Rung 1 to create a loop and restart the sequence.