Professional Documents
Culture Documents
21
Literature
Petruzella, Frank D.
Programmable Logic Controllers
2011, McGraw-Hill
ISBN 978-0-07-351088-0
Berger, Hans
Automating with SIMATIC S7-1200
2011, Publicis
ISBN 978-3-89578-356-2
Rehg, James A.
Programmable Logic Controllers
2009, Pearson Prentice Hall
ISBN 978-0135048818
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 22
Programmable Logic Controllers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 24
Programmable Logic Controllers
• Most widely used in industrial
process control technology
• Programmable controller has
eliminated much of the
hardwiring
• Designed for multiple inputs
and outputs
• Basically a digital computer
designed for use in machine
control (abbreviation PLC)
• Capable of performing
switching, timing, counting, Source: Siemens
calculating, comparing,
processing of analog signals
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 25
Learning Outcomes
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 26
PLC Hardware and Components
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 27
PLC Hardware and Components
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 28
PLC Hardware and Components
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 29
Principles of Operation
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 30
Principles of Operation
• Relay method for motor
control
• Motor starter coil (M)
energized
a) when both pressure and
temperature switches
are closed
b) Or when the manual
button is pressed
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 31
Principles of Operation
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 32
Fundamentals of Logic
Binary Principle
• Refers to the idea that many things can be thoughts of as
existing in only one of two states
• States are 1 and 0
• 1 and 0 can represent ON or OFF, open or closed, true or false,
high or low, …
Logic Gate
• Circuit with several inputs but only one output activated by
particular combinations of
input conditions
• Basis for making decisions
• Example: high beam
automobile lighting circuit
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 33
Fundamentals of
Logic
AND Function
• AND-gate output is 1 only
if all inputs are 1
• Logic gate truth tables
show each possible
combinations
• AND-truth table
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 34
Fundamentals of Logic
AND Function
• Operates similarly to control devices connected
in series
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 35
Fundamentals of
Logic
OR Function
• Any number of inputs
• One output
• Output is 1 if one or
more inputs are 1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 36
Fundamentals of Logic
OR Function
• Control devices connected in parallel
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 37
Fundamentals of Logic
NOT Function
• Only one input
• Output is 1 if the input is 0 output is the
inverse of the input inverter
• Small circle at the output is termed a state
indicator and indicates that an inversion has
taken place
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 38
Fundamentals of Logic
NOT Function
• Most often used in
conjunction with AND
or OR gate
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 39
Fundamentals of Logic
NOT Function
• NOT-symbol placed at the
output of an AND gate
inverting the result called
NAND gate
• NOT-symbol placed at the
output of an OR gate
inverting the result called
NOR gate
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 40
Fundamentals of Logic
XOR Function
• Exclusive OR function
• Output of the circuit is HIGH
only when one input or the
other is HIGH, but not both
• Commonly used for the
comparison of two binary
numbers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 41
Fundamentals of Logic
Boolean Algebra
• Mathematical study of the binary number system
and logic
• Provides a simple way of writing complicated
combinations of logic statements
• Implemented in the same logic as relay ladder
logic
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 42
Fundamentals of Logic
Boolean Algebra
• Inputs are represented by capital letters A, B, C,
…
• Output represented by the capital letter Y
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 43
Fundamentals of Logic
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 44
Fundamentals of Logic
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 45
Fundamentals of Logic
Boolean Algebra –
Basic Laws
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 47
Fundamentals of Logic
Distributive Law
A B C BC A+(B C) A+B A+C (A+B)
(A+C)
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 48
PLC Programming
The term hardwired logic refers to logic control
functions that are determined by the way devices are
electrically interconnected.
Hardwired logic
is fixed and
changeable
only by altering
the way devices
are electrically
interconnected.
Hardwired motor
control program.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 49
PLC Programming
Programmable control is based on the basic
logic functions, which are programmable and easily
changed.
PLC programmed
motor control
program.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 50
PLC Programming
A common PLC programming language is ladder logic
(LAD).
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 51
PLC Programming
Relationship between the relay ladder schematic, the
ladder logic program, and the equivalent logic gate
circuit.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 53
PLC Programming
Two limit switches connected in parallel with each other
and in series with a pressure switch to control a pilot
light.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 54
PLC Programming
One limit switch connected in series with a normally
closed pushbutton and used to control a solenoid valve.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 55
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 56
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 57
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 59
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 60
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 62
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 64
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 65
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 66
PLC Programming
Flip-Flop
• Bistable
• Can, on command, flip into one stable state of
flop back again to the other
• Basis RS-Flip-Flop using NOR-Gates
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 67
PLC Programming
1. Default setting
2. Setting memory
3. Save/maintain memory
4. Reset memory
5. Default setting
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 68
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 69
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 70
PLC Programming
Problem of Priority
• Combination R = S = 1 not allowed
• Pre-logic defines priority of either R or S
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 71
PLC Programming
S has priority
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 72
PLC Programming
R has priority
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 73
PLC Programming
Locking
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 75
PLC Programming
During each program scan cycle, the processor
reads all the inputs, takes these values, and energizes or
de-energizes the outputs according to the user program.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 76
PLC Programming
The time it takes to complete a scan cycle is a measure
of how fast the controller can react to changes in inputs.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 77
PLC Programming
Overview of the data flow during the scan process.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 78
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 79
PLC Programming
Instruction list programming language consists of a
series of instructions that refer to the basic AND, OR, and
NOT logic gate functions.
Hardwired relay
control circuit
Equivalent instruction
list program
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 80
PLC Programming
Structured text is a high level language primarily
used to implement more complex procedures.
Ladder diagram
Equivalent
structured text
program.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 81
PLC Programming
Ladder diagram language is a common used PLC
language and is designed to mimic hardwired relay logic.
Hardwired relay
control circuit
Equivalent ladder
diagram program
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 82
PLC Programming
Functional block diagram programming uses
instructions that are programmed as blocks wired
together to accomplish certain functions.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 83
PLC Programming
Ladder diagram and functional block diagram
programming used to produce the same logical output.
Ladder diagram
Equivalent function
block diagram.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 84
PLC Programming
Sequential function
chart programming
language is similar to a
flowchart of your
process.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 85
PLC Programming
Branch instructions are used to create parallel paths of
input condition instructions.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 86
PLC Programming
Output branching allows a true logic path to control
multiple outputs
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 87
PLC Programming
A seal-in circuit is a method of maintaining current flow
after a momentary switch has been pressed and
released.
Hardwired
Programmed
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 88
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 89
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 90
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 91
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 92
PLC Programming
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 93
PLC Programming
S1 S2 S3 S4 Power Q
3 kW 4 kW 5 kW 6 kW
0 0 0 0 18 kW 1
0 0 0 1 15 kW 1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 94
Karnaugh-Veitch (KV)-Diagram
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 96
Karnaugh-Veitch (KV)-Diagram
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 97
Karnaugh-Veitch (KV)-Diagram
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 98
Karnaugh-Veitch (KV)-Diagram
Example
Find the optimized logic function of the expression
𝑌 = 𝐴𝐵 + 𝐴𝐵 + 𝐴𝐵
using a KV-diagram.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 99
Karnaugh-Veitch (KV)-Diagram
Example
Find the optimized logic function of
the expression as shown in the truth
table, using a KV-diagram.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 100
Karnaugh-Veitch (KV)-Diagram
E3 E3
E2
E4
E2
E4
E2
E1 E1 E1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 101
Karnaugh-Veitch (KV)-Diagram
E3 E3
1 0 0 1 E2
E4
1 1 0 0
E2
1 1 1 1
E4
0 1 1 1 E2
E1 E1 E1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 103
Karnaugh-Veitch (KV)-Diagram
Back to pump-example:
𝑌
= 𝑆1 𝑆2 𝑆3 𝑆4 + 𝑆1 𝑆2 𝑆3 𝑆4 + 𝑆1 𝑆2 𝑆3 𝑆4
+ 𝑆1 𝑆2 𝑆3 𝑆4
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 105
Karnaugh-Veitch (KV)-Diagram
Back to pump- S3 S3
example:
S2
S4
𝑌
= 𝑆1 𝑆2 𝑆3 𝑆4 S2
+ 𝑆1 𝑆2 𝑆3 𝑆4 S4
+ 𝑆1 𝑆2 𝑆3 𝑆4 S2
+ 𝑆1 𝑆2 𝑆3 𝑆4
S1 S1 S1
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 106
Programming Timers
Learning Objectives
• Most commonly used PLC instruction, after coils
and contacts
• Way in which they can control outputs
• Discussion of the basics PLC on-delay timer
function
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 113
Programming Timers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 114
Programming Timers
The on-delay timer is sometimes referred to as DOE, which
stands for delay on energize.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 115
Programming Timers
On-delay timer circuit that uses a normally closed, timed
open (NCTO) contact.
Timer Instructions
• Provide the same functions as on-delay and off-delay timing relays
• Time setting can be easily changed
• Timer accuracy and repeatability extremely high
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 119
Programming Timers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 120
Programming Timers
Example
A conveyer belt starts
5sec after start button
is activated.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 122
Programming Timers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 123
Programming Timers
Example
Usage of an off-delay timer instruction to switch
motors off sequentially at 5 seconds intervals.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 126
Programming Timers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 127
Programming Timers
A retentive timer
accumulates time
whenever the device
receives power, and it
maintains the current
time should power be
• Electromechanical retentive timer.
removed from the device. • If power is removed from the motor,
the shaft stops but does not reset.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 128
Programming Timers
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 130
Programming Counters
Learning Objectives
• List and describe the functions of PLC counter
instructions
• Analyze and interpret typical PLC counter ladder
logic programs
• Apply the PLC counter function and associated
circuitry to control systems
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 133
Programming Counters
Programmed counters
serve the same function
as mechanical
counters.
• Every time the actuating lever is moved over, the
counter adds one number.
• Resetting to zero is done with a pushbutton
located on the side of the unit.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 134
Programming Counters
Electronic counters can
count up, count down, or
be combined to count up
and down.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 136
Programming Counters
• PLC counter
The up-counter is
instructions are similar
incremented by 1 each
to timers except that time the rung containing
they do not operate on the counter is energized.
an internal clock but
are dependent on
external or program
sources for counting The down-counter
• PLC counters can be decrements by 1 each
time the rung
programmed to count containing the counter
up to a preset value or is energized.
to count down to a
preset value.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 137
Programming Counters
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 140
Programming Counters
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 141
Programming Counters
Up/down counter program counting diagram.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 142
Programming Counters
Example: Parking Garage
One application for an up/down-counter is to keep count of the cars
that enter and leave a parking garage. The operation of a program
can be summarized as follows:
• A car enters, the enter switch triggers the up-counter output
instruction and increments the accumulated count by 1.
• As a car leaves, the exit switch triggers the down-counter
output instruction and decrements the accumulated count by 1.
• Whenever the accumulated value of 150 equals the preset
value of 150, a lot full light is activated.
• A reset button has been provided to reset the accumulated
count.
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 143
Programming Counters
S7-Program
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 144
Summary PLC
• Fundamentals of Logic
• Memory
• Improvement of logic expression using KV-
diagram
• PLC Programming: Relay diagram Ladder
Diagram Functional Block Diagram
• Programming Timers
• Programming Counters
Controls
22.10.2021 Prof. Dr.-Ing. Dirk Nissing 149