CAP Module 1 - Introduction - CAPS Module 1 - Introduction To PLC's - 02
CAP Module 1 - Introduction - CAPS Module 1 - Introduction To PLC's - 02
PLCs were introduced to industry early 1970 as electronic replacements for electromechanical
relay controls. In applications where relays typically control the starting and stopping of electric
motors and other discrete output devices, the reliability of an electronic PLC meant fewer system
failures and longer operating life.
The re-programmability of a PLC also meant changes could be implemented to the control system
strategy must easier than with relay circuits, where re-wiring was the only way to alter the
system’s function. Additionally, the computer-based nature of a PLC meant that process control
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 1/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
data could now be communicated by the PLC over networks, allowing process conditions to be
monitored in distant locations, and by multiple operator stations.
While Ladder Diagram programming definitely has limitations compared to other computer
programming languages, it is relatively easy to learn and diagnose, which is why it remains
popular as a PLC programming language today. Typical devices connecting to a PLC’s inputs
include hand switches, process switches, sensors, analog transmitters (4-20 mA), thermocouples,
thermistors, and strain gauges. Typical devices connecting to a PLC’s outputs include electric
lamps, solenoids, relay coils, motor contactors, analog final control elements (e.g. throttling control
valves, variable-speed motor drives), and audible buzzers.
While PLCs were originally designed for discrete (on/off) control applications such as conveyor
belt management, batch sequencing, and assembly line controls, modern PLCs are equally
capable of inputting and outputting analog signals as well. Thus, it is just as likely now to find a
PLC performing PID loop control as it is to find a PLC turning discrete devices on and off.
PLC Advantages
Flexibility:
One single Programmable Logic Controller can easily run many machines.
Correcting Errors:
In old days, with wired relay-type panels, any program alterations required time for rewiring of
panels and devices. With PLC control any change in circuit design or sequence is as simple as
retyping the logic. Correcting errors in PLC is extremely short and cost effective.
Space Efficient:
Today's Programmable Logic Control memory is getting bigger and bigger this means that we can
generate more and more contacts, coils, counters, sequencers, counters and so on. We can have
thousands of contact counters and counters in a single PLC. Imagine what it would be like to have
so many things in one panel.
Low Cost:
Prices of Programmable Logic Controllers vary from few hundreds to few thousands. This is
nothing compared to the prices of the contact and coils and counters that you would pay to match
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 2/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
the same things. Add to that the installation cost, the shipping cost and so on.
Testing:
A Programmable Logic Control program can be tested and evaluated in a lab. The program can
be tested, validated and corrected saving very valuable time.
Visual observation:
When running a PLC program a visual operation can be seen on the screen. Hence
troubleshooting a circuit is really quick, easy and simple.
The input section or input module consists of devices like sensors, switches and many other real
world input sources. The input from the sources is connected to the PLC through the input
connector rails. The output section or output module can be a motor or a solenoid or a lamp or a
heater, whose functioning is controlled by varying the input signals.
It is the brain of the PLC. It can be a hexagonal or an octal microprocessor. It carries out all the
processing related to the input signals in order to control the output signals based on the control
program.
Programming Device:
It is the platform where the program or the control logic is written. It can be a handheld device or a
laptop or a computer itself.
Power Supply:
It generally works on a power supply of about 24 V, used to power input and output devices.
Memory:
The memory is divided into two parts- The data memory and the program memory. The program
information or the control logic is stored in the user memory or the program memory from where
the CPU fetches the program instructions. The input and output signals and the timer and counter
signals are stored in the input and output external image memory respectively.
Figure 1
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 3/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
Beside the PLC hardware, the PLC contains some software. Some of it are pre-installed, and
some of it will be your software.
PLC Firmware
First, let us divide the software inside the PLC into two parts. A little piece of software called the
firmware and another piece of software called the program. The firmware is the operating system
in the PLC. The firmware is responsible for running your program commands, managing
communications and some other tasks. Some of the functions of the firmware is to make the
microprocessor and the RAM communicate, and to make the PLC compatible with the PLC
programming software. Many other tasks are handled by the firmware, and you will almost never
have to worry about it. The firmware is installed by the manufacturer of the PLC.
PLC program
The other piece of software is actually the software that we develop for the PLC. It is the program
of logic that we put inside the PLC. The program of logic that reads the inputs and sets the
outputs. Before learning more about the program of logic we need to know is where in the PLC
the program is placed.
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 4/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
Normally the program is saved in the RAM of the PLC, but as we know from the previous chapter
the RAM can be a risky place to save your program. It can be risky because the RAM will be
cleared when the power is off. Most PLC’s have a backup battery, that prevents the RAM from
being deleted, but there is a better place to save your program more permanently – the EEPROM.
The data in the EEPROM will still be there even after the power has been removed. So, the
EEPROM is in most cases the optimal place for the program.
The program of logic that we save into the PLC is the main function of the PLC. Your PLC
program will decide what outputs to set with the inputs as decisions. When the PLC is powered up
it will run as following:
Figure 2
First thing the PLC will do is to check the status of all the inputs. To be more precise, the PLC will
take an image of all the inputs and save it in the RAM. Where taking an image means that the
PLC will save a binary value representing the inputs.
After the PLC has checked the status of all its inputs, the PLC will then execute the program. The
logic program that we program the PLC with will now run, and as it runs the program will collect
some numbers and save them temporary. You might already have guessed what these numbers
are. These numbers are the output status as the logic of the program have decided. When the
program has ended the PLC will update the output status. The same thing now happens as with
the inputs only in reverse. The number representing the output status will now be saved as the
output status in the PLC, and the status of all the outputs will be updated.
These three steps are all called a scan cycle. One scan cycle is when the PLC has checked the
input status, executed the program and updated the output status.
The PLC is a fast thinker and this cycle happens within milliseconds. But it will be relevant to know
about the scan cycle and especially the scan time, which is the time one scan cycle takes. When
we are working with counters and other advanced functions in the PLC the scan time can be
crucial. The same happens with large projects with thousands of lines of code or ladder the scan
time might become an issue.
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 5/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
real-world control elements such as solenoids, valves, and motors. This is generally known as
input/output, or I/O, capability. Monolithic (“brick”) PLCs have a fixed amount of I/O capability built
into the unit, while modular (“rack”) PLCs use individual circuit board “cards” to provide
customised I/O capability.
Figure 3
The advantages of using replaceable I/O cards instead of a monolithic PLC design are numerous.
First, and most obvious, is the fact that individual I/O cards may be easily replaced in the event of
failure without having to replace the entire PLC. Specific I/O cards may be chosen for custom
applications, biasing toward discrete cards for applications using many on/off inputs and outputs,
or biasing toward analog cards for applications using many 4-20 mA and similar signals. Some
PLCs even offer the feature of hot-swappable cards, meaning each card may be removed and a
new one inserted without de-energising power to the PLC processor and rack.
Please note that one should not assume any system has hot-swappable cards, because if you
attempt to change out a card “live” in a system without this feature, you run the risk of damaging
the card and/or the rest of the unit it is plugged in to.
Some PLCs have the ability to connect to processor-less remote racks filled with additional I/O
cards or modules, thus providing a way to increase the number of I/O channels beyond the
capacity of the base unit. The connection from host PLC to remote I/O racks usually takes the
form of a special digital network, which may span a great physical distance:
Figure 4
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 6/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
An alternative scheme for system expansion is to network multiple PLCs together, where each
PLC has its own dedicated rack and processor. Through the use of communication instructions,
one PLC may be programmed to read data from and/or write data to another PLC, effectively
using the other PLC as an extension of its own I/O. Although this method is more expensive than
remote I/O (where the remote racks lack their own dedicated processors), it provides the
capability of stand-alone control in the event the network connection between PLC processors
becomes severed.
Input/output capability for programmable logic controllers comes in three basic varieties:
1. discrete
2. analog
3. network
Discrete I/O
A “discrete” data point is one with only two states on and off. Process switches, pushbutton
switches, limit switches, and proximity switches are all examples of discrete sensing devices. In
order for a PLC to be aware of a discrete sensor’s state, it must receive a signal from the sensor
through a discrete input channel. Inside each discrete input module is (typically) a set of light-
emitting diodes (LEDs) which will be energised when the corresponding sensing device turns on.
Light from each LED shines on a photo-sensitive device such as a phototransistor inside the
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 7/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
module, which in turn activates a bit (a single element of digital data) inside the PLC’s memory.
This opto-coupled arrangement makes each input channel of a PLC rather rugged, capable of
isolating the sensitive computer circuitry of the PLC from transient voltage “spikes” and other
electrical phenomena capable of causing damage.
Energising an input channel lights the LED inside the opto-coupler, turning on the phototransistor,
sending a "high" signal to the PLC’s microprocessor, setting (1) that bit in the PLC’s input register:
Figure 5
The internal schematic diagram for a discrete input module (“card”) shown above reveals the
components typical for a single input channel on that card. Each input channel has its own
optocoupler, writing to its own unique memory register bit inside the PLC’s memory. Discrete input
cards for PLCs typically have 4, 8, 16, or 32 channels.
Indicator lamps, solenoid valves, and motor starters (assemblies consisting of contactors and
overload protection devices) are all examples of discrete control devices. In a manner similar to
discrete inputs, a PLC connects to any number of different discrete final control devices through a
discrete output channel. Discrete output modules typically use the same form of opto-isolation to
allow the PLC’s computer circuitry to send electrical power to loads: the internal PLC circuitry
driving an LED which then activates some form of photosensitive switching device. Alternatively,
small electromechanical relays may be used in lieu of opto-isolating semiconductor switching
elements such as transistors (DC) or TRIACs (AC). Setting a bit (1) in the PLC’s output register
sends a "high" signal to the LED inside the optocoupler, turning on the photo-TRIAC, sending AC
power to the output channel to energise the load:
Figure 6
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 8/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
As with the schematic diagram for a discrete input module shown previously, the schematic
diagram shown here for a discrete output module reveals the components typical for a single
channel on that card. Each output channel has its own optocoupler, driven by its own unique
memory register bit inside the PLC’s memory. Discrete output cards for PLCs also typically have
4, 8, 16, or 32 channels.
An important concept to master when working with DC discrete I/O is the distinction between
current-sourcing and current-sinking devices. The terms “sourcing” and “sinking” refer to the
direction of current (as denoted by conventional flow notation) into or out of a device’s control
wire3. A device sending (conventional flow) current out of its control terminal to some other
device(s) is said to be sourcing current, while a device accepting (conventional flow) current into
its control terminal is said to be sinking current.
To illustrate, the following illustration shows a PLC output channel is sourcing current to an
indicator lamp, which is sinking current to ground:
Figure 7
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 9/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
These terms really only make sense when electric current is viewed from the perspective of
conventional flow, where the positive terminal of the DC power supply is envisioned to be the
“source” of the current, with current finding its way “down” to ground (the negative terminal of the
DC power supply). In every circuit formed by the output channel of a PLC driving a discrete
control device, or by a discrete sensing device driving an input channel on a PLC, one element in
the circuit must be sourcing current while the other is sinking current.
If the discrete device connecting to the PLC is not polarity-sensitive, either type of PLC I/O module
will suffice. For example, the following diagrams show a mechanical limit switch connecting to a
sinking PLC input and to a sourcing PLC input:
Figure 8
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 10/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
Note the differences in polarity and labelling between the sinking card’s common terminal and the
sourcing card’s common terminal. On the “sinking” card, the input channel terminal is positive
while the common (“Com”) terminal is negative. On the “sourcing” card, the input channel terminal
is negative while the common (“VDC”) terminal is positive.
Some discrete sensing devices are polarity-sensitive, such as electronic proximity sensors
containing transistor outputs. A “sourcing” proximity switch can only interface with a “sinking” PLC
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 11/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
Figure 9
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 12/13
3/10/25, 9:45 PM Introduction to Programmable Logic Controllers: CAPS Module 1 - Introduction to PLC's
In all cases, the “sourcing” device sends current out of its signal terminal while the “sinking” device
takes current into its signal terminal.
Analog I/O
In the early days of programmable logic controllers, processor speed and memory were too
limited to support anything but discrete (on/off) control functions. Consequently, the only I/O
capability found on early PLCs were discrete in nature. Modern PLC technology, though, is
powerful enough to support the measurement, processing, and output of analog (continuously
variable) signals.
All PLCs are digital devices at heart. Thus, in order to interface with an analog sensor or control
device, some “translation” is necessary between the analog and digital worlds. Inside every
analog input module is an ADC, or Analog-to-Digital Converter, circuit designed to convert an
analog electrical signal into a multi-bit binary word. Conversely, every analog output module
contains a DAC, or Digital-to-Analog Converter, circuit to convert the PLC’s digital command
words into analog electrical quantities.
Analog I/O is commonly available for modular PLCs for many different analog signal types,
including:
Network I/O
Many different digital network standards exist for PLCs to communicate with, from PLC to PLC
and between PLCs and field devices. One of the earliest digital protocols developed for PLC
communication was Modbus, originally for the Modicon brand of PLC. Modbus was adopted by
other PLC and industrial device manufacturers as a de facto standard5, and remains perhaps the
most universal digital protocol available for industrial digital devices today.
Another digital network standard developed by a particular manufacturer and later adopted as a
de facto standard is Profibus, originally developed by Siemens.
https://skillslab.instructure.com/courses/515/pages/introduction-to-programmable-logic-controllers?module_item_id=13262 13/13