Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views

Programmable Logic Control

Uploaded by

joshbinmollel112
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Programmable Logic Control

Uploaded by

joshbinmollel112
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 136

PROGRAMMABLE

LOGIC CONTROL
These are solid –state members of computer family using
intregrated circuits instead of electomechanical devices to
implement control functions.
They can store instructions like
sequencing ,timing ,counting ,arithmetic,data manipulation and
communication to control industrial machines and processing.
In early 70s were used as relay replacers in controlling industrial
automation..its operation include ON/OFF control of the
machines and process that required repetitive operation such as
transfer lines , grinding and boring machines
ADVANCEMENTS
In advanced programmable controller in industry, changes occur
in both hardware(physical components) and software(control
program). example of hardware advancement
1.Faster scan time using advanced microprocessor and
electronics technology
2.Small ,low cost PLCs
3.High –density I/O system provide space –efficient interfaces
at low cost
Example of software advancement
1.PLCs incorporates with OOPs tools and multiple languages
based on IEC 1131-3 standards
2.Small PLCs have been provided with powerful instructions
which extend area of application for small controllers
3.High level languages such as BASIC and C have been
implemented
4.Advanced functional block instructions have been implemented
for ladder diagram for easy instruction command.
Principle of operation
I/O and the CPU
 CPU consist of processor, memory system, and the
power supply .it govern all PLC activities
 I/O system are connected to the field device that
encountered the machine and may be discrete or
analogy such as limit switch, pressure transducers,
push buttons, motor starter ,solenoids
 During operation CPU can 1. read or accept data
from inputs 2.excutes or performs ,control program
stored in the memory system 3.wites or updates
the output devices via output interfaces
 The whole process of sequentially reading the
inputs ,executing the program in the memory and
updating the output is known as scanning
 Always the programming device or PC are required
to enter program into a memory
 Assignment : application of plc and its ranges
Ladder diagram
 It’s a traditional way of representing electrical
sequences of operations.
 It represent the interconnection of field devices in
such a way that the activation or turning ON, of
one device will turn ON another device according
to pre determined sequence of events
Example of simple
‘’ transformation of previous ladder diagram to PLC format.‘’.

 Note the real I/O field devices are connected to


input and output interfaces while the ladder
program is implemented in a manner similar to
hardwiring inside the PLC ‘s CPU (Softwired)
Instead of hardwired in a panel
 CPU reads the status of inputs ,energizes the
corresponding ckt element according to the
program and controls a real output device via the
output interfaces.
PLC format ladder diagram
Possible solutions
 For the hardwired electr.ckt in fig. 1 the pilot
light(PL) will turn ON if the limit switch 1(LS1)
and push button PB1 or limit switch 2(LS2) closes.
 For PLC ckt in fig.2 the same series of events will
cause the pilot light connected to output module to
turn ON.
 The fig.3 shows possible configurations for the
ckt in fig.1 ,the highlighted blue lines indicate that
power is present to that connection point
Electric(hardwired) and PLC ckt. Illustration from fig.1&2
Cont..
Advantages of PLCs
 Generally PLC architecture is modular and flexible,
allowing hardware and software elements to
expand as the application require changes i.e for
large application the small unit can be easily
replaced with a unit having greater memory and
I/O Capacity.
 Provides many benefits to control system from
reliability and repeatability to programmability
THE MEMORY SYSTEM AND
I/O INTERACTION

 The memory system is the area in the PLC’s CPU


where all of the sequences of instructions, or
programs, are stored and executed by the processor
to provide the desired control of field devices
 The memory sections that contain the control
programs can be changed, or reprogrammed to
adapt to manufacturing line procedure changes or
new system start-up requirements.
The total memory system in a PLC is actually
composed of two different memories
 the executive memory
 the application memory
 The executive memory is a collection of permanently
stored programs that are considered part of the PLC
itself.
 These supervisory programs direct all system
activities, such as execution of the control program
and communication with peripheral devices(i.e., relay
instructions, block transfer functions, math
instructions, etc.). This area of memory is not
accessible to the user.
Cont….
 The application memory provides a storage area for the user-
programmed instructions that form the application program. The
application memory area is composed of several areas, each having a
specific function and usage. The storage and retrieval requirements for the
executive and application
 memory sections are not the same; therefore, they are not always stored in
the
 same type of memory. For example, the executive requires a memory that
 permanently stores its contents and cannot be erased or altered either by
loss
 of electrical power or by the user. This type of memory is often unsuitable
for
 the application program.
Memory can be separated into two categories

 Volatile memory loses its programmed contents if all operating


power is lost or removed, whether it is normal power or some form
of backup power
 Volatile memory is easily altered and quite suitable for most
applications when supported by battery backup and possibly a disk
copy of the program.
 Nonvolatile memory retains its programmed contents, even during
a complete loss of operating power, without requiring a backup
source. Nonvolatile memory generally is unalterable, yet there are
special nonvolatile memory types that are alterable. Today’s PLCs
include those that use nonvolatile memory, those that use volatile
memory with battery backup, as well as those that offer both.
Input &Output devices
 The input devices include digital and analogue
devices such as mechanical switches for position
detection, proximity switches, photoelectric switches,
encoders, temperature and pressure switches,
potentiometers, linear variable differential
transformers, strain gauges, thermistors, thermo
transistors and thermocouples.
 Output devices considered include
