Professional Documents
Culture Documents
Handout PLCTraining
Handout PLCTraining
Faculty of Technology
MODULE ONE
Introduction to PLC & Programming PLC using Ladder Logic
Diagram
Version I
May 2009
Contents
1 Introduction to Automation
2 Electromagnetic Relay and Automation
Introduction
Basic Design and Operation of Electromagnetic Relays
Simple Electric motor Control Using Relay
Simple Conveyor Control
Sequential Control
Automated mixing system
Relay Circuit Representation using Ladder Diagram
The Boolean Logic Functions
Exercises
3 Introduction to Programmable Logic Control
Introduction
Main PLC Parts
Software Development Tools
Input and Output modules
Current sourcing and current sinking modules
PLC Capabilities and Specification
Ladder Diagram Programming of Siemens S7-200 PLC series
Exercises
Projects
4 Introduction to sensors and actuators
Common sensors and actuators
Preface
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 2
There has been a repeated request from our industries through our friends, previous students, and managers
for PLC training. However; due to the teaching load of regular Engineering programs at the department we
couldn’t sit down and prepare a systematically designed training for the industry need. This, module one,
training is the first attempt to support our industry in this regard. Subsequent modules will be designed to
comprehend different aspects of PLC for its effective and efficient utilization in our industries,
programming and even designing PLC based automation systems for specific needs locally.
This training material is prepared as a guide for trainees and trainers of Module 1 training on PLC. The
material can be more valuable coupled with the training than when used for independent reading.
Educational background to get the best out of this training and the material
Graduates of electrical engineering, and mechanical engineering and related degree programs
from Ethiopian universities
Diploma in Electrical and Electronic programs with some years of experience
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 3
Module One: Introduction to PLC and Ladder Logic programming 40 hours
Approximate time distribution
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 4
Chapter One
Introduction to Manufacturing Automation
Chapter Objectives
To understand why automation and PLC is required
To understand types of manufacturing automation
After studying this chapter the student can
Explain why automation is required in manufacturing industries
Explain the difference between programmable automation, flexible automation and fixed
automation
Today, automation refers to the technology concerned with the application of mechanical, electrical and
computer systems to operate and control manufacturing processes. Automation tries to simulate human
being as shown in table below.
Human beings use their sense organs like eyes, skins, ears, and tongues to sense and know what is going on
in their environment or on a particular work. Any change is sensed and transmitted to our minds through
nerves for decision. The decision can be executed using our muscles, machines, tools, etc. Automation has
parts which are parallel to the human way of doing things with too far limitations in decision giving ability.
Sensors are used to collect information on conditions in the field, microprocessors and relays can be used
for decision giving while actuators like electric motor and solenoids can be used for action.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 5
To relieve humans from working in dangerous work environments like in chemicals, nuclear, etc
To produce to standard uniform and quality products
For increased productivity, etc.
In manufacturing industry, the process adds value to the raw material, and transforms it into a more
desirable state. The commercial viability of a company depends on the production of finished goods, and
the systems used to produce them. Especially today, manufacturing industry has the following aspects:
Shorter product life cycles,
Increased emphasis on quality and reliability,
More customized products,
New materials,
Increasing use of electronics,
Pressure to reduce inventory
These aspects require frequent rearrangement of production lines and flexible automation. What is flexible
automation?
Fixed automation: Employed for products with a very high production rate, the high initial cost of fixed
automated plant can therefore be spread over a very large number of units. The automation cannot be
changed easily in short time and may not even be able to be used again. Examples are the traditional hard
wired relays.
Programmable automation: can be considered to exist where the production equipment is designed to
allow a range of similar products to be produced. The programs can be changed for a particular product.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 6
Computer Integrated Manufacturing (CIM): In the CIM concept, the information processing aspects of
manufacturing management, the manufacturing elements of the factory are integrated ensuring utilization
of energy and raw materials to produce the end product. CIM can include Computer Aided Design and
Computer Aided Manufacturing.
Numerical Control, NC, and Computer Numerical Control, CNC, systems: Both NC and CNC operate
from a stored programme, originally on punched tape or computer Medias such as magnetic tapes and
discs. The stored programme in a NC machine is directly read and used to control the machine, the logic
within the controller being dedicated to the required task. In CNC machine tool a dedicated computer is
incorporated to execute the programme. The additional power of the computer gives a considerable number
of other features including data collection and communication to other machine tools or computers over a
computer network. Apart from changing the operating programme of a CNC system, the executive software
of the computer can be changed, allowing the performance of the system to be modified at minimum cost.
As already said, automation is generally to replace human operators. Operators use their eyes, hand, etc to
monitor (know) the status of the variable they control, use their minds to make decision and use their
muscles and/machines to adjust the variable.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 7
Chapter Two
Electromagnetic Relay and Automation
Chapter Objectives
To learn and understand
Relay and its operating principles
Elementary automated systems using relays
Ladder diagram of relay control systems
Logical functions manipulation by relays
After studying this chapter the student can
Explain the operating principle, parts and design of electromagnetic relays
Design elementary rely based automation
Read and draw relay ladder diagrams
Interpret logical functions of ladder diagrams
2.1 Introduction
Electromagnetic relays are the most widely used for simple sequential control systems. Before 1970s
electromagnetic relays have dominated the manufacturing industry automation. They can be considered as
the seeds of programmable logic controllers. Programmable logic controller programs can be written using
the ladder diagram which is the language of engineers and electricians in relay control systems. Therefore;
someone who can read and interpret relay ladder diagrams can read and understand PLC ladder diagrams
and can learn programming PLC relatively easily. For this reason relay control system and ladder diagram
expression are studied in this chapter.
The basic parts of a relay are the coil, armature, contacts and the frame as shown in Fig. 1.1. In Fig. 1.1, if
current is applied to the coil the armature is attracted up to minimize the air-gap between the core and
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 8
armature. Contacts 1 and 2 are closed while contacts 3 and 4 are opened. Contacts 1 and 2 are called
normally open while contactors 3 and 4 are normally closed contacts.
Normally open contact refers to contacts which are open when the relay coil is de-energized and closed
when the coil is energized. Normally open contact is also called a form A contact or "make" contact. On the
other hand, contacts which are closed with the coil de-energized and opened with the coil energized are
known as normally closed. Normally closed contact is also called a form B contact or "break" contact.
Contacts can also be change over type. Change-over (CO), or double-throw (DT), contacts control two
circuits: one normally-open contact and one normally-closed contact with a common terminal. It is also
called a form C contact or "transfer" contact ("break before make"). If this type of contact utilizes ”make
before break" functionality, then it is called a form D contact.
Because a relay is able to control an output circuit of higher power than the input circuit, in a broad sense it
can be considered as a form of an electrical amplifier.
Electromagnetic relay was invented by Joseph Henry in 1835. Note that there are solid-state, pneumatic,
and hydraulic relays other than electromagnetic.
To use the generic term “relay coil,” need further classification into, contactor, and relay. A magnetic
motor starter is a relay with a coil and contacts as well as running overload protection by means of thermal
overload relays. Bi-metallic thermal overload relays are units made of a heater coil that heats a coil of wire
to a specified temperature based on overload current, and a bi-metal unit that expands/contracts and
operates a contact. Solder pot thermal overload relays use a similar heater coil and a eutectic solder that
melts under overload conditions and correspondingly turns a ratchet wheel to operate a contact. The contact
arrangement on the thermal overload relay is normally closed. However, it will open under excessive
current conditions and de-energize the coil of the magnetic motor starter and consequently disconnect the
motor. Contactors are also relays that switch high load currents but do not provide running overload
protection via the thermal overload relay.
There are also timing relays. Common types of timing relays are ON-delay (delay on operate), OFF-delay
(delay on release), interval delay, and repeat cycle delay. Time delay relays are used for timing in a control
circuit.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 10
Fig. 2.2 Electric motor control using relay
Consider the electric motor control shown in Fig. 2.2. Initially the relays are de-energized and the red
signal lamp is ON. To start the motor for operation;
Push the start button
Relay R1 coil is energized and its normally open closed contacts close energizing relay 2. Switches
off the red lamp and switch ON the green signal lamp.
When the Start button is released the interlock keeps the coil of R1 energized.
If stop button is pushed the coil of R1 is de-energized. Coil of starter relay, R2 is also de-energized
stopping the motor.
In this simple arrangement the relay controls the motor driving some load supported by operator. It can be
modified for automation using some feed back signal from the load variables like water levels in a tank to
be filled by the motor driven pumps. In such simple systems the traditional relays are used extensively.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 11
Fig. 2.3 A Simple relay control system for conveyer
2.5Sequential Control
The most common control type implemented by relays is sequential control. Fig. 2.4 demonstrates a typical
sequential controller. Simultaneous starting of the two or more of the conveyers drive motors may not be
allowed due to power supply limitation. Hence; they are usually required to start sequentially. The control
system in Fig. 2.4 starts the motors sequentially. The following is sequence of operation for sequential
starting of the three motors.
Sequence of events to sequentially start the conveyor
1. Start conveyer 1.
2. Check sensor 1. Is conveyer 1 running?
3. If yes, start conveyor 2.
4. Check sensor 2. Is conveyer 2 running?
5. If yes, start conveyer 3.
6. Check conveyer 3. Is conveyer 3 running?
7. If yes, continue other processes…
8. . . .
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 12
Fig. 2.4 A typical Sequential controller
2.6 Automated mixing system with sequential control
The following symbols are used in relay ladder logic diagrams corresponding to the main electrical circuit
parts of the relay, actuators and the sensors.
Indicator Lamp
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 14
Normally Open Normally closed limit
limit switch switch
Horn Bell
The vertical lines representing the power supplies are called bus rails while the horizontal part
incorporating relay symbols are called rungs.
For relay current can flow from the left rail to the right rail if the contacts in the rungs are closed otherwise
the current cannot flow.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 15
Fig. 2.6 Ladder diagram of the system shown in Fig. 2.3
In the ladder diagram of Fig. 2.6 above, the following sequential events are depicted.
To switch ON the motor:
Push button is pushed
Current flows through relay R energizing it.
Normally open contacts of relay R closes while normally closed contacts open.
o The pushbutton is shunted by one of the normally open contacts of the relay R. This is
called interlocking or latching. The relay R remains energized even if the pushbutton is
released.
o Normally closed contact of relay R in power supply to the green signal lamp opens
switching off the lamp.
o Normally open contact of relay R in power supply to the red lamp closed and red lamp
lights.
o The normally open contact of relay R in the motor power supply circuit closes and the motor
starts to run.
2.8 The Boolean Logic Functions
The following Boolean logic functions can be manipulated by relays. These functions are basics in control
using relays and programmable logic controllers (PLC).
2.8.1 The OR function
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 16
Truth table of OR function
A B
0 0 0
0 1 1
1 0 1
1 1 1
0 0 0
0 1 0
1 0 0
1 1 1
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 17
Fig. 2.11 NOR function electric circuit
0 0 1
0 1 0
1 0 0
1 1 0
0 0 1
0 1 1
1 0 1
1 1 0
0 0 0
0 1 1
1 0 1
1 1 0
Lamp 2 operates exactly as it should, but lamp 1 never turns on. Identify all possible failures in the
circuit that could cause this problem, and then explain how you would troubleshoot the problem as
efficiently as possible (taking the least amount of electrical measurements to identify the specific
problem).
3. A very common application of electromechanical relay logic is motor control circuitry. Here is a ladder
diagram for a simple DC motor control, where a momentary pushbutton switch starts the motor, and
another pushbutton switch stops the motor: The wiring sequence shown here is not the only valid
solution to this problem!
Translate this ladder diagram into point-to-point connections between the following components (shown in the following
illustration):
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 20
Fig. Q3. Schematic diagram relay terminals
4. Refer to Fig. Q4 and identify each of these relay logic functions by name (AND, OR, NOR, etc.) and
complete their respective truth tables:
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 21
5. Predict how the operation of this relay logic circuit will be affected as a result of the following faults.
Consider each fault independently (i.e. one at a time, no multiple faults):
• Pushbutton switch A fails open:
• Relay coil CR2 fails open:
• Relay contact CR1-1 fails open:
• Relay contact CR2-1 fails shorted:
• Relay contact CR2-2 fails shorted:
For each of these conditions, explain why the resulting effects will occur.
Pushbutton switch A fails open: Lamp 1 always energized, lamp 2 simply becomes inverse status of
pushbutton switch B.
Relay coil CR2 fails open: Both lamp 1 and lamp 2 simply become inverse status of pushbutton
switch A.
Relay contact CR1-1 fails open: Lamp 1 simply becomes same status as pushbutton switch B.
Relay contact CR2-1 fails shorted: Lamp 1 always energized.
Relay contact CR2-2 fails shorted: Lamp 2 simply becomes inverse status of pushbutton switch A.
6. Though many electronics students and professionals alike associate semiconductor components with the
word "digital," electromechanical relays are also digital logic (on or off) devices. In fact, some of the
first digital computers were built with electromechanical relays as their active elements.
In what ways are electromechanical relays similar to semiconductor logic gates? In what ways do the
two digital technologies differ?
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 22
7. The following schematic is of a relay circuit that emulates a standard digital logic gate function:
Write a truth table for this circuit's function, and determine what name best represents it (AND, OR,
NAND, NOR, or NOT).
8. The following schematic is of a relay circuit that emulates a standard digital logic gate function:
9. A type of electrical diagram convention optimal for representing electromechanical relay circuits is the
ladder logic diagram. An example of a "ladder logic" diagram is shown here: Each parallel circuit
branch is represented as its own horizontal "rung" between the two vertical "rails" of the ladder. As you
may have noticed, some of the symbols resemble standard electrical/electronic schematic symbols
(toggle switches, for instance), while others are unique to ladder logic diagrams (heater elements,
solenoid coils, lamps).
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 23
Fig. Q7 A ladder diagram of a control system
Where do the circuits shown obtain their electrical power? What do "L1" and "L2" represent? How are
relay coils and contacts represented in a ladder logic diagram? Answer each of these questions by
expanding upon the diagram shown above: draw the components necessary to show a complete electrical
circuit (i.e. details of the power source), as well as an additional rung (or two) showing a relay coil actuated
by some sort of switch contact, and the relay contact controlling power to a second indicator lamp.
10. Complete the following ladder logic diagram, Fig. Q9, so that an OR gate function is formed: the
indicator lamp energizes if either switch A or switch B is actuated.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 24
Fig. Q10 A ladder circuit for analysis
12. The following ladder logic diagram in Fig. Q11 (for a steam heater control) contains a serious mistake:
Explain what the mistake is, and draw a corrected version of this relay circuit.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 25
Fig. Q12 Ladder circuit for question No. 14
15. Suppose you come across a relay that is said to have "Form C" contacts. What does this phrase mean?
And, is there such a thing as either "Form A" or "Form B" contacts?
16. Safety is a paramount concern in electrical systems. Generally, we try to design electrical circuits so
that if and when they fail, they will do so in the manner safest to those people working around them,
and to the equipment and process(es) controlled by the circuit. One of the more common failure modes
of circuits having wires strung through metal conduit is the accidental ground, or ground fault, where
the electrical insulation surrounding a wire fails, resulting in contact between that wire and a grounded
metal surface. Suppose an accidental ground were to occur at the point shown in this ladder diagram:
What would be the result of this fault? Hint: you will need to know something about the L1/L2 power
source in order to answer this question!
What would be the result if the L1/L2 power connections were reversed?
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 26
17. Complete the following ladder logic diagram so that an AND gate function is formed: the indicator
lamp energizes if and only if both switch A and switch B are simultaneously actuated.
18. Write a truth table for each of the indicator lamps in the following ladder diagram, and determine which
logic function (AND, OR, NAND, NOR, or NOT) best describes each lamp's behavior with respect to
the status of the input switches.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 28
Fig. Q19 tank level control system
Operation of the system:
1. Circuit breaker ACB and control circuit switch S1 are switched ON to make ready the automation.
2. If the water level reaches the upper limit LS1 is closed energizing relay R1. R1 contact closes and
energises the magnetic contactor MC1. The motor starts and close the valve.
3. When the valve is fully closed LS3 opens and disconnect power from the motor.
4. When the lower limit is reached the level switch closes and rely R2 is energized. Relay R2 closes
and energies the magnetic contactor M2 runs the motor in the reverse direction opening the valve.
5. When the valve is fully opened the limit switch LS4 opens disconnecting the motor from power
supply.
6. The motor thermal relay TR prevents the motor from starting incase of problem.
7. Pushbuttons can be used to open or close the valve manually overriding the automation.
Answers for exercises in chapter 3
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 29
1. In ladder logic diagrams, relay coils are associated with their respective contacts by name rather
than by proximity. In this particular circuit, the logic function represented is the AND function.
2. This is a problem worthy of a good in-class discussion. Of course, several things could be wrong in
this circuit to cause lamp 1 to never energize. Measurements should be taken to isolate the problem,
with actuating either of the pushbutton switches when taking those measurements.
Notes: Electrical troubleshooting is a difficult-to-develop skill, and it takes lots of time for some
people to acquire. Being one of the most valuable skills a technical person can possess, it is well
worth the time invested! The challenge question is very practical.
3. Notes: This circuit provides with an opportunity to analyze a simple latch: a system that
"remembers" prior switch actuations by holding a ßtate" (either set or reset; latched or unlatched). A
simple motor start/stop circuit such as this is about as simple as latch circuits get. Trainee should be
able to immediately comprehend the benefit of using nice, neat, structured ladder diagrams when
they see the tangled mess of wires in a real motor control circuit. And this is not even a complex
motor control circuit! It takes very little imagination to think of something even uglier than this, and
what a task it would be to troubleshoot such a circuit without the benefit of a ladder diagram for
guidance.
4. Notes: In order to familiarize trainees with standard switch contact configurations, practice with
identification and truth tables each day is required. Students need to be able to recognize these
ladder logic sub-circuits at a glance, or else they will have difficulty analyzing more complex relay
circuits that use them.
5. The purpose of this question is to approach the domain of circuit troubleshooting from a perspective
of knowing what the fault is, rather than only knowing what the symptoms are. Although this is not
necessarily a realistic perspective, it helps students build the foundational knowledge necessary to
diagnose a faulted circuit from empirical data. Questions such as this should be followed
(eventually) by other questions asking to identify likely faults based on measurements.
6. Like semiconductor gates, electromechanical relays have but two states: energized and de-energized
(1 and 0). Like gates, the contacts of relays may be interconnected to perform standard logic
functions such as AND, OR, NAND, NOR, and NOT. Notes: This question provides a good
opportunity to review electromechanical relays: how they work, what they are used for, etc.
7. This is an AND function.
8. This is an OR function.
9. L1" and "L2" represent the "hot" and "neutral" lines, respectively, in a 120 volt AC power system.
Often, the control circuit power is obtained from a step-down transformer, which is in turn fed by a
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 30
higher voltage source (usually one phase of a 480 volt AC three-phase system, in American
industrial applications).
If the trainee don't raise this point on their own, direct their attention to the relay coil and contact
symbols. What looks strange here? What sort of electrical component are you familiar associating
with the "CR1" contact symbol? Does it make sense to use this symbol to symbolize a normally-
open switch (relay) contact? If we wished to show a normally-closed relay contact instead, how
would we modify the diagram?
This is just one example of how the ladder logic diagram could be expanded:
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 31
should be followed (eventually) by other questions asking students to identify likely faults based on
measurements.
14. "Stop" pushbutton switch fails open: Motor cannot start, lamp never energizes. Relay contact CR1-1
fails open: Motor starts and lamp energizes when "Start" button is pressed, but both immediately de-
energize when it is released. Relay contact CR1-2 fails open: "Motor run" lamp turns on and off as
expected, but the motor itself never runs. Relay coil CR1 fails open: Motor cannot start, lamp never
energizes. Notes: The purpose of this question is to approach the domain of circuit troubleshooting
from a perspective of knowing what the fault is, rather than only knowing what the symptoms are.
Although this is not necessarily a realistic perspective, it helps students build the foundational
knowledge necessary to diagnose a faulted circuit from empirical data. Questions such as this
should be followed (eventually) by other questions asking students to identify likely faults based on
measurements.
15. "Form C" is just another way of saying "SPDT" with regard to switch or relay contacts.
Different industries often use different terms for describing the same things. Form-C refers to SPST.
16. In a properly designed system, with L2 grounded at the power source, this fault will result in a
blown fuse when the pressure switch closes. In a circuit with L1 and L2 reversed, this same ground
fault would energize the relief solenoid, with or without the pressure switch's "permission."
The ultimate purpose of this question is not to ascertain the effects of a particular fault so much as it
is to derive a general rule regarding the construction of industrial control circuits. Students should
be able to see the benefits of having L2 (the grounded power rail) on the right-hand side of the
circuit, but can they induce the general safety principle to be applied in all control circuits? What is
ßpecial" about having L2 on the right-hand side of the ladder diagram?
17. Discuss the fact that relay coils and contacts need not be located near each other in ladder diagrams.
While this may be confusing at times, it is a very flexible feature of ladder logic notation, because it
gives the author the freedom to locate relay contacts where it makes the most visual sense in the
öutput" rung of the diagram, without having to coordinate locations of coil and contact as is
generally necessary in traditional schematic diagrams. Instead, relay contacts are associated with
their respective coils by label, not by proximity on the diagram.
18. Each of the lamps exhibits the behavior of a "NOR" gate.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 32
This question provides a good opportunity for students to practice analyzing relay logic circuits, and
it also foreshadows DeMorgan's Theorem in its dual implementation of the NOR function. Note to
your students how more than one contact is being used on control relays CR1 and CR2!
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 33
Chapter Three
Introduction to Programmable Logic Control
Chapter Objectives
To learn parts and functions of PLC
To learn the principles of operation of PLC
To learn how to program PLC using ladder diagram
3.1. Introduction
In 1960s, General Motors (GM) in USA is the first to realize the problem with hard wired relay automation
system. When a new model of vehicle is required, a new wiring of the relay automation was required. This
has resulted in product interruption for a long time (during rewiring). Furthermore; the control panels may
even require additional hardware discarding the original ones all in all. This made the response of the
company to new models slow and expensive.
The process of changing automation basically is the change in the logical functions between the input and
the outputs. Combination of hardwired relays performs this logical function in the traditional hardwired
system.
GM requested the automation manufacturers that input output device signals be brought to a panel with
microcontroller and the logical relation between the inputs and the outputs be manipulated by the
microcontroller. That is the logical manipulation is software instead of hardwired relays. This request led
to the invention of PLC. In fact invention of PLC has opened other important possibilities of
communication between control systems and hierarchical automation far more than the specification given
by GM.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 34
PLCs are often defined as miniature industrial computers that contain hardware and software used to
perform control functions. A PLC consists of four modules; refer to Fig. 3.1.
Central processing unit (CPU),
Input module
Output module
Power supply module.
Small PLC is modular including the CPU, inputs and outputs in one module. On the other hand larger PLCs
comprise of different modules listed above. These modules are plugged on standard racks with standard
slots to plug-in. A typical PLC rack starts with power supply and CPU module plugged into a backplane of
the interface bus. A rack may contain different number of slots, like 4, 7, 10 and 15.
The input and output modules are interfaces between the CPU operating at low voltage like 5volt or less
and the field devices operating at higher voltages and currents. Furthermore; it isolates the high voltage or
current from low voltage or current electrically. Most input output modules support every PLC from
different manufacturers. Input output modules can be discrete or analogue modules, counter and timer
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 35
modules, serial communication modules, communication network interface modules (ProfiBus, CAN,…)
and specific control modules.
Particular input output is identified by Rack number – slot number – channel number. For example; a
PLC may have three racks (0, 1, 2) with 4 slots on each rack (0 1, 2, 3) and different channels in each slot.
Let the first slot be eight channels of 16-bit A/D converter (8x16=128 bits) the second slot be eight
channels of 16-bit D/A (8x16=128 bits) and the third slot be 320 discrete I/O channels (320 bits), etc.
Discrete input output modules typically contain 8, 16, 32 channels and can be AC or DC signal types. DC
modules can be rated for 5 V, 12 V, 24 V and AC modules for 120 V or 240 V. Analogue input modules
are commonly 0 to 5 V, 0 to 10 V, -10 to +10 V, 4 to 20 mA, 0 to 10 mA, with 10 bit, 12 bit or 16 bit
resolutions.
The power supply module supplies power to the microprocessor and the input output modules. The power
supply for input output units and devices can be AC and/or DC while the power supply for the
microprocessor and digital circuitry is always DC.
To operate, the CPU “reads” input data from connected field devices through the use of its input interfaces,
and then “executes” or performs the control program that has been stored in its memory system. Programs
are typically created in ladder logic, a language that closely resembles a relay-based wiring schematic, and
are entered into the CPU’s memory prior to operation. Finally, based on the program, the PLC “writes” or
updates output devices via the output interfaces. This process is known as scanning.
Scanning typically continues in the same sequence as programmed without interruption, and changes only
when a change is made to the control program.
Summary of scanning procedure
Reading the inputs
Executing the program
Processing any communication system
Executing CPU self test
Writing to the outputs
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 36
Fig. 3.2 CPU Scanning Procedure
Fig. 3.3 Schematic diagram of connection and block diagram of PLC modules
There are other instruction sets like structured text (ST), Instruction List (IL), Sequential Function Chart
(SFC), etc.
Programs can have three parts
The main
Subroutines
Interrupt routines
Subroutines are to modularize the program for easy understanding and debugging. On the other hand
interrupts are event driven for the attention of the CPU.
The PC based STEP-7 Micro/Win 32 is the development environment for the S7 200 series.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 38
The following circuits demonstrate some circuits in the input and output modules.
(a)
(b)
Fig. 3.4 Opto-isolated input modules (a) AC input module (b) DC input module
(a)
(b)
Fig. 3.5 Opto-isolated output modules
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 39
Fig. 3.6 Input module EM 221 (8x24VDC (2 sets) )
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 40
(c) Current Sinking Output card
Fig. 3.7 Current Source and Current Sink input and Output modules
PLCs can also control continuous processes that use analog I/O. For example, a temperature sensor may
provide a variable signal, such as 0-10 volts, based on the measurement of an actual temperature. The PLC
program monitors the sensed values continuously and operates devices that may also be analog in nature.
This could include setting the position of a valve between 0-100% open, or controlling the speed of a
motor. Continuous applications are so called because they typically have no defined start or end once they
are initiated; they maintain a process in a “steady” operating state. Corresponding input modules are used to
interpret the continuous values to the discrete value the CPU can understand.
Input output modules or field devices can be current sourcing or Current Sinking or combination. For
current sinking input modules current flows from the field sensors to the input module. The sensor is
provided with power supply. In current sourcing output module the current flows from the input module to
the field actuators. The field devises may not have power supply.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 41
Relay used as an interface between the output device and the CPU
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 42
3.6 PLC Capabilities
As PLC technology has advanced, so have programming languages and communications capabilities, along
with many other important features. Today's PLCs offer faster scan times, space efficient highdensity
input/output systems, and special interfaces to allow non-traditional devices to be attached directly to the
PLC. Not only can they communicate with other control systems, they can also perform reporting functions
and diagnose their own failures, as well as the failure of a machine or process.
Size is typically used to categorize today’s PLC, and is often an indication of the features and types of
applications it will accommodate. Small, non-modular PLCs (also known as fixed I/O PLCs) generally
have less memory and accommodate a small number of inputs and outputs in fixed configurations. Modular
PLCs have bases or racks that allow installation of multiple I/O modules, and will accommodate more
complex applications.
For a particular application the followings can be asked.
Program memory required
Number and type of input /output channels
Ddata memory required
Fast scan time required?
Battery backup required?
PID
Floating Point Math
Data memory refers to the amount of memory needed for dynamic data manipulation and storage in the
system. For example, counter and timer instructions typically use data memory to store setpoints, current
values, and other internal flags. If the application requires historical data retention, such as measured device
values over a long period of time, the size of the data tables required may determine the CPU model you
choose. Program memory is the amount of memory needed to store the sequence of PLC program
instructions that have been programmed to perform the application. Each type of instruction requires a
specific amount of program memory, typically defined in a PLC's programming manual.
Applications that are basically sequential in nature can rely on the I/O device rule of thumb to estimate
program memory (five words of memory for each I/O device); complex applications will be more difficult
to judge.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 43
If scan time is important in an application, consider the CPU processor speed as well as instruction
execution speed. Some CPUs are faster at boolean logic but slower with data handling instructions. If
special functions such as PID are required, the CPU you select may make those functions easier to perform.
The followings are some rules for ladder logic diagram construction:
Power flows from the left-hand side bus rail to the right-hand side bus rail only.
Each rung must start with a contact from the left and end with relay or output coil on the right.
Coils must not be connected to the left-hand bus rail.
Contacts can not be connected to the right-hand side bus rail.
Only one coil or relay may be placed on a single rung.
Each relay or coil can only be used once in a program. If two or more has the same assignment
number then an error will occur.
Contacts can be used with the same coding many times. There is no limit other than memory space.
Invalid entries will not be accepted. If you make mistakes the device must be entered again.
The HALT/RUN switch on the PLC must be in the HALT mode to enter new programs or edit
existing programs.
Many pages of program can be written as far as the program is with in the memory limit of the
PLC.
The following examples demonstrate some fundamental differences between relay ladder logic and PLC
ladder diagrams.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 44
Example 1. Fig. a
The ladder diagram, shown in a) is correct as relay ladder diagram. However; for PLC ladder logic diagram
it has to be modified as shown in b) so that current flows from left to right only. In a) current can flow
through x5 up or down. The current flow in relay can take any direction. In PLC ladder logic current is
imagined to flow from left to right only.
(a)
(b)
Not that the Boolean logic of the two diagrams (relay ladder and PLC ladder logic diagram) should be
identical.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 45
a) Relay ladder diagram
b)
Note in both examples that we have included in the PLC ladder logic diagram additional contacts for
the relays. In the Relay ladder diagram the number of contacts are limited to the contacts physically
available on the relays. That is relay has limited number of contacts. There is no limit on number of NC
and NO contacts in PLC program Ladder logics, only memory.
Example 3: Fig. Write the PLC program of the ladder logic diagram in Fig. 3.7
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 46
preparation of Input-output table assignment. The following table is the input-output assignment for the
ladder logic.
Q0.0 CR2
Q0.1 Red light
Q0.1 Green light
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 47
Fig. 3.8 PLC control of Heater and Conveyer System
Exercise: Draw the ladder diagram of a rely control system for the Heater Conveyer System
1. Operation to start when start-button is pressed.
2. The cycle to stop when stop button is pressed.
3. The PLC opens the door of the furnace and waits until the door open switch are ON.
4. Then the motor is started. The motor is stoped when the part presence sensor is ON.
5. The furnace doors are closed.
6. The PLC controls the temperature of the furnace based on the programmed desired temperature
range and temperature feedback. The ON and OFF heater control implements the control.
7. After the temperature is with in the desired temperature range timer is started and the temp control
continues for about 2 minutes.
8. After 2 minutes the heating time expires and heater is turned off.
9. Control goes to step 3 again.
The input and output signals for this system are
Inputs
Start
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 48
Stop
Doors open
450 degree centigrade sensor
500 degree centigrade sensor
Presence sensor
Output
Lift door solenoid
Conveyor motor
Heater
Mechtronics pp 513.
Project
1. Programming exercises problems are separately available.
2. Write a ladder diagram program for the furnace conveyor system control.
3. Write a ladder diagram for the product mixing system
Some famous PLC manufacturers
GE Fanuc
Allen-Bradley
Siemens
Mitsubishi
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 49
Chapter Four
Sensors and Actuators (Field Devices)
4.1 Introduction
The automation system functions properly if and only if the whole components of the automation system;
sensors, actuators, CPU, wiring and input output modules. Hence, knowledge of PLC without knowledge of
sensors and actuators is incomplete.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 51
4. Limit switches are the most versatile devices in terms of motion detection. Available in a variety of
operator mechanisms and contact arrangements, they work on the principle of physical contact
between an object and the operator mechanism to present a contact closure to the control circuit.
5. The most commonly used liquid level sensing device is the float switch, which operates on the
principle of buoyancy. The float is suspended in a liquid bath. As levels of the liquid rise and fall,
the float moves. This movement presents a contact closure to the control circuit.
6. The most commonly used pressure-sensing device is the pressure switch. The diaphragm in a
pressure switch monitors the change in pressure and presents a contact closure to the control circuit.
7. Other types of input devices include the foot switch, the selector switch, or even the contact of a
control relay or a timing relay. These are all mechanical devices that present a contact closure to the
control circuit.
Other input field devices are Input devices contacts can be classified as
Momentary contact and
Maintained contact devices.
Momentary contact devices are spring-loaded and are classified as normally open and normally closed
devices. The designation “normally” refers to the state of the device in its resting position — when no
external stimulus is acting upon it. The contact arrangement of switching devices can also be classified as
SPST, SPDT, DPST, DPDT, 3PDT, etc. The first two letters refer to the number of “poles,” and the last
two letters refer to the number of “throws.” For example, SPST refers to a single-pole, single-throw contact
while 3PDT refers to a 3-pole, double-throw contact. A fractional manual motor starter useful for single-
phase motors (1 hp and lower) can either be an SPST for 120V applications or DPST for 240V
applications. A green start button is an example of a normally open momentary pushbutton, while a red
stop button is an example of a normally closed momentary pushbutton.
Maintained contact devices are not spring-loaded. Instead, they remain in either an ON or OFF state. They
can also be classified as normally open and normally closed. An emergency stop is an example of a
maintained contact device.
4.3 Actuators
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 52
The actuators are field devices driving motion in mechanical system. They are solenoids, electric motors,
valves, hydraulic and pneumatics and others.
Pilot indicating lights are used to provide visual indication of a function or to verify that a certain operation
is either on or off. Audible sounding devices are used to indicate trouble with a process or alert the user to a
particular situation.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 53
5. Laboratory Exercises
The PLC to be used in the laboratory exercise is the s7-200 micro plc system. It consists of:
o S7-200 CPU
o Personal computer (PC)
o Step 7 micro win 32
o Programming interface
o Communication cable
The de Lorenzo DL 2110B2 programmable logic controller, which is part of the system and available in the
lab, combines high performances and ease of use for those who are approaching for the first time the world
of PLCs.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 54
Fig. 5.1 De Lorenzo DL 2110B2 programmable logic controller
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 55
input voltage 15 ... 30 V - -
24 V - DC 5 ... 30V
output voltage
AC 250 V
Status indicators:
Programming
The s7-200 plc as its name indicates uses the s7 software for programming. In s7 ladder programming the
normally open contacts (-[ ]-), the normally closed contact([/]) and the output (( )) are the most frequently
used bit logic symbols.
BINARY LOGIC
Binary logic deals with variables that take on two discrete values and with operations that assume logical
meaning. The two values the variables take may be called by different names (e.g., true and false, yes and
no, high and low, etc.), but for our purpose it is convenient to think in terms of bits and assign the values of
1 and 0. Binary logic used to describe, in a mathematical way, the manipulation and processing of binary
information. It is particularly suited for the analysis and design of digital system.
AND: This operation is represented by a dot or by a dot or by the absence of an operator. For example, x y
= z or xy = z is read as “x AND y is equal to z.” The logical operation AND is interpreted to mean that z =
1 if and only if x = 1 and y = 1; otherwise z = 0 (Remember that x, y and z are binary variables and can be
equal either to 1 or 0, and nothing else.)
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 56
OR: This operation is represented by a plus sign. For example, x + y = z is read “x OR y is equal to z,”
meaning that z = 1 if x = 1 or if y = 1 or if both x = 1 and y = 1. If both x = 0 and y = 0, then z = 0
NOT: this operation is represented by a prime (sometimes by a bar). For example, x’ = z (or x’ = z ) is read
“x not is equal to z,” meaning that z is what x is not. In other words, if x = 1, then z = 0. But if x = 0, then z
= 1.
Binary logic resembles binary arithmetic and the operations AND and OR have some similarities to
multiplication and addition, respectively. In fact, the symbols used for AND and OR are the same as those
used for multiplication and addition. However, binary logic should not be confused with binary arithmetic.
One should realize that an arithmetic variable designates a number that may consist of many digits. A logic
variable is always either variable is always either a 1 or a 0. For example, in binary arithmetic we have 1 +
1 = 1 (read: “one OR one is equal to one”).
For each combination of the values of x and y, there is a value of z specified by the definition of the logical
operation. These definitions may be listed in a compact form using truth tables. A truth table is a table of all
possible combinations of the variables showing the relation between the values that the variables may take
and the result of the operation. For example, the truth tables for the
AND OR NOT
x y x. y x y x+y X x’
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 57
in separate row. The truth tables for AND, OR and Not are listed in table 1. These tables clearly
demonstrate the definition of the operations.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 58
Solenoid Valves - logical outputs that can switch a hydraulic or pneumatic flow.
Lights - logical outputs that can often be powered directly from PLC output boards.
Motor Starters - motors often draw a large amount of current when started, so they require motor starters,
which are basically large relays.
Servo Motors - a continuous output from the PLC can command a variable speed or position.
Outputs from PLCs are often relays, but they can also be solid state electronics such as transistors for DC
outputs or Triacs for AC outputs. Continuous outputs require special output cards with digital to analog
converters.
Inputs come from sensors that translate physical phenomena into electrical signals.
Typical examples of sensors are listed below in relative order of popularity.
Proximity Switches - use inductance, capacitance or light to detect an object logically.
Switches - mechanical mechanisms will open or close electrical contacts for a logical signal.
Potentiometer - measures angular positions continuously, using resistance.
LVDT (linear variable differential transformer) - measures linear displacement continuously using
magnetic coupling.
Inputs for a PLC come in a few basic varieties, the simplest are AC and DC inputs. Sourcing and sinking
inputs are also popular. This output method dictates that a device does not supply any power. Instead, the
device only switches current on or off, like a simple switch.
Sinking - When active the output allows current to flow to a common ground. This is best selected when
different voltages are supplied.
Sourcing - When active, current flows from a supply, through the output device and to ground. This method
is best used when all devices use a single supply voltage.
OPERATION SEQUENCE
All PLCs have four basic stages of operations that are repeated many times per second. Initially when
turned on the first time it will check it’s own hardware and software for faults. If there are no problems it
will copy all the input and copy their values into memory, this is called the input scan. Using only the
memory copy of the inputs the ladder logic program will be solved once, this is called the logic scan. While
solving the ladder logic the output values are only changed in temporary memory. When the ladder scan is
done the outputs will updated using the temporary values in memory, this is called the output scan. The
PLC now restarts the process by starting a self check for faults. This process typically repeats 10 to 100
times per second as is shown in the Figure below, PLC Scan Cycle
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 59
The input and output scans often confuse the beginner, but they are important. The input scan takes a
snapshot of the inputs, and solves the logic. This prevents potential problems that might occur if an input
that is used in multiple places in the ladder logic program changed while half way through a ladder scan.
Thus, changing the behavior of half of the ladder logic program. This problem could have severe effects on
complex programs that are developed later in the book. One side effect of the input scan is that if a change
in input is too short in duration, it might fall between input scans and be missed. When the PLC is initially
turned on the normal outputs will be turned off. This does not affect the values of the inputs.
Self input logic output Self input logic output Self input logic
test scan solve scan test scan solve scan test scan solve
Time
PLC turns on ranges from <1 to 100 ms are possible time
SELF TEST - Checks to see if all cards error free, reset watch-dog timer, etc. (A watchdog timer will cause
an error, and shut down the PLC if not reset within a short period of time - this would indicate that the
ladder logic is not being scanned normally).
INPUT SCAN - Reads input values from the input cards, and copies their values to memory. This makes
the PLC operation faster, and avoids cases where an input changes
from the start to the end of the program (e.g., an emergency stop). There are special PLC functions that
read the inputs directly, and avoid the input tables.
LOGIC SOLVE/SCAN - Based on the input table in memory, the program is executed 1
step at a time, and outputs are updated. This is the focus of the later sections.
OUTPUT SCAN - The output table is copied from memory to the outputs. These then
drive the output devices.
As you can see from the above example, the text based concept is very similar to assembly language
programming .the CPU executes each instruction in the order dictated by the program ,from top to bottom,
and then restarts at the top. another point to consider when using the STL editor is ;while it is possible to
use the STL editor to view or edit a program that was created with SIMATIC LAD or FBD editors ,the
reverse is not always true .
Contacts represent logic input equivalent to switches , buttons , internal conditions and etc.Coils represent
logic output results equivalent to lamps ,motors starters ,interposing relays ,internal output conditions,
etc .Boxes represent additional instructions such as timers, counters ,or math instructions.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 61
Function block editor
Function block diagram (FBD) editor enables you to view the instruction as logic boxes that resemble
common logic gate diagrams. There are no contacts and coils as in the LAD editor, but there are equivalent
instructions that appear as box instructions.
Example:
PLC examples
1. Output Q 3.5 is “1” when all three inputs are “1”. The output is “0” if at least one input is “0”.
2. Output Q 3.2 is “1” when at least one of the inputs is “1”. Output Q 3.2 is “0” when all inputs are “0”
simultaneously.
3. Output Q 3.1 is “1” when at least one AND condition has been satisfied. Output Q 3.1 is “0” when
neither of the two AND conditions has been satisfied.
4. Output Q 2.1 is “1” when one of the following conditions has been satisfied.
-Input I 0.6 is “1”.
-Input I 1.6 and either input I 2.6 or I 3.6 are “1”. Output Q 2.1 is “0” when none of the AND
conditions has been satisfied.
5. Output Q 3.0 is “1” when both OR conditions have been satisfied. Output Q 3.0 is “0” when at least one
OR condition has not been satisfied.
6. Output Q 3.0 is “1” only when input I 1.5 is “1” (normally closed contact activated) and input I 1.6 is “0”
(normally closed contact not activated)
7. Develop a simple ladder logic program that will turn on an output x if inputs A and B, or input c is on.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 62
LATCHES
A push button switch used for starting and stopping electric motors and other powered devices is a
common hardware component in an industrial control system. A start switch is first pressed to give an
output , but after the hand holding it is released or the energization is removed , the output should continue
to run .hence , a memory used to store the energization at the first time is needed. this memory feature is
exhibited by the latches(feedback loop) in the logic network diagram.
Start button stop button output
[ ] [ /] ()
[ ]
output
Example: a drilling machine for the sake of safety requires two hands to be on the table . hand holding the
handle , and the other holding the emergency brake .additionally, the machine have a start button, which
energizes a relay .develop the ladder logic diagram.(hint :the start button energizes a relay which is used to
control the inputs that sense the presence of the two hands)
TIMERS
An on-delay timer will wait for a set time after a line of ladder logic has been true before turning on, but it
will turn off immediately. An off-delay timer will turn on immediately when a line of ladder logic is true,
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 63
but it will delay before turning off. Consider the example of an old car. If you turn the key in the ignition
and the car does not start immediately, that is an on-delay. If you turn the key to stop the engine but the
engine doesn’t stop for a few seconds that is an off delay. An on-delay timer can be used to allow an oven
to reach temperature before starting production. An off delay timer can keep cooling fans on for a set time
after the oven has been turned off.
A retentive timer will sum all of the on time for a timer, even if the timer never finished. A no retentive
timer will start timing the delay from zero each time. Typical applications for retentive timers include
tracking the time before maintenance is needed. A non retentive timer can be used for a start button to give
a short delay before a conveyor begins moving.
Ex: a heater in a factory have a start and a stop button .when the start button is pressed , a horn will be
heard for 10sec before the heater is started .to protect the heater from overheating and damaging itself , a
fan is started at the same time the heater starts working. When the stop button is pressed, the heater stops
automatically but the fan continues to run for 15sec more .develop the ladder diagram.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 64
COUNTERS
There are three basic types of counters in the s-7 programming language .the up counter, the down counter
and the up and down counter. The total numbers of counters available are 256, from C0-C255.
1. Up counter (CTU)
The up counter have got three inputs, the CU, R and PV. The CTU counts up by taking the rising edges of
the CU input .the R ,reset input is used to reset the value stored in the counter . this is needed because the
counter starts counting from zero up to the preset value , but when it reaches its final value it remains there
and to be used again it needs to let go of the previous memory. The PV , preset value is the value up to
which we need the counter to count up to
.
CU CTU
PV
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 65
CD CTD
LD
PV
CU CTUD
CD
PV
EXAMPLES
A motor will be controlled by two switches. The Go switch will start the motor and the Stop switch will
stop it. If the Stop switch was used to stop the motor, the Go switch must be thrown twice to start the
motor. When the motor is active a light should be turned on. Develop a ladder diagram which can perform
the above function.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 66
Exercise
1. Develop a simple ladder logic program that demonstrates a relay which is used to define alternative
decisions in logic control.
2. Try to develop a relay based controller that will allow three switches in a room to control a single
light (Intermediate switch). Write the ladder logic diagram.
3. Develop the ladder logic that will turn on an output light, 15 seconds after switch A has been turned
on.
4. Develop the ladder logic that will turn on a light, after switch A has been closed 10 times. Push
button B will reset the counters.
5. A motor will be controlled by two switches. The Go switch will start the motor and the Stop switch
will stop it. If the Stop switch was used to stop the motor, the Go switch must be thrown twice to
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 67
start the motor. When the motor is active a light should be turned on. The Stop switch will be wired
as normally closed. Write the ladder logic diagram.
6. Write a ladder logic diagram used to remove 5 out of every 10 parts from a conveyor with a
pneumatic cylinder.
REFERENCE
1. Mikell P.Groover .’ Automation ,production systems and computer integrated manufacturing’. 2nd
edition
2. Hugh Jack ‘Automating manufacturing systems with PLCs’
Reference
1. “Programable Logic Controllers The Industrial Computer” by Marco Costanzo, Halesowen
College, UK, 1997
2. “Automation, Production Systems, and Computer Integrated Manufacturing” by Mikell P.
Groover Prentice-Hall of India New Delhi, 2007
3. “Sensors and Signal Conditioning” by Romon Pallas-Areny and John G. Webster, A Wiley-
Interscience Publication John Wiley and Sons Inc, 2001
4. “Fundamentals of Programable Logic Controllers, Sensors, and Communications” by Jon
Stenerson, Fox Valley Technical College, Printice Hall, 1999
5. “Mechatronics” by Sabri Cetinkunt, John Wiley and Sons, Inc. 2007
6. “Industrial Automation Circuit Design and Components” by David W. Pessen , John Wiley and
Sons 1989.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 68
Pneumatic
Valve symbols
The convention is that the valve has two positions represented by two rectangles; left and the right. The
connections are assumed to be stationary while the valve moves from left to the right or vise-versa. On
the figure the valve is on the left with air flowing from air supply to outlet while the air vent is blocked.
If the valve is moved to the right air supply is blocked and the outlet is connected to the vent.
Prepared by Msc Daniel Tolina. MERTI TVET, Faculty of Technology, Electrical Department 69