2/18/25
PLC Hardware and
Logic gates
Lecture 4
Contents
Contents
• I/O Section
• Types of Memory
• Fundamentals of Logic Gates
• Boolean Algebra
• Hardwired Logic vs. Programmed Logic
• Programming Word Level Logic Instructions
1
2/18/25
I/O Section
PLC Hardware - The I/O section
• The input/output (I/O) section of a PLC is the section to which all field devices are connected and
provides the interface between them and the CPU.
• Input/output arrangements are built into a fixed PLC while modular types use external I/O modules that
plug into the PLC.
• A rack-based I/O section shown in figure, made up of individual I/O modules.
• Input interface modules accept signals from the machine or process devices and convert them into
signals that can be used by the controller.
• Output interface modules convert controller signals into external signals used to control the machine or
process.
I/O Section
The I/O section
• Allen-Bradley controllers make a dis3nc3on between
a PLC chassis and rack as illustrated in Figure.
• The hardware assembly that houses I/O modules,
processor modules, and power supplies is referred to
as the chassis.
• Chassis come in different sizes according to the
number of slots they contain. In general, they can
have 4, 8, 12, or 16 slots.
• One benefit of a PLC system is the ability to locate
the I/O modules near the field devices, as illustrated
in Figure, to minimize the amount of wiring required.
• The processor receives signals from the remote input
modules and sends signals back to their output
modules via the communica3on module.
2
2/18/25
I/O Section
The I/O section
• In the context of Programmable Logic Controllers (PLCs), the terms "rack" and
"chassis" refer to different components of the PLC system that house and organize
the various modules. Here’s a breakdown of the differences:
• Rack
• Definition: A rack is a structure that holds multiple PLC modules, including the CPU,
input/output (I/O) modules, and communication modules.
• Function: It provides a physical framework for mounting and connecting various
modules. Racks often have slots for inserting modules and may include power
distribution.
• Capacity: Racks can vary in size, accommodating anywhere from a few to several
dozen modules, depending on the design of the PLC system.
• Modularity: Racks allow for the modular expansion of the system, enabling users to
add or replace modules as needed.
I/O Section
The I/O section
• Chassis
• Defini&on: A chassis is a specific type of rack that oPen refers to the complete housing for a
PLC system, including the backplane that connects the modules.
• Func&on: The chassis serves as the main enclosure that protects the internal components and
provides the necessary connec3ons for power and communica3on between the modules.
• Integra&on: The chassis typically integrates the backplane, which is a circuit board that
provides the electrical connec3ons between the CPU and I/O modules.
• Design: Chassis designs can vary, with some being more compact or having specific features
for heat dissipa3on and airflow.
• Summary
• Rack: Refers to the physical structure for moun3ng mul3ple PLC modules.
• Chassis: A more specific term that denotes the enclosure that includes the backplane and
houses the modules.
3
2/18/25
I/O Section
The I/O section
• A rack is referred to as a remote rack when it is located
away from the processor module.
• To communicate with the processor, the remote rack
uses a special communications network.
• Each remote rack requires a unique station number
to distinguish one from another.
• The remote racks are linked to the local rack through a
communications module.
• Addressing
• The PLC’s memory system stores information about the
status of all the inputs and outputs. To keep track of all
this information, it uses a system called addressing.
• An address is a label or number that indicates where a
certain piece of information is in a PLC’s memory
I/O Section
The I/O section
• Addressing schemes include rack/slot-based, versions of which are used in Allen-Bradley PLC-5 and SLC
500 controllers, tag-based used in Allen-Bradley ControlLogix controllers, and PC-based control used in
softPLCs.
• In general, rack/slot-based addressing elements include:
• Type— The type determines if an input or output is being addressed.
• Slot— The slot number is the physical location of the I/O module. This may be a combination of the
rack number and the slot number when using expansion racks.
• Word and Bit— The word and bit are used to identify the actual terminal connection in a particular I/O
module.
• A discrete module usually uses only one word, and each connection corresponds to a different bit
that makes up the word.
• The following are typical examples of input and output addresses:
4
2/18/25
I/O Section
The I/O section
• With a rack/slot address system the location of a module within a rack and the terminal number of a
module to which an input or output device is connected will determine the device’s address.
• Figure illustrates the Allen-Bradley PLC-5 controller addressing format and an example.
I/O Section
The I/O section
• Figure illustrates the Allen-Bradley SLC 500 controller addressing format. The address is used by the
processor to identify where the device is located to monitor or control it.
• The following are examples of SLC 500 real-world general input and output addresses:
• Every input and output device connected to a discrete I/O module is addressed to a specific bit in the
PLC’s memory.
• A bit is a binary digit that can be either 1 or 0.
• Analog I/O modules use a word addressing format, which allows the entire words to be addressed. The
bit part of the address is usually not used; however, bits of the digital representation of the analog
value can be addressed by the programmer if necessary.
10
5
2/18/25
I/O Section
Discrete I/O modules
• The most common type of I/O interface module is the
discrete type ( Figure ). This type of interface connects
field input devices of the ON/OFF nature such as
selector switches, pushbuttons, and limit switches.
• Likewise, output control is limited to devices such as
lights, relays, solenoids, and motor starters that
require simple ON/OFF switching.
• The classification of discrete I/O covers bit-oriented
inputs and outputs.
• In this type of input or output, each bit represents a
complete information element and provides the status
of some external contact or advises of the presence or
absence of power in a process circuit.
11
I/O Section
Discrete I/O modules
• Each discrete I/O module is powered by some field supplied voltage source.
• Since these voltages can be of different magnitude or type, I/O modules are available
at various AC and DC voltage raSngs,
12
6
2/18/25
I/O Section
Analog I/O modules
• Discrete devices are inputs and outputs that have only two
states: on and off. In comparison, analog devices represent
physical quantities that can have an infinite number of values.
• Typical analog inputs and outputs vary from 0 to 20 milliamps,
4 to 20 milliamps, or 0 to 10 volts.
• Figure illustrates how PLC analog input and output modules are
used in measuring and displaying the level of fluid in a tank.
• The analog input interface module contains the circuitry
necessary to accept an analog voltage or current signal from
the level transmitter field device.
• This input is converted from an analog to a digital value for use
by the processor.
• The circuitry of the analog output module accepts the digital
value from the processor and converts it back to an analog
signal that drives the field tank level meter.
13
I/O Section
Analog I/O modules
• Analog input modules normally have multiple input channels that allow 4, 8, or 16 devices to be interface
to the PLC.
• The two basic types of analog input modules are voltage sensing and current sensing. Analog sensors
measure a varying physical quantity over a specific range and generate a corresponding voltage or current
signal.
• Common physical quantities measured by a PLC analog module include temperature, speed, level, flow,
weight, pressure, and position.
• For example, a sensor may measure temperature over a range of 0 to 500°C, and output a corresponding
voltage signal that varies between 0 and 50 mV.
• The analog output interface module receives from the processor digital data, which are converted into a
proportional voltage or current to control an analog field device.
• The transition of a digital signal to analog values is accomplished by a digital-to-analog (D/A) converter,
the main element of the analog output module.
• An analog output signal is a continuous and changing signal that is varied under the control of the PLC
program. Common devices controlled by a PLC analog output module include instruments, control valves,
chart recorder, electronic drives, and other types of control devices that respond to analog signals.
14
7
2/18/25
Memory
Memory types
• Memory can be placed into two general categories: volatile and nonvolatile.
• Volatile memory will lose its stored information if all operating power is lost or removed.
• Volatile memory is easily altered and is quite suitable for most applications when supported by
battery backup.
• Nonvolatile memory can retain stored information when power is removed accidentally or
intentionally.
• As the name implies, programmable logic controllers have programmable memory that allows
users to develop and modify control programs. This memory is made nonvolatile so that if power
is lost, the PLC holds its programming.
• Read Only Memory (ROM) stores programs, and data cannot be changed after the memory chip
has been manufactured. ROM is normally used to store the programs and data that define the
capabilities of the PLC.
• ROM memory is nonvolatile, meaning that its contents will not be lost if power is lost. ROM is
used by the PLC for the operating system. The operating system is burned into ROM by the PLC
manufacturer and controls the system software that the user uses to program the PLC.
15
Memory
Memory types
• Random Access Memory (RAM), sometimes referred to as read-write (R/W) memory, is
designed so that information can be written into or read from the memory.
• RAM is used as a temporary storage area of data that may need to be quickly changed. RAM is
volatile, meaning that the data stored in RAM will be lost if power is lost. A battery backup is
required to avoid losing data in the event of a power loss.
• Most PLCs use CMOSRAM technology for user memory. CMOS-RAM chips have very low current
draw and can maintain memory with a lithium battery for an extended time, two to five years in
many cases.
• Some processors have a capacitor that provides at least 30 minutes of battery backup when the
battery is disconnected, and power is OFF.
• Erasable Programmable Read-Only Memory (EPROM) provides some level of security against
unauthorized or unwanted changes in a program. EPROMs are designed so that data stored in
them can be read, but not easily altered without special equipment.
• For example, UV EPROMs (ultraviolet erasable programmable read only memory) can only be
erased with an ultraviolet light. EPROM memory is used to back up, store, or transfer PLC
programs
16
8
2/18/25
Memory
Memory types
• Electrically erasable programmable read-only memory (EEPROM) is a nonvolatile memory that
offers the same programming flexibility as does RAM.
• The EEPROM can be electrically overwritten with new data instead of being erased with
ultraviolet light. Because the EEPROM is nonvolatile memory, it does not require battery backup.
• It provides permanent storage of the program and can be changed easily using standard
programming devices. Typically, an EEPROM memory module is used to store, back up, or
transfer PLC programs.
• Flash EEPROMs are like EEPROMs in that they can only be used for backup storage. The main
difference comes in the flash memory: they are extremely fast at saving and retrieving files.
• In addition, they do not need to be physically removed from the processor for reprogramming;
this can be done using the circuitry within the processor module in which they reside.
• Flash memory is also sometimes built into the processor module, where it automatically backs up
parts of RAM.
• If power fails while a PLC with flash memory is running, the PLC will resume running without
having lost any working data after power is restored.
17
HMI
Human Machine Interfaces (HMIs)
• A human machine interface (HMI) can be connected to communicate with a PLC and to replace
pushbu_ons, selector switches, pilot lights, thumbwheels, and other operator control panel
devices.
• Luminescent touch-screen keypads provide an operator interface that operates like tradi`onal
hardwired control panels.
• Human machine interfaces give the ability to the operator and to management to view the
opera`on in real `me.
18
9
2/18/25
Logic Gates
Fundamentals of Logic
• A logic gate is a circuit with several inputs but only one output that is activated by combinations
of input conditions.
• The two-state binary concept, applied to gates, can be the basis for making decisions. The high
beam automobile lighting circuit of Figure is an example of a logical AND decision. For this
application, the high beam light can be turned on only when the light switch AND the high beam
switch are closed.
• The dome light automobile circuit of Figure is an example of a logical OR decision. For this
application, the dome light will be turned on whenever the passenger door switch OR the driver
door switch is activated.
19
Logic Gates
Fundamentals of Logic
• The operations performed by digital equipment are based on three fundamental logic functions:
AND, OR, and NOT. Each function has a rule that will determine the outcome and a symbol that
represents the operation.
• The AND Function
• The symbol drawn in Figure is that of an AND gate. An AND gate is a device with two or more
inputs and one output. The AND gate output is 1 only if all inputs are 1.
• The AND logic gate operates similarly to control devices connected in series
20
10
2/18/25
Logic Gates
Fundamentals of Logic
• The OR Function
• An OR gate can have any number of inputs but only one output. The OR gate output is 1 if one or
more inputs are 1.
• The OR logic gate operates similarly to control devices connected in parallel.
21
Logic Gates
Fundamentals of Logic
• The NOT Function
• Unlike the AND and OR functions, the NOT function can have only one input. The NOT output is 1
if the input is 0. The output is 0 if the input is 1.
• The result of the NOT operation is always the inverse of the input, and the NOT function is,
therefore, called an inverter.
• The NOT function is often depicted by using a bar across the top of the letter, indicating an
inverted output.
• The small circle at the output of the inverter is termed a state indicator and indicates that an
inversion of the logical function has taken place.
22
11
2/18/25
Logic Gates
Fundamentals of Logic
• The NOT symbol placed at the output of an AND gate would invert the normal output result. An
AND gate with an inverted output is called a NAND gate.
• The NAND gate symbol and truth table are shown in Figure. The NAND function is often used in
integrated circuit logic arrays and can be used in programmable controllers to solve complex logic.
• The same rule about inverting the normal output result applies if a NOT symbol is placed at the
output of the OR gate. The normal output is inverted, and the function is referred to as a NOR
gate. The NOR gate symbol and truth table are shown in Figure
23
Boolean Algebra
Boolean Algebra
• The mathema`cal study of the binary number system and logic is called Boolean algebra. The
purpose of this algebra is to provide a simple way of wri`ng complicated combina`ons of logic
statements.
• There are many applica`ons where Boolean algebra could be applied to solving PLC programming
problems. Boolean algebra as related to AND, OR, and NOT func`ons are given below in Table.
24
12
2/18/25
Boolean to Logic gates
Developing Logic Gate Circuits from Boolean Expressions
• As logic gate circuits become more complex, the need to express these circuits in Boolean form
becomes greater.
• Figure shows a logic gate circuit developed from the Boolean expression Y = AB + C. The
procedure is as follows:
• Boolean expression: Y = AB + C
• Gates required: (by inspection)
• 1 - AND gate with input A and B
• 1 - OR gate with input C and output from previous AND gate
25
Boolean to Logic gates
Developing Logic Gate Circuits from Boolean Expressions
• Figure shows a logic gate circuit developed from the Boolean expression Y = A(BC + D).
• The procedure is as follows:
• Boolean expression: Y = A(BC + D)
• Gates required: (by inspection)
• 1 - AND gate with input B and C
• 1 - OR gate with inputs B, C, and D
• 1 - AND gate with inputs A and the output from the OR gate
26
13
2/18/25
Logic gates to Boolean
Producing the Boolean Equation for a Given Logic Gate Circuit
• The Boolean equation for the logic circuit of Figure is determined as follows:
• The output of the OR gate is A + B
• The output of the inverter is 𝑫 !
• Based on the input combination applied to the AND gate the Boolean equation
! (A + B)
for the circuit is Y = C𝑫
27
Logic gates to Boolean
Producing the Boolean Equation for a Given Logic Gate Circuit
28
14
2/18/25
Comparison
Hardwired Logic versus Programmed Logic
• The term hardwired logic refers to logic control functions that are determined by the way devices
are electrically interconnected.
• Hardwired logic can be implemented using relays and relay ladder schematics. Relay ladder
schematics are universally used and understood in industry.
• Figure shows a typical relay ladder schematic of a motor stop/start control station with pilot
lights. The control scheme is drawn between two vertical supply lines.
• All the components are placed between these two lines, called rails or legs, connecting the two
power lines with what look like rungs of a ladder—thus the name, relay ladder schematic.
29
Comparison
Hardwired Logic versus Programmed Logic
• Hardwired logic is fixed; it is changeable only by altering the way devices are
electrically interconnected.
• In contrast, programmable control is based on the basic logic functions, which are
programmable and easily changed.
• These functions (AND, OR, NOT) are used either singly or in combinations to form
instructions that will determine if a device is to be switched on or off.
• The form in which these instructions are implemented to convey commands to
the PLC is called the language . The most common PLC language is ladder logic .
• Figure shows a typical ladder logic program for the motor start/ stop circuit. The
instructions used are the relay equivalent of normally open (NO) and normally
closed (NC) contacts and coils.
30
15
2/18/25
Comparison
Hardwired Logic versus Programmed Logic
• PLC contact symbolism is a simple way of expressing the control logic in terms of symbols. These
symbols are basically the same as those used for representing hardwired relay control circuits.
• Because the PLC uses ladder logic diagrams, the conversion from any existing relay logic to
programmed logic is simplified.
• Each rung is a combination of input conditions (symbols) connected from left to right, with the
symbol that represents the output at the far right.
• The symbols that represent the inputs are connected in series, parallel, or some combination of
the two to obtain the desired logic.
• The following group of examples illustrates the relationship between the relay ladder schematic,
the ladder logic program, and the equivalent logic gate circuit.
31
Comparison
Hardwired Logic versus Programmed Logic
32
16
2/18/25
Comparison
Hardwired Logic versus Programmed Logic
33
Programming
Programming Word Level Logic Instructions
• Most PLCs provide word-level logic instructions as part of their instruction set.
• Figure illustrates the operation of the AND instruction to perform a word-level AND operation
using the bits in the two source addresses.
• This instruction tells the processor to perform an AND operation on B3:5 and B3:7 and to store
the result in destination B3:10 when input device A is true. The destination bits are a result of the
logical AND operation.
34
17
2/18/25
Programming
Programming Word Level Logic Instructions
• Figure illustrates the operation of a word-level OR instruction, which ORs the data in Source A, bit
by bit, with the data in Source B and stores the result at the destination address.
• The address of Source A is B3:1, the address of Source B is B3:2, and the destination address is
B3:20.
• The instruction may be programmed conditionally, with input instruction(s) preceding it, or
unconditionally, as shown, without any input instructions preceding it.
35
18