relays,contactors,solenoid valves and motors.
Input Devices
 The term sensor is used for an input device that
provides a usable output in response to a specified
physical input. For example, a thermocouple is a
sensor which converts a temperature difference into an
electrical output.
 Sensors which give digital/discrete, i.e. on−off, outputs
can be easily connected to the input ports of PLCs.
 Sensors which give analogue signals have to be
converted to digital signals before inputting them to
PLC ports.
Examples Of Some Of The Commonly Used PLC Input
Devices And Their Sensors.
1. Mechanical switches
 A mechanical switch generates an on−off signal or signals as a
result of some mechanical input causing the switch to open or
close.
 Such a switch might be used to indicate the presence of a work
piece on a machining table, the work piece pressing against the
switch and so closing it.
 The absence of the work piece is indicated by the switch being
open and its presence by it being closed
 Example on the fig (a),shows the input signals to a single input
channel of the PLC with its logic levels
work piece not present 0
work piece present 1
Cont…
From the prev. Slide fig.
The 1 level might correspond to a 24 V d.c. input, the 0 to a 0 V input

 With the arrangement shown in Figure (b), when the switch is


open the supply voltage is applied to the PLC input, when the
switch is closed the input voltage drops to a low value. The
logic levels are thus:
 Work piece not present 1
 Work piece present 0
 Switches are available with normally open (NO) or normally
closed (NC) contacts or can be configured as either by choice of
the relevant contacts. An NO switch has its contacts open in the
absence of a mechanical input and the mechanical input is used
to close the switch.
 An NC switch has its contacts closed in the absence of a
mechanical input and the mechanical input is used to open the
2.Proximity switches

 Proximity switches are used to detect the presence of an item


without making contact with it. There are a number of forms
of such switches, some being only suitable for metallic
objects. The eddy current type of proximity switch has a coil
which is energised by a constant alternating current and
produces a constant alternating magnetic field. When a
metallic object is close to it, eddy currents & voltage are
induced in it.
 The voltage can be used to activate an electronic switch
circuit, basically a transistor which has its output switched
from low to high by the voltage change, and so give an on−off
device
3.Photoelectric sensors and switches
 Photoelectric switch devices can either operate as transmissive
types where the object being detected breaks a beam of light,
usually infrared radiation, and stops it reaching the detector or
reflective types where the object being detected reflects a beam
of light onto the detector
 In both types the radiation emitter is generally a light-emitting
diode (LED). The radiation detector might be a
phototransistor, often a pair of transistors, known as a
Darlington pair. The Darlington pair increases the sensitivity.
Depending on the circuit used, the output can be made to
switch to either high or low when light strikes the transistor.
Such sensors are supplied as packages for sensing the presence
of objects at close range, typically at less than about 5 mm
With the above sensors, light is converted to a current, voltage or
resistance change. If the output is to be used as a measure of the
intensity of the light, rather than just the presence or absence of some
object in the light path, the signal will need amplification and then
conversion from analogue to digital by an analogue-to-digital
converter.
4. Encoders
 The term encoder is used for a device that provides a digital
output as a result of angular or linear displacement.
 An increment encoder detects changes in angular or linear
displacement from some datum position, while an absolute
encoder gives the actual angular or linear position.
 The Fig . On next slide shows the basic form of an incremental
encoder for the measurement of angular displacement. A beam
of light, from perhaps a light-emitting diode (LED), passes
through slots in a disc and is detected by a light sensor, e.g. a
photodiode or phototransistor. When the disc rotates, the light
beam is alternately transmitted and stopped and so a pulsed
output is produced from the light sensor.
 The absolute encoder differs from the incremental encoder in having a
pattern of slots which uniquely defines each angular position. With the
form shown in Figure on next slide
 the rotating disc has four concentric circles of slots and four sensors to
detect the light pulses. The slots are arranged in such a way that the
sequential output from the sensors is a number in the binary code, each
such number corresponding to a particular angular position. With 4
tracks there will be 4 bits and so the number of positions that can be
detected is 2^4 = 16, i.e. a resolution of 360/16 = 22.5^o. Typical
 encoders tend to have up to 10 or 12 tracks. The number of bits in the
 binary number will be equal to the number of tracks. Thus with 10 tracks
 there will be 10 bits and so the number of positions that can be detected
is 2^10, i.e. 1024, a resolution of 360/1024 = 0.35 ^o.
 The rotating wheel of the absolute encoder. Note
that though the normal form of binary code is
shown in the above figure, in practice a modified
form of binary code called the Gray code is
generally used.
 This code, unlike normal binary, has only one bit
changing in moving from one number to the next.
Thus we have the sequence 0000, 0001, 0011,
 0010, 0011, 0111, 0101, 0100, 1100, 1101, 1111.
OUTPUT DEVICES
 The input/output channels provide isolation and
signal conditioning functions so that sensors and
actuators can often be directly connected to them
without the need for other circuitry.
 It is also through the input/output unit that programs
are entered from a program panel. Every
input/output point has a unique address which can
be used by the CPU.
 Electrical isolation from the external world is
usually by means of optoisolators (the term
optocoupler is also often used).
Opto coupler
 When a digital pulse passes through the light-emitting diode, a
pulse of infrared radiation is produced. This pulse is detected
by the phototransistor and gives rise to a voltage in that circuit.
 The gap between the light-emitting diode and the
phototransistor gives electrical isolation but the arrangement
still allows for a digital pulse in one circuit to give rise to a
digital pulse in another circuit.
 The digital signal that is generally compatible with the
microprocessor in the PLC is 5 V d.c. However, signal
conditioning in the input channel with isolation, enables a
wide range of input signals to be supplied to it .
 A range of inputs might be available with a larger PLC, e.g. 5
V, 24 V, 110 V and 240 V digital/discrete,
 Outputs are specified as being of relay type, transistor type or
triac type
With the relay type, the signal from the PLC output is used to
operate a relay and is able to switch currents of the order of a
few amperes in an external circuit. The relay not only allows
small currents to switch much larger currents but also isolates the
PLC from the external circuit. Relays are, however, relatively
slow to operate.
Relay outputs are suitable for a.c. and d.c. switching. They can
withstand high surge currents and voltage transients.
The transistor type of output uses a transistor to switch current
through the external circuit. This gives a considerably faster
switching action. It is, however, strictly for d.c. switching and is
destroyed by over current and high reverse voltage. As a
protection, either a fuse or built-in electronic protection are used.
Optoisolators are used to provide isolation
Triac outputs, with optoisolators for isolation, can be used to
control external loads which are connected to the a.c. power
supply. It is strictly for a.c. operation and is very easily destroyed
by overcurrent. Fuses are virtually always included to protect
1. Relay
 Solenoids form the basis of a number of output control
actuators. When a current passes through a solenoid a
magnetic field is produced and this can then attract ferrous
metal components in its vicinity.
 One example of such an actuator is the relay, the term
contactor being used when large currents are involved. When
the output from the PLC is switched on, the solenoid magnetic
field is produced and pulls on the contacts and so closes a
switch or switches .
 The result is that much larger currents can be switched on.
Thus the relay might be used to switch on the current to a
motor.
2. Directional control valves

 Another example of the use of a solenoid as an


actuator is a solenoid operated valve.
 The valve may be used to control the directions of
flow of pressurised air or oil and so used to operate
other devices such as a piston moving in a cylinder .


3.MOTORS

 A d.c. motor has coils of wire mounted in slots on a cylinder of


ferromagnetic material, this being termed the armature.
 The armature is mounted on bearings and is free to rotate. It is
mounted in the magnetic field produced by permanent magnets or
current passing through coils of wire, these being termed the field
coils.
 When a current passes through the armature coil, forces act on the
coil and result in rotation. Brushes and a commutator are used to
reverse the current through the coil every half rotation and so keep the
coil rotating.
 The speed of rotation can be changed by changing the size of the
current to the armature coil.
I/O PROCESSING
 The input/output (I/O) unit provides the interface
between the PLC controller and the outside world
and must therefore provide the necessary signal
conditioning to get the signal to the required level
and also to isolate it from possible electrical
hazards such as high voltages
 This chapter includes the forms of typical
input/output modules and installation where
sensors are some distance from the PLC
processing, their communication links to the PLC.
Input signals from sensors and the outputs required for
actuating devices can be :
1. Analogue, i.e. a signal whose size is related to the
size of the quantity being sensed.
2. Discrete, i.e. essentially just an on−off signal.
3. Digital, i.e. a sequence of pulses
 The CPU, however, must have an input of digital

signals of a particular size, normally 0 to 5 V. The


output from the CPU is digital, normally 0 to 5 V.
Thus there is generally a need to manipulate input
and output signals so that they are in the required
form.
Input units
 The terms sourcing and sinking are used to describe the way
in which d.c devices are connected to a PLC. With sourcing,
using the conventional current flow direction as from positive
to negative, an input device receives current from the input
module, i.e. the input module is the source of the current.
 If the current flows from the output module to an output load
then the output module is referred to as sourcing
 With sinking, using the conventional current flow direction
as from positive to negative, an input device supplies current
to the input module, i.e. the input module is the sink for the
current
 If the current flows to the output module from an output load
then the output module is referred to as sinking
Sourcing and Sinking
D.C input unit
A.C Input Unit
 The figures in previous slides show the basic input unit circuits
for discrete and digital d.c. and discrete a.c. inputs. Optoisolators
are used to provide protection. With the a.c. input unit, a rectifier
bridge network is used to rectify the a.c. so that the resulting d.c.
signal can provide the signal for use by the optoisolator to give
the input signals to the CPU of the PLC.
 Individual status lights are provided for each input to indicate
when the input device is providing a signal.
 Analogue signals can be inputted to a PLC if the input channel is
able to convert the signal to a digital signal using an analogue-to-
digital converter. With a rack mounted system this may be
achieved by mounting a suitable analogue input card in the rack.
So that one analogue card is not required for each
analogue input, multiplexing is generally used see the
figure below
 Fig (a) in previous slide illustrates the function of an
analogue-to-digital converter (ADC). A single analogue input
signal gives rise to on−off output signals along perhaps eight
separate wires. The eight signals then constitute the so-termed
digital word corresponding to the analogue input signal level.
 With such an 8-bit converter there are 2^8 = 256 different
digital values possible; these are 0000 0000 to 1111 1111, i.e.
0 to 255.
 The digital output goes up in steps Fig(b) and the analogue
voltages required to produce each digital output are termed
quantisation levels
 The analogue voltage has to change by the difference in analogue voltage
between successive levels if the binary output is to change. The term
resolution is used for the smallest change in analogue voltage which will
give rise to a change in one bit in the digital output. With an 8-bit ADC if,
say, the full-scale analogue input signal varies between 0 and 10 V then a
step of one digital bit involves an analogue input change of 10/255 V or
about 0.04 V.
 This means that a change of 0.03 V in the input will produce no change in
the digital output. The number of bits in the output from an analogue-to-
digital converter thus determines the resolution, and hence accuracy,
possible. If a 10-bit ADC is used then 210 = 1024 different digital values
are possible and, for the full-scale analogue input of 0 to 10 V, a step of one
digital bit involves an analogue input change of 10/1023 V or about 0.01 V.
 In general, the resolution of an n-bit ADC is 1/(2^n – 1).
Analogue-to-digital conversion for an 8-bit
converter when the analogue input is in the range 0
to 10 V:
Output units
 With a PLC output unit, when it provides the
current for the output device.fig a below said to be
sourcing and when the output device provides the
current to the output unit it is said to be sinking.
 Fig. b Quite often, sinking input units are used for
interfacing with electronic equipment and sourcing
output units for interfacing with solenoids.
Output units: (a)sourcing (b) sinking
 Output units can be relay, transistor or triac.
Figures below shows the basic form of a relay
output unit, transistor output unit and that of a triac
output unit.
Relay output module
Transistor o/p unit current sinking
Transistor o/p unit current sourcing
Triac output unit
 Analogue outputs are frequently required and can
be provided by digital-to-analogue converters
(DACs) at the output channel.
 The input to the converter is a sequence of bits with
each bit along a parallel line as shown on next
slide.
 A bit in the 0 line gives rise to a certain size output pulse. A bit
in the 1 line gives rise to an output pulse of twice the size of the
0 line pulse. A bit in the 2 line gives rise to an output pulse of
twice the size of the 1 line pulse. A bit in the 3 line gives rise to
an output pulse of twice the size of the 2 line pulse, and so on.
 When the digital input changes, the analogue output changes in
a stepped manner, the voltage changing by the voltage changes
associated with each bit. For example, if we have an 8-bit
converter then the output is made up of voltage values of 2^8 =
256 analogue steps. Suppose the output range is set to 10 V d.c.
One bit then gives a change of 10/255 V or about 0.04 V.
Signal Conditioning
 When connecting sensors which generate digital or
discrete signals to an input unit, care has to be taken
to ensure that voltage levels match.
 However, many sensors generate analogue signals.
In order to avoid having a multiplicity of analogue
input channels to cope with the wide diversity of
analogue signals that can be generated by sensors,
external signal conditioning is often used to bring
analogue signals to a common range and so allow a
standard form of analogue input channel to be used.
 A common standard that is used (Fig. below) is to
convert analogue signals to a current in the range 4
to 20 mA and thus to a voltage by passing it
through a 250 Ώ resistance to give a 1 to 5 V input
signal.
 Thus, for example, a sensor used to monitor liquid
level in the height range 0 to 1 m would have the 0
level represented by 4 mA and the 1 m represented
by 20 mA.
A potential divider (Figure below) can be used to reduce a voltage from
a sensor to the required level;
the output voltage level Vout is:
 Amplifiers can be used to increase the voltage
level; Figure shows the basic form of the circuits
that might be used with a 741 operational amplifier
with (a) being an inverting amplifier and (b) a non-
inverting
 amplifier. With the inverting amplifier the output
Vout is:
 Often a differential amplifier is needed to amplify
the difference between two input voltages. Such is
the case when a sensor, e.g. a strain gauge, is
connected in a Wheatstone bridge and the output is
the difference between two voltages or a
thermocouple where the voltage difference between
the hot and cold junctions is required.
 Figure shows the basic form of an operational
amplifier circuit for this purpose. The output
voltage Vout is:
 As an illustration of the use of signal conditioning,
Figure on previous slide shows the arrangement
that might be used for a strain gauge sensor.
 The sensor is connected in a Wheatstone bridge and
the out-of-balance potential difference amplified by
a differential amplifier before being fed via an
analogue-to-digital converter unit which is part of
the analogue input port of the PLC.
Serial and Parallel Communications
 Serial communication is when data is transmitted one
bit at a time (Figure (a)). Thus if an 8-bit word is to be
transmitted, the eight bits are transmitted one at a time
in sequence along a cable. This means that a data word
has to be separated into its constituent bits for
transmission and then reassembled into the word when
received.
 Parallel communication is when all the constituent bits
of a word are simultaneously transmitted along parallel
cables (Figure (b)). This allows data to be transmitted
over short distances at high speeds.
 Serial communication is used for transmitting data over
long distances. It is much cheaper to run, for serial
communication, a single core cable over a long distance
than the multicore cables that would be needed for parallel
communication
 Parallel communication might be used when connecting
laboratory instruments to the system. However, internally,
PLCs work, for speed, with parallel communications.
Thus, circuits called UARTS (universal asynchronous
receivers–transmitters) have to be used at input/output
ports to converts serial communications signals to parallel.
Serial standards
Requirements for serial communication
1. Determine the voltage levels to be used for signals, i.e.
what signal represents a 0 and what represents a 1.
2. What the bit patterns being transmitted mean and how the
message is built up. A sequence of words are being sent
along the same cable and it is necessary to determine when
one word starts and finishes and the next word starts.
3. The speed at which the bit pattern is to be sent, i.e. the
number of bits per second.
4. Synchronization of the clocks at each end.
5. Protocols, or flow controls, to enable such
information as ‘able to receive data’ or ‘not ready
to receive data’. This is commonly done by using
two extra signal wires (termed handshake wires),
one to tell the receiver that the transmitter is ready
to send the data and the other to tell the transmitter
that the receiver is ready to receive data.
6. Error-checking to enable a bit pattern to be
checked to determine if corruption of the data has
occurred during transmission
 The most common standard serial communications
interface used is the RS232. Connections are made
via 25-pin D-type connectors (see the figure on
next slide).
 With usually, though not always, a male plug on
cables and a female socket on the equipment. Not
all the pins are used in every application.
D TYPE CONNECTOR
The minimum requirements are:
Pin 1: Ground connection to the frame of chassis
Pin 2: Serial transmitted data (output data pin)
Pin 3: Serial received data (input data pin)
Pin 7: Signal ground which acts as a common signal return path
A configuration that is widely used with interfaces involving computers is:
Pin 1: Ground connection to the frame of chassis
Pin 2: Serial transmitted data (output data pin)
Pin 3: Serial received data (input data pin)
Pin 4: Request to send
Pin 5: Clear to send
Pin 6: Data set ready
Pin 7: Signal ground which acts as a common signal return path
Pin 20: Data terminal ready
 The signals sent through pins 4, 5, 6 and 20 are
used to check that the receiving end is ready to
receive a signal, the transmitting end is ready to
send and the data is ready to be sent. With RS232, a
1 bit is represented by a voltage between −5 and
−25 V, normally −12 V, and a 0 by a voltage
between +5 and +25 V, normally +12 V.
 The term baud rate is used to describe the
transmission rate, it being approximately the
number of bits transmitted or received per second.
 However, not all the bits transmitted can be used
for data, some have to be used to indicate the start
and stop of a serial piece of data, these often being
termed flags, and as a check as to whether the data
has been corrupted during transmission
RS232 signal levels
 The fig. below shows the type of signal that might be sent with
RS232. The parity bit is added to check whether corruption has
occurred, with even parity a 1 being added to make the number
of 1s an even number. To send seven bits of data, eleven bits
may be required.
 The signals sent through pins 4, 5, 6 and 20 are
used to check that the
 receiving end is ready to receive a signal, the
transmitting end is ready to
 send and the data is ready to be sent. With RS232, a
1 bit is represented
 by a voltage between −5 and −25 V, normally −12
V, and a 0 by a voltage
 between +5 and +25 V, normally +12 V.
Ladder and functional
block programming
 Programming can be made even easier by the use of the so-called
high level languages, e.g. C, BASIC, PASCAL,
FORTRAN,COBOL
 These use pre-packaged functions, represented by simple words or
symbols descriptive of the function concerned. For example, with
C language the symbol & is used for the logic AND operation.
However, the use of these methods to write programs requires
some skill in programming and PLCs are intended to be used by
engineers without any great knowledge of programming, hence
ladder diagram programming was developed.
 This is a means of writing programs which can then be converted
into machine code by some software for use by the PLC
microprocessor.
 This chapter is an introduction to the programming
of a PLC using ladder diagrams and functional
block diagrams, Here we are concerned with the
basic techniques involved in developing ladder and
function block programs to represent basic
switching operations, involving the logic functions
of AND, OR, Exclusive OR, NAND and NOR, and
latching.
PLC ladder programming
 Writing a program is then equivalent to drawing a switching
circuit. The ladder diagram consists of two vertical lines
representing the power rails. Circuits are connected as
horizontal lines, i.e. the rungs of the ladder, between these two
verticals.
 a). The vertical lines of the diagram represent the power rails
between which circuits are connected. The power flow is taken
to be from the left-hand vertical across a rung.
 b). Each rung on the ladder defines one operation in the
control process.
 c). A ladder diagram is read from left to right and from top to
bottom. See on the next fig.
.

Note:The end rung might be indicated by a block


with the word END or RET for return, since the
program promptly returns to its beginning
 d). Each rung must start with an input or inputs and must
end with at least one output.
 e). Electrical devices are shown in their normal
condition. Thus a switch which is normally open until
some object closes it, is shown as open on the ladder
diagram. A switch that is normally closed is shown
closed.
 f). A particular device can appear in more than one rung
of a ladder. For example, we might have a relay which
switches on one or more devices. The same letters and/or
numbers are used to label the device in each situation.
 g). The inputs and outputs are all identified by their
addresses, the notation used depending on the PLC
manufacturer.

 Note: Some slight variations occur between the


symbols when used in semi-graphic form and when
in full graphic. Note that inputs are represented by
different symbols representing normally open or
normally closed contacts
Some symbol in semi and full graphics
 In drawing ladder diagrams the names of the associated
variable or addresses of each element are appended to its
symbol. Thus Figures below shows how the ladder
diagram would appear using
 (a) Mitsubishi, (b) Siemens, (c) Allen-Bradley, (d)
Telemecanique notations for the addresses. Thus Figure
(a) indicates that this rung of the ladder program has an
input from address X400 and an output to address Y430.
 When wiring up the inputs and outputs to the PLC, the
relevant ones must be connected to the input and output
terminals with these addresses.
Logic functions
 There are many control situations requiring actions
to be initiated when a certain combination of
conditions is realised.
 Consider the drill motor is to be activated when the
limit switches are activated that indicate the
presence of the workpiece and the drill position as
being at the surface of the workpiece ,Such a
situation involves the AND logic function,
condition A and condition B having both to be
realised for an output to occur.
 AND
 Shows a situation where an output is not energised
unless two, normally open, switches are both
closed. Switch A and switch B have both to be
closed, which thus gives an AND logic situation.
We can think of this as representing a control
system with two inputs A and B
 OR
 Shows an electrical circuit where an output is
energised when switch A or B, both normally open,
are closed. The lader diagram describe it
 An example of an OR gate control system is a
conveyor belt transporting bottled products to
packaging where a deflector plate is activated to
deflect bottles into a reject bin if either the weight
is not within certain tolerances or there is no cap
on the bottle
TIMERS, COUNTERS
 Timers and counters have been in existence for as long as relays
and provide an important component in the development of logic.
 Timers were constructed in the past as an add-on device to relays
slowing down the transition of the plunger from immediately
opening or closing. The time delay was accomplished with a
pneumatic bladder that allowed the air to escape either quickly or
slowly depending on the setting of the timer.
 Quick was usually less than a second and slow was usually
between 30 and 60 seconds. Setting this kind of timer was an
inexact science and today's traffic lights are an example of the
fickle nature of timers that seldom respond in exactly the same
from day to day and year to year.
Timers
 Timers are used to provide logic when a circuit turns on or
off. Traditional pneumatic timers were provided as either
on-delay timers or off-delay timers.
 Contacts were provided both normally open and normally
closed for each type of timer. The timer head was chosen as
either the on-delay type or off-delay type.
 PLCs allow for a quick change from one type to the other
with a few keystrokes on the programming panel.
PLC vendors do not need to use the terms of
on-delay or off-delay, normally closed, normally
open, held closed, or held open, these terms
are an important part of design of PLC circuits.
Some vendors still use the terms to show
linkage between the PLC and the original timer
circuits.
Allen-Bradley provides three timers; TON, TOF,
and RTO. All are block-type instructions and are
located at the extreme right of each rung used.
TON: Generate on-delay
 TP: Generate pulse
The instruction Generate pulse sets output Q for
duration PT. The instruction is started when the result
of logic operation (RLO) at input IN changes from 0
to 1 (positive signal edge). The programmed time PT
begins when the instruction starts. Output Q is set for
the duration PT, regardless of the subsequent course
of the input signal. Even if a new positive signal edge
is detected, the signal state at the output Q is not
affected as long as the PT time is running.
 The instruction Generate on-delay delays setting of the
output Q by the programmed duration PT. The instruction
is started when the result of logic operation (RLO) at input
IN changes from 0 to 1 (positive signal edge).
 The programmed time PT begins when the instruction
starts. When the duration PT expires, the output Q has the
signal state 1. Output Q remains set as long as the start
input is still 1.
 When the signal state at the start input changes from 1 to 0,
output Q is reset. The timer function is started again when
a new positive signal edge is detected at the start input.
TOF: Generate off-delay
 The instruction Generate off-delay delays resetting of the
output Q by the programmed duration PT. The Q output is
set when the result of logic operation (RLO) at input IN
changes from 0 to 1 (positive signal edge).
 When the signal state at input IN returns back to 0,
programmed time (PT) starts. Output Q remains set as
long as the duration PT is running.
 When duration PT expires, the Q output is reset. If the
signal state at the IN input changes to 1 before the
duration PT expires, the time is reset. The signal state at
the output Q will continue to be 1.
 The current time value can be queried at the ET
output. The time value starts at T#0s and ends
when the value of duration PT is reached.
 When the duration PT expires, the ET output
remains set to the current value until input IN
changes back to 1. If input IN switches to 1 before
the duration PT has expired, the ET output is reset
to the value T#0s
---( TON )---: Start on-delay timer
 The Start on-delay timer instruction starts an IEC timer
with a specified duration as on-delay timer.
 The IEC timer is started when the result of logic
operation (RLO) changes from 0 to 1 (positive signal
edge). The IEC timer runs for the specified time. A
query of the timer status for 1 returns signal state 1 if
the time has expired and the RLO at the input of the
instruction is 1.
 If the RLO changes to 0 before the time expires, the
IEC timer is reset. In this case, querying the timer status
for 1 returns signal state 0. The IEC timer restarts when
the next positive signal edge is detected at the input of
( TOF )---: Start off-delay timer
 The Start off-delay timer instruction starts an IEC timer with a
specified duration as off-delay timer. The query of the timer
status for 1 returns the signal state 1 if the result of the logic
operation (RLO) at the input of the instruction has the signal
state 1.
 When the RLO changes from 1 to 0 (negative signal edge), the
IEC timer starts with the specified time. The timer status
remains at signal state 1 as long as the IEC timer is running.
 When the timer has run out and the RLO at the input of the
instruction has the signal state 0, the timer status is set to the
signal state 0. If the RLO changes to 1 before the time expires,
the IEC timer is reset and the timer status remains at signal state
---( TONR )---: Time accumulator
 The Time accumulator instruction records how long the
signal is at the input of instruction 1. The instruction is
started when the result of logic operation (RLO) changes
from 0 to 1 (positive signal edge).
 The time is recorded as long at the RLO is 1. If the RLO
changes to 0, the instruction is halted. If the RLO
changes back to 1, the time recording is continued.
 The query of the timer status for 1 returns the signal state
1 if the recorded time exceeds the value of the specified
duration and the RLO at the input of coil is 1. The timer
status and the currently expired timer can be reset to 0
---( RT )---: Reset timer
 The Reset timer instruction resets an IEC timer to 0. The
instruction is only executed if the result of logic operation
(RLO) at the input of the coil is 1.
 If current is flowing to the coil (RLO is 1), the structure
components of the timer in the specified data block are
reset to 0. If the RLO at the input of the instruction is 0,
the timer remains unchanged.
 The instruction does not influence the RLO. The RLO at
the input of the coil is sent directly to the output of the
coil. You assign the Reset timer instruction an IEC timer
that has been declared in the program
CTD: Count down
 You can use the Count_down instruction to decrement the
value at output CV. When the signal state at the CD input
changes from 0 to 1 (positive signal edge), the instruction
executes and the current count value at the CV output is
decremented by one.
 When the instruction executes the first time, the count value
of the CV parameter is set to the value of the PV parameter.
Each time a positive signal edge is detected, the count value
is decremented until it reaches the low limit value of the
specified data type.
 When the low limit is reached, the signal state at the CD
 You can scan the counter status at the Q output. If the
current count value is less than or equal to zero, the Q
output is set to signal state 1.
 In all other cases, the Q output has signal state 0. You
can also specify a constant for the PV parameter. The
value at the CV output is set to the value of the PV
parameter when the signal state at the LD input
changes to 1.
 As long as the LD input has signal state 1, the signal
state at the CD input has no effect on the instruction.
The following example shows how the instruction
works:
 LogixPro allows you to practice and
develop your RSLogix programming
skills where and when you want.
 It replaces the PLC, ladder rung editor,

and all the electrical components that


have until now, been required to learn
RSLogix.
 When the signal state of the TagIn_1 operand
changes from 0 to 1, the Count down instruction
executes and the value at the Tag_CV output is
decremented by one.
 With each additional positive edge signal, the

count value is decremented until the low limit of


the specified data type (-32,768) is reached.
 The TagOut output has signal state 1 as long as

the current count value is less than or equal to


zero. In all other cases, the TagOut output has
signal state 0.
Getting Started with
RSLogix & LogixPro

 LogixPro allows you to practice and


develop your RSLogix programming
skills where and when you want.
 It replaces the PLC, ladder rung editor,

and all the electrical components that


have until now, been required to learn
RSLogix
The LogixPro Screen
 The most commonly used elements of LogixPro are
displayed below. The Edit Panel provides easy access
to all the RSLogix instructions and they may be simply
dragged and dropped into your program.
 Once your program is ready for testing, clicking on the
"Toggle Button" of the Edit Panel will bring the PLC
Panel into view. From the PLC Panel you can
download your program to the "PLC" and then place it
into the "RUN" mode. This will initiate the scanning of
your program and the I/O of your chosen simulation.
Editing Your Program
 Both Instructions and Rungs are selected simply by
clicking on them with the left mouse button.
 Deleting is then just a matter of hitting the Del key on
your keyboard.
 Double Clicking (2 quick clicks) with the left mouse
button allows you to edit an instruction's address while
right clicking (right mouse button) displays a pop-up
menu of related editing commands.
 Click on an Instruction or Rung with the left mouse
button and keep it held down and you will be able to drag
it wherever you please.
Debugging Your Program
 If you take a look at the PLC Panel you'll notice an
adjustable Speed Control. This is not a component of
normal PLCs, but is provided with LogixPro so that you
may adjust the speed of the simulations to suit your
particular computer.
 When the simulation is slowed, so is the PLC scanning.
You can use this to good effect when trying to debug your
program. Set the scan slow enough and you can easily
monitor how your program's instructions are responding.
This capability may not be typical of real PLCs, but for
Training Purposes, you will find that it is an invaluable
Relay Logic
Introductory Lab
 RSLogix Relay Logic Instructions
This exercise is designed to familiarize you with the operation of
LogixPro and to step you through the process of creating, editing and
testing simple PLC programs utilizing the Relay Logic Instructions
supported by RSLogix.

 From the Simulations Menu at the top of the screen, Select the I/O
Simulation and ensure that the User Instruction Bar shown above is
visible.
The program editing window should contain a
single rung. This is the End of Program rung and
is always the last rung in any program. If this is
the only rung visible then your program is
currently empty.
If your program is not empty, then click on the
File menu entry at the top of the screen and
select "New" from the drop-down list. A dialog
box will appear asking for you to select a
Processor Type. Just click on "OK" to accept the
Now maximize the ProSim-II Simulation Window
. The I/O Simulator

 The simulator screen shown on last slide,


should now be in view. For this exercise we will
be using the I/O simulator section, which
consists of 32 switches and lights.
 Two groups of 16 toggle switches are shown

connected to 2 Input cards of our simulated


PLC. Likewise two groups of 16 Lights are
connected to two output cards of our PLC. The
two input cards are addressed as "I:1" and "I:3"
while the output cards are addressed "O:2" and
 Use your mouse to click on the various switches
and note the change in the status color of the
terminal that the switch is connected to.
 Move your mouse slowly over a switch, and the

mouse cursor should change to a hand symbol,


indicating that the state of switch can be altered by
clicking at this location.
 When you pass the mouse over a switch, a "tool-

tip" text box also appears and informs you to "Right


Click to Toggle Switch Type". Click your right
mouse button on a switch, and note how the switch
RSLogix Program Creation

I want you to now enter the following single run


program which consists of a single Input
instruction (XIC - Examine If Closed) and a
single Output instruction (OTE - Output
Energize).
There's more than one way to accomplish this
task
 First click on the "New Rung" button in the
User Instruction Bar. It's the first button on the
very left end of the Bar.
 If you hold the mouse pointer over any of
these buttons for a second or two, you should
see a short "ToolTip" which describes the
function or name of the instruction that the
button represents.
 You should now see a new Rung added to
your program as shown on last slide, and the
Rung number at the left side of the new rung
should be highlighted. Note that the new Rung
was inserted above the existing (END) End Of
Program Rung.
 Alternatively you could have dragged (left
mouse button held down) the Rung button
into the program window and dropped it onto
one of the locating boxes that would have
appeared.
 Now click on the XIC instruction with your
left mouse button (Left Click) and it will be
added to the right of your highlighted
selection. Note that the new XIC
instruction is now selected (highlighted).
 Once again, you could have alternatively

dragged and dropped the instruction into


the program window.
 If you accidentally add an instruction which you
wish to remove, just Left Click on the
instruction to select it, and then press the "Del"
key on your keyboard. Alternatively, you may
right click on the instruction and then select
"Cut" from the drop-down menu that appears.
 Left Click on the OTE output instruction and it will be.
added to the right of your current selection

Double Click (2 quick left mousebutton clicks) on the XIC


instruction and a textbox should appear which will allow you to
enter the address (I:1/0) of the switch we wish to monitor. Use the
Backspace key to get rid of the "?" currently in the textbox. Once
you type in the address, click anywhere else on the instruction
(other than the textbox) and the box should close.
Right Click on the XIC instruction and select "Edit Symbol" from the
drop-down menu that appears. Another textbox will appear where
you can type in a name (Switch-0) to associate with this address.
As before, a click anywhere else will close the box.
 Enter the address and symbol for the OTE
instruction and your first RSLogix program will
now be complete. Before continuing however,
Double check that the addresses of your
instructions are correct.
Testing your Program
 It's now time to "Download" your program to the
PLC. First click on the "Toggle" button at the top
right corner of the Edit Panel which will bring the
PLC Panel into view.
• Click on the "DownLoad" button to initiate the
downloading of your program to the PLC. Once
complete, click inside the "RUN" option selection
circle to start the PLC scanning.
• Enlarge the Simulation window so that you can see
both the Switches and Lamps, by dragging the bar
that separates the Simulation and Program windows
to the right with your mouse. Now click on Switch
I:1/00 in the simulator and if all is well, Lamp O:2/00
should illuminate.
 Toggle the Switch On and Off a number of times and note
the change in value indicated in the PLC Panel's status
boxes which are being updated constantly as the PLC
Scans. Try placing the PLC back into the "PGM" mode and
then toggle the simulator's Switch a few times and note the
result. Place the PLC back into the "Run" mode and the
Scan should resume.
 We are usually told to think of the XIC instruction as an
electrical contact that allows electrical flow to pass when an
external switch is closed. We are then told that the OTE will
energize if the flow is allowed to get through to it. In actual
fact the XIC is a conditional instruction which tests any bit
that we address for Truth or a 1.
Editing your Program
 Click on the "Toggle" button of the PLC Panel which will put
the PLC into the PGM mode and bring the Edit Panel back
into view.
 Now add a second rung to your program as shown below.
This time instead of entering the addresses as you did before,
try dragging the appropriate address which is displayed in the
I/O simulation and dropping it onto the instruction.
 Note that the XIO instruction which Tests for Zero
or False has it's address highlighted in yellow. This
indicates that the instruction is True, which in the
case of an XIO, means that the bit addressed is
currently a Zero or False
 Once you feel comfortable with dragNdrop, ensure that
your program once again looks like the one pictured
above, Now download your program to the PLC and place
the PLC into the Run Mode.
 Toggle both Switch-0 and Switch-1 on and off a number
of times and observe the effects this has on the lamps.
Ensure that you are satisfied with the operation of your
program before proceeding further

You might also like