2. According to National Electrical Manufacturers’ Association
a PLC is:
A digital electronic device using a programmable memory
to store instructions and to implement specific functions
such as logic, sequence, counting, timing and arithmetic to
control machines and processes through digital or analog
input/output modules.
Definition
2
3. What is a PLC?
A special computer for logic controls
3
4. Difference between Micro and
PLC
Similar to a
Microcontroller:
• Microprocessor Based
• Onboard Memory for
Storing Programs
• Input/Output Ports
Dissimilar to
Microcontrollers:
• Intended for Industrial
Applications
• I/O Designed to interface
with Control Relays
• Special Programming
Language: ladder Logic
diagram
4
5. PLC History
In the late 1960's PLCs were first introduced by
Bedford Associates (Bedford, MA) proposed something called
a Modular Digital Controller (MODICON) to a major US car
manufacturer
In the mid70's the dominant PLC technologies were sequencer state-
machines and based CPU.
Communications abilities began to appear in approximately 1973.
The first such system was Modicon's Modbus.
From this date the PLC could talk to other PLCs and they could be
far away from the actual machine they were controlling
5
6. PLC’s Now
Widely Applied in Every Industry
Were Developed to Simplify the Implementation of Control
Automation Systems in Plants and Assembly Lines
Designed to Minimize the Number of Control Relays in a Process
and Maximize the Ways Relays can be Used
Flexible, Reliable and Low Cost
PLC’s are industrially hardened devices capable of operating in
extreme environments
• Wide Temp extremes 0-60º C
• High humidity
• High Vibration
• “High “Noise” (electrical) environments 6
7. Basic PLC Operation
Pushbuttons (sensors), in this
simple example, connected to
PLC inputs, can be used to start
and stop a motor connected to
a PLC through a motor starter
(actuator).
PLCs consist of input modules, a
Central Processing Unit (CPU),
and output modules.
7
8. PLC ARCHITECTURE
Programmable controllers replace most of the relay panel wiring by
software programming.
It is consists of the
following modules:
1. Power supply module
2. CPU module
3. Digital input module
4. Digital output module
5. Analog input module
6. Analog output
8
9. PLC COMPONENTS
1. Processor Microprocessor based, may allow
arithmetic operations, logic operators,
block memory, computer interface,
functions, etc.
2. Memory Measured in words.
ROM (Read Only Memory),
RAM (Random Access Memory),
PROM (Programmable Read Only Memory),
EEPROM (Electric Erasable Programmable
ROM),
EPROM (Erasable Programmable Read Only
Memory),
9
10. PLC COMPONENTS
3. I/O AC voltage input and output,
DC voltage input and output,
Low level analog input,
High level analog input and output,
Special purpose modules, e.g., high speed timers,
Stepping motor controllers, etc. PID, Motion
4. Power supply AC power
5. Peripheral hand-held programmer (HHP)
printer
simulator
EPROM loader
graphics processor
network communication interface
modular PC 10
11. RELAYS
A switch whose operation is activated by an electromagnet is called
a "relay" . Coil circuit controls many contact points
contact
coil
input
Relay coil
R1
R1Output contact normally
open
R1Output contact normally
closed
11
13. Logical Control with Relays
115VAC
wall plug
relay logic
input A
(normally closed)
input B
(normally open)
output C
(normally open)
ladder logic
A B C
13How Relays can be used as a controller element
16. Discrete Output
Alarms,
Control relays,
Fans, Lights, Horns,
Valves,
motor starters, and
Solenoids
Analog I/O
Analog inputs:
-Flow sensor, Humidity sensors,
Pressure sensors, Temperature sensors,
Potentiometers, load cell transducers
Analog outputs:
Analog valves
Actuators DC and AC motor drives
16
17. Some Special I/O
Thermocouple input
Low level analog signal, filtered, amplified, and digitized
before sending to the processor through I/O bus.
Fast input
50 to 100 microsecond pulse signal detection.
ASCII I/O
Communicates with ASCII devices.
Stepper motor output
Provide directly control of a stepper motor.
Servo interface
Control DC servo motor.
PID control
The Proportional Integral Derivative is used for closed
loop process control.
17
19. An Large Size
PLC The main module measures
19” x 20” x 14.5”.
have up to 10,000 I/O
points
supports all functions
expansion slots to
accommodate PC and other
communication devices.
Allen-Bradley PLC-3
19
Types of PLC
20. A Small Size
PLC
Measures 4.72”x 3.15” x
1.57”.
32 I/O points
Standard RS 232 serial
communication port
Allen-Bradley MicroLogix 1000
20
21. PLC’s Use Ladder Logic
Ladder Logic Diagrams Provide a Method to
Symbolically Show How Relay Control Schemes are
Implemented
Relay Contacts and Coils, Inputs and Outputs lie on
“Rungs” Between the Positive and Ground Rails
21
22. LADDER DIAGRAM
A ladder diagram (also called contact symbology) is a
means of graphically representing the logic required in a
relay logic system.
A
R1
PB1 PB2
R1
R1
start emergency stop
Rail
Rung
22
23. LADDER DIAGRAM
The left vertical line of a ladder
logic diagram represents the
power or energized conductor.
The output element or
instruction represents the
neutral or return path of the
circuit.
The right vertical line, which
represents the return path on a
hard-wired control line
diagram, is omitted.
Ladder logic diagrams are
read from left-to-right, top-to-
bottom.
Rungs are sometimes referred
to as networks. A network may
have several control elements,
but only one output coil.
23
24. Reading Ladder Logic
HOT NEUTRAL
INPUTS OUTPUTS
A B X
C D
E F
G
H
Y
Note: Power needs to flow through some combination of the inputs
(A,B,C,D,E,F,G,H) to turn on outputs (X,Y).
24
26. Statement List Language
A statement list (STL) provides another view of a set of instructions. The
operation, what is to be done, is shown on the left. The operand, the
item to be operated on by the operation, is shown on the right. The set
of instructions in this statement list perform the same task as the ladder
diagram.
A And
O Or
N Not
Mul Mutiply
XO Xor
= assign
Add Addition
Sub Subtract
26
28. Function Block Diagrams
Function Block Diagrams (FBD) provide another view of a set
of instructions. Each function has a name to designate its
specific task. Functions are indicated by a rectangle. Inputs
are shown on the left-hand side of the rectangle and outputs
are shown on the right-hand side.
28
31. The PLC program is executed as part of a repetitive process referred
to as a scan. A PLC scan starts with the CPU reading the status of
inputs. The application program is executed using the status of the
inputs. Once the program is completed, the CPU performs internal
diagnostics and communication tasks.
The scan cycle ends by updating the outputs, then starts over. The
cycle time depends on the size of the program, the number of I/Os,
and the amount of communication required.
PLC Scan
31
33. Software
Software is any information in a form that a
computer or PLC can use. Software includes the
instructions or programs that direct hardware.
Hardware
Hardware is the actual equipment. The PLC, the programming device,
and the connecting cable are examples of hardware.
33
35. Basic Requirements
In order to create or change a program, the following items are
needed:
• PLC
• Programming Device
• Programming Software
• Connector Cable
35
37. Programming Devices
The program is created in a programming device (PG) and then
transferred to the PLC. The program for the S7-200 can be
created using a dedicated Siemens SIMATIC S7 programming
device, such as a PG 720 (not shown) or PG 740, if STEP 7
Micro/WIN software is installed.
37
38. A personal computer (PC), with STEP 7 Micro/WIN installed,
can also be used as a programming device with the S7-200.
38
39. Software
A software program is required in order to tell the PLC what instructions it
must follow. Programming software is typically PLC specific. A software
package for one PLC, or one family of PLCs, such as the S7 family, would
not be useful on other PLCs. The S7-200 uses a Windows based software
program called STEP 7-Micro/WIN32. The PG 720 and PG 740 have STEP
7 software pre-installed. Micro/WIN32 is installed on a personal computer
in a similar manner to any other computer software.
39
40. S7-200 Micro PLCs
The S7-200 Micro PLC is the smallest member of the SIMATIC S7 family
of programmable controllers.
The central processing unit (CPU) is internal to the PLC. Inputs and
outputs (I/O) are the system control points. Inputs monitor field devices,
such as switches and sensors. Outputs control other devices, such as
motors and pumps. The programming port is the connection to the
programming device.
40
41. Mode Switch and
Analog Adjustment
When the mode switch is in the RUN position the CPU is in the run
mode and executing the program. When the mode switch is in the STOP
position the CPU is stopped.
The analog adjustment is used to increase or decrease values stored in
special memory. These values can be used to update the value of a timer
or counter, or can be used to set limits.
41
42. Optional Cartridge
The S7-200 supports an optional memory cartridge that provides a
portable EEPROM storage for your program. The cartridge can be
used to copy a program from one S7-200 PLC to a like S7-200 PLC.
42
43. Expansion Modules
The S7-200 PLCs are expandable. Expansion modules contain additional
inputs and outputs. These are connected to the base unit using a ribbon
connector.
The ribbon connector is protected by a cover on the base unit. Side-
by-side mounting completely encloses and protects the ribbon
connector.
43
44. The ribbon connector is protected by a cover on the base unit. Side-
by-side mounting completely encloses and protects the ribbon
connector.
44
45. External Power Supply
An S7-200 AC/DC/Relay would be connected to a 120 or
230 VAC power supply.
45
46. I/O Numbering
S7-200 inputs and outputs are labeled at the wiring terminations and
next to the status indicators. These alphanumeric symbols identify
the I/O address to which a device is connected. This address is used
by the CPU to determine which input is present and which output
needs to be turned on or off. I designates a discrete input and Q
designates a discrete output. The first number identifies the byte,
the second number identifies the bit. Input I0.0, for example, is byte
0, bit 0.
46
47. Inputs Outputs
Freeport Mode
The programming port has a mode
called freeport mode.
Freeport mode allows connectivity to
various intelligent sensing devices
such as a bar code reader.
47
48. Printer
Freeport mode can also be used to
connect to a non-SIMATIC printer.
Interconnection
It is possible to use one
programming device to address
multiple S7-200 devices on the
same communication cable. A total
of 31 units can be interconnected
without a repeater.
48
49. Symbols that is used in ladder diagram
Contacts
Coils
Boxes
Coils represent relays that are energized when power flows to them.
When a coil is energized, it causes a corresponding output to turn on
by changing the state of the status bit controlling that output to 1.
That same output status bit may be used to control normally open and
normally closed contacts elsewhere in the program.
Boxes represent various instructions or functions that are executed when
power flows to the box. Typical box functions are timers, counters, and
math operations.
49
51. PLC HARD WIRING DIAGRAM
External
switches
Stored program
01 02 20
20
20 11
01
02
03
11
12
C
PLCInput Output
A
B
External switches with stored program ladder diagram and output
devices can be presented using The shown PLC hard wired diagrams
51
53. Inputs
In smaller PLCs the inputs are normally built in and are specified
when purchasing the PLC. For larger PLCs the inputs are
purchased as modules, or cards, with 8 or 16 inputs on each
card
The following list below shows typical ranges for input voltages,
and is roughly in order of popularity.
12-24 Vdc
100-120 Vac
10-60 Vdc
5 Vdc (TTL)
200-240 Vac
48 Vdc
24 Vac
PLc input cards rarely supply power, which means that an
external power supply is needed to supply power for the inputs
and sensors
53
54. Example on an AC input card
and Ladder Logic
In the example there are
two inputs, one is a
normally open push
button, and the second is a
temperature switch, or
thermal relay.
Both of the switches are
powered by the hot output
of the 24Vac power supply
- this is like the positive
terminal on a DC supply
54
indicates
that the
card is an
Input card
in rack 01
in slot 3
Allen Bradley notation for PLC-5 racks
the Input
number
55. Outputs
As with input modules, output modules rarely supply any
power, but instead act as switches. External power supplies
are connected to the output card and the card will switch
the power on or off for each output. Typical output voltages
are listed below, and roughly ordered by popularity.
120 Vac
24 Vdc
12-48 Vac
12-48 Vdc
5Vdc (TTL)
230 Vac
These cards typically have 8 to 16 outputs of the same type
and can be purchased with different current ratings.
A common choice when purchasing output cards is relays,
transistors 55
56. Example on an 24Vdc output
card (transistors)
This Card would
typically use transistor
This card could have
many different voltages
applied from different
sources, but all the
power supplies would
need a single shared
common.
When the output 07 is on,
current can flow in 07 to the
COM, thus completing the
circuit, and allowing the
light to turn on If the output
is off the current cannot
flow
56
Indicates that the
card is an output
card, in rack 01, in
slot 2 of the rack
57. Example another type of 24Vdc Output Card
With a Voltage Input
In this example the
positive terminal of
the 24Vdc supply is
connected to the
output card directly.
When an output is
on power will be
supplied to that
output
57
58. Output Card Example (Relays)
58
120 V AC/DC
Output Card
in rack 01
I/O group 2
00
01
02
03
04
05
06
07 24 V lamp
Relay
24 V DC
Power
120 V AC
Power
Motor Supply
Supply
59. Ladder wiring Diagram
Problem: You are planning a project that will be controlled by a PLC.
Before ordering parts you decide to plan the basic wiring and select
appropriate input and output cards. The devices that we will use for inputs
are 2 contact switches or a push button or a thermal switch. The output
will be light bulb or motor
59
• The switch before line 010
is a master disconnect for
the power to the entire
system
• A fuse is used after the
disconnect to limit the
maximum current drawn by
the system
• Line 020 of the diagram is
used to control power to
the outputs of the system
• CR1, which is a master
control relay
• The relay on line 080
switches a relay that turn
on another device drill
station
• Red
indicator
light (040)
• Green
indicator
light (050)
• Solenoid
(060)
60. Typical I/O connections with
PLC:
The shown
diagram is
a typical
PLC with
input and
output
module to
control
pneumatic
actuator
60
61. Advantages of PLCs:
Increase flexibility,
Faster implementation of changes and
correction,
Lower cost,
Increased visual observations,
Increased operation speed,
Increased reliability and maintainability,
Increased security,
Reprogramming capability,
Elimination of wiring.
61
62. Summary
This Lecture covered the following topics
1-PLC’S definition
2-PLC’s Components
3-PLC’S advantages
62
64. PLC Programming
Ladder Diagram - most common
Statement List (SL)
Functional Block Programming (FB)
64
65. PLC Ladder Diagram, statement list (SL)
and Function block
1) Timer and counter,
2) Program control,
3) Arithmetic,
4) Data transfer, and
5) Others, such as sequencers.
65
66. Siemens or Max
With siemens SIMATIC s7 or max PLC, the inputs and outputs are arranged in groups of
8. Each 8 group is termed a byte and each input or output with an 8 is termed bit.
The inputs and outputs thus have their addresses in terms of the byte and bit
numbers, effectively giving a module number followed by the terminal number, a full
stop (.) separating the two number s
XXX.X
ALLEN-BRADLE
Example I:012/03
Typical VENDORS Input/Output addresses
I= input
Q=output
Byte
number
Bite
number
I=input
O=output
Rack
number
Module
number
Terminal
number
Example:
I0.1 is an input at bit 1 in byte 0
Q2.0 is an output at bit 0 in byte 2
X:XXX/XX
66
72. A A+ A= A A A=
Idempotent
A B+ C+ A B C+ += A B C A B C =
Associative
A B+ B A+= A B B A=
Commutative
A B C + A B+ A C+ = A B C+ A B A C +=
Distributive
A 0+ A= A 1+ 1=
Identity
A 0 0= A 1 A=
A A+ 1= A A=
Complement
A A 0= 1 0=
A B+ A B= A B A B+=
DeMorgan’s
72
74. LOGIC DESIGN
Process Description:
Control Description:
Define Inputs and Outputs:
A heating oven with two bays can heat one ingot in each bay. When
the heater is on it provides enough heat for two ingots. But, if only
one ingot is present the oven may become too hot, so a fan is used
to cool the oven when it passes a set temperature.
If the temperature is too high and there is an ingot in only one bay
then turn on fan.
74
80. DESIGN CASES
Problem: Develop a program that will cause output D to go true when
switch A and switch B are closed or when switch C is closed.
Problem: Develop a program that will cause output D to be on when push
button A is on, or either B or C are on.
80
81. Car Safety System
Problem: Develop Ladder Logic for a car door/seat belt safety system.
When the car door is open, and the seatbelt is not done up, the ignition
power must not be applied. If all is safe then the key will start the
engine.
81
82. Motor Forward/Reverse
Problem: Design a motor controller that has a forward and a reverse
button. The motor forward and reverse outputs will only be on when one
of the buttons is pushed.
82
83. A Burglar Alarm
Consider the design of a burglar alarm for a house. When activated an
alarm and lights will be activated to encourage the unwanted guest to
leave. This alarm be activated if an unauthorized intruder is detected by
window sensor and a motion detector. The window sensor is effectively a
loop of wire that is a piece of thin metal foil that encircles the window. If
the window is broken, the foil breaks breaking the conductor. This ehaves
like a normally closed switch. The motion sensor is designed so that when
a person is detected the output will go on. As with any alarm an
activate/deactivate switch is also needed. The basic operation of the alarm
system, and the inputs and outputs of the controller are itemized
83
86. EXAMPLE:
A robot is to be used to unload finished parts from a machine
onto an Automated Guided Vehicle (AGV) and to load raw parts
from AGV to the machine. Assume that there are sensors at
the AGV's docking station to indicate the arrival of a vehicle
and onboard sensors indicating whether the vehicle has
brought a raw part to be processed as well as whether the AGV
has space to carry away a finished part. Also assume there are
sensors on the machine to indicate whether the machine is
loaded with a part and also to signal completion of part
processing.
Solution:
The robot is required
to unload a processed part from the machine onto the AGV,
pick up a new part for processing from the AGV, and
load it onto the machine.
86
87. The following I/O
assignments will used:
(I/O)
Meaning/Associated
Action
01 AGV has arrived
02 AGV is carrying a
new part to be processed
03 AGV has space to
store a processed part
04 Machine has a
finished part to be
unloaded
20 Unload old part from
machine onto the AGV
21 Pick new part from
the AGV and load onto
the machine
1-Unload old part
2-Pick new part from AGV
87
88. LATCHES
A latch is like a sticky switch - when pushed it will turn on, but stick in
place, it must be pulled to release it and turn it off. A latch in ladder logic
uses one instruction to latch, and a second instruction to unlatch
88
89. Latch Example
A more
elaborate
example of
latches is shown
in Figure
A normal output
should only
appear once in
ladder logic, but
latch and
unlatch
instructions may
appear multiple
times.
89