Sie sind auf Seite 1von 25

Programmable Logic Controller

Introduction:
A Programmable Logic Controller(PLC) or Programmable Controller is a
digital computer used for automation of typically industrial electromechanical
processes, such as control of Machinery on factory assembly lines, amusement
rides, or light fixtures. The PLCs find vast application in the control and operation of
Automated Manufacturing Process Equipment and Machinery, Packing and Filling
equipment, Chemical Mixing, Conveyor systems and Distillation etc.
Initially, PLCs have been used to replace relay logic systems. These PLCs were
programmed in LADDER LOGIC, which strongly resembles a schematic diagram of
relay logic. Ladder logic notation was chosen to reduce training demands for the
existing technicians; other early PLCs used a form of instruction list programming,
based on a stack based logic solver.
The PLCs has following features and specific which distinguish from computers.
These are,
They are rugged and design to withstand vibrations, temperature, humidity and
noise.
The interfacing for inputs and outputs is inside the controller.
They are easily programmed and have an easily understood programming
language. Programming primarily consider with logic and switching operation.
They can be designed with communication capabilities that allow them to interface
with computer system or human.
Example:1 Consider a hardwired circuit used for a simple application consisting of
two independent switches and motors.
Operation: Following fig. shows a Hardwired Motor Circuit

They are wired parallel to generate a single logic,


Logic 1: When switch is on motor 1 is ON otherwise OFF
Logic 2: Introduce more complex logic that is motor 2 should be OFF when the
motor 1 is switched ON.

This will require the redesigning of circuit and hence we need to rewiring. Plant
machine control involves such a complex process and hence controller system
inherently requires of relays and circuits.
To implement such a complex logic we need use a controller circuit to control
switches. Hence the switcher are not connected directly to the Motors, instead of
that the switches are connected to the input modules and log module are connected
to the output modules.

Above fig 4.2 shows a Hardwired Motor Circuit in order to control and process.
Here, the input devices such as sensors are connected to PLC and form switching
devices. The output devices such as Motors and valves are connected to the PLC
only when the program conditions have been met, the output devices are switched
ON or OFF based on logics of inputs.

4.2 Basic Structure


The PLC is designed as a replacement for the hardwired relay and timer logic,
where PLC provides ease and flexibility of control based on programming and
executing logical instructions. The internal functions such as timers, counters and
shift registers making sophisticated control possible using even the smallest PLC.
The structure of PLC is based on the same principles of computes architecture; it is
capable of performing other functions such as counting logistics, numerical
applications, comparing and processing of signals.

A typical PLC can be divided into four parts. They are,


i)
ii)
iii)
iv)

Input/Output Module(I/O)
Central Processing Unit(CPU)
Memory
Programming Unit.

1. Input/ Output Module


Input/Output Module are used to transfer data between external devices and
CPU. The input and output modules are normally incorporated into PLC in two
ways.
i)

Fixed I/O- It is a small unit that comes in one piecewith processor i.e;the
I/O terminals cannot be changed in fixed I/O.

ii)

Modular I/O- It is packed together i.e; there are several compartments of


I/O Modules are plugged together.

Input Module ensures a usable signal is available for the CPU circuit protection
capabilities will also be necessary in the module to protect the CPU circuitry from
faults, surges or spikes in the incoming signal.
The output module reads digital signals transmitted from the CPU, and operates
motor starters. Solenoids and status monitors. The module essentially function as a
switching devices and provides on-off signals to the associated devices. If the
output module is incapable of handling the power needed by the device, it sends a
signal to an external relay, which connects with the actual power circuit.
Input and Output devices are placed outside the PLC, with connecting wires
attached to the terminal strips on the PLC. There are no connections the inputs and
output. Each input and output terminal has a unique address.
2. Central Processing Unit(CPU)
The CPU is the brain of the PLC, consisting of a microprocessor which interprets the
input signals and carries out the control actions according to the program stored in
the memory, communication the decision as an action signal to the outputs.
It forms the core portion of the PLC. The microprocessor based unit contains the
logic and control algorithm for the controller.
The CPU scans the total information package stored in the memory and the input
and output devices continuously. During the scan the CPU also executes instruction
based on input data, sends appropriate output responses to the output devices,
updates data acquisition systems, and indicates condition changes.

Scan time for larger unit depends on the size of the memory and on the
configuration of the system. Smaller PLC has longer scan times than larger units
and has less memory and reduced capacity for special instructions and peripheral
equipment.
The power supply unity is needed to convert the AC voltage to the low DC voltage
necessary for the processor and to supply power to other circuits in the input and
output interface module.
3. Memory Unit
The memory unit is where the program is stored that is to be used for the control
actions to be exercised by the Microprocessor and data stored from input for
processing and for the output.
The memory in PLC stores the digital control logic, the process program and the
necessary instruction to operate the system. It stored in units called bytes.
The memory used in PLC is
I)
II)

Non-volatile Memory- The memory may retain the information even the
power is turned off.
Volatile Memory- The memory may lose the information when the
electrical
power
is
turned
off.

User interface with the PLC mostly works through the volatile memory.
According to the purpose of usage, there are two main memory types.
I)

II)

RAM(Random Access memory)- It is used for program and data storage.


For this we need to provide a battery backup in order to prevent loss of
any data when power is removed. It is a volatile memory.
ROM(Read Only Memory)- ROM memory cells store information
permanently, and it is used to store the operating program of the
computer to permit easy startup. It is permanent storage hence called as
non-volatile memory.

4. Programming Unit
The programming unit is used to enter the required program using ladder logic
into the memory of the processor. The program is developed in the device and then
transferred to the memory unit of the PLC.
Programming device also enters the required program using ladder logic into the
memory of the processor. The sequence of operation and ultimate control of

equipment machinery is specified and determined by the ladder program, the


program device is normally connected to the controller. Actual programming is
usually achieved by pushing keys or a keyboard and can be programmed by people
without much computer programming experience.
There are normally three approaches followed by the program,
I)
II)
III)

Use of hand-held programmer,


Terminal with video display unit,
A PC with appropriate software.

4.3 ARCHITECTURE
The internal logic design of the system is known as architecture. It determines the
various operations performed by the system.
Here the PLCs are programmed to sense, activate and control machines and
equipment and incorporate a large number of internal hardware and software,
normally referred as internal architecture.
Following fig 4.4 gives the basic internal architecture of a PLC.

A PLC consist of the following elements


I)
II)
III)

CPU(Central Processing Unit)


Memory
I/O processing devices.

1.Central Processing Unit


In general CPU consist of

A) Arithmetic and logical unit(ALU) which is responsible for data manipulation


and carrying out arithmetic operations like addition and subtraction and
logical operation like AND, OR, NOT and EX-OR.

B) Memory termed registers, located within processor and used to store


information involves in program execution.
C) A Control unit which is used to control timing of operation and control the
units within the processor to ensure that operations are carried out in correct
order.
Functions of CPU
The function of CPU is to control and process all the operations of the memory and
I/O data in the system in accordance with the program.
The CPU also holds communication circuits and power supply.
The CPU executes the operating system manages memory, monitors inputs,
evaluates the user logic and turns gives appropriate outputs. In order to do this, the
PLC is provided with a clock signal to sequence its internal operations.
Buses
The internal paths used for communication within PLC are called Buses. These buses
essentially carry the information in the digital forms. There are four types of buses
required in a PLC.
i)
ii)
iii)

iv)

Data Buses- It is used for communicating data between elements.


Address Buses- It is used to read the address of locations for accessing
stored data.
Control Buses-It is used for internal control actions carried by the CPU.
Example: To inform Memory devices whether they are to receive data from
an input or output data
System Buses- It is used for communication between the input/output
ports and input/output unit.

2.Memory:
Memory devices are where the program are started in the controller or some groups
of binary digits of 1s and 0s stored in the form of bytes at individual locations
identified by their addressed. The memory of a PLC is divided into many sections
based on specific functions.
I)
II)

Sectors to store the status of inputs and outputs.


Sectors to store system information such as scan time, fault status, fault
codes and watchdog timers.

There are several memory elements in PLC system.


1.Random Access Memory:

RAM is used for users program and data storage. RAM is designed to store the
information on the status of input and output devices and the value of timers and
counters and other internal devices.
The data RAM is sometimes referred to as data table or register table. RAM is
volatile memory. It will lose its stored information when power is turned OFF.
2.Read Only Memory:
ROM is permanent storage used to store operating system and fixed data used by
the CPU. ROM is a not volatile memory normally, is designed so that the information
stored in the memory can only be read and cannot be changed. ROM can be
classified into three. They are:
a)Programmable Read Only Memory(PROM):
PROM is a special type of ROM and allows initial and/or additional information to be
written into chip and can written only once after being received from the
manufacturer.
b)Erasable and Programmable ROM(EPROM):
It is a programmable using a dedicated programmer. Information stored in the
EPROM can be erased by the use of ultraviolet light source and can be
reprogrammed and stored permanently.
c)Electrically EPROM(EEPROM):
Here the information stored can be erased with the electrical pulses rather than
ultraviolet light. The EEPROM can be electrically overwritten with new data. The
storage capacity of memory unit is determined by the number of binary words than
it can store. Thus if a memory size is 256 words than it can store 256*8=2048 bits if
8 bit words are used and 256*16=4096 bits if 16 bit words are used.
3.Input and Output Processing Devices
The input/output unit provides the interface between the system and the outside
world and allowing connections to be made through input/output channels to input
devices such as motors and solenoids. Every input/output channels also provide
isolation and signal conditioning functions so that sensors and actuators can often
by directly connect to them without the need for the other circuitry.

Optoisolator (Opto Coupler)


Electrical isolation from the external world is usually by means of optoisolators.
Principle

When a digital pulse passes through the light emitting diode, a pulse of infrared
radiations 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
5vds. However, signal conditioning in the input channel with isolation enables a
wide range of input signal to be supplied to it.
Common input voltage is 5v 24v and common output voltages are 24v and 240v.
Outputs are often specified as being of,
I)
II)
III)

Relay type
Transistor type
Triac type

1.Relay Type
Relay type of output is shown in the following fig 4.7

In Relay type the signal from the PLC output is used to operate a relay and so it able
to switch currents of the order of a few amperes in an external circuit.
The relay isolates the PLC from the external circuit and can be used for both d.c and
a.c switching. Relays are slow to operate.
2.Transistor Type
The transistor type of output used a transistor to switch current through the
external circuit. This gives a faster switching action.
The transistor type of output is shown in the following fig4.8.
Optoisolators are used with transistor switches to provide isolation between the
external circuit and the PLC. The transistor output is only for d.c switching.
The switching action of a transistor would requires base current which is enough for
the collector current to reach the maximum value, and the voltage drop will be very
small at this point.

3.Triac Type
The triac type output is used for switching AC voltages. A Triac device is used which
acts as a two-way SCR with one gate connected at the output unit.

The triac type output is shown in the following fig4.9

4.4 INPUT/OUTPUT PROCESSING


Processing of Input/Output is through the programming the PLC. The basic form of
programming commonly used with PLCs in Ladder Programming.
Ladder Programming involves each program task being specified as though a
Rung(A cross piece forming a step of Ladder) of a Ladder. Thus such a Rung could
specify that the state of switches A and B, the inputs, be examined and if A and B
are both closed then a solenoid, the output is energized.
The programming sequences followed by a PLC are,
Step 1: Scan the inputs associated with one Rung of the ladder program
Step 2: Solve the logic operation involving those inputs.
Step 3: Set/reset the outputs for the Rung.
Step 4: Move on to the next Rung and repeat operations in Step 1, 2 and 3.
Step 5: Move on to the next Rung and repeat operations in Step 1, 2 and 3.
And so on until the end of the program. Each rung of the ladder program is then
scanned in turn.
There are two methods that can be used for input/output processing.
i)
ii)

Continuous Updating
Mass input/output copying.

i)Continuous Updating:

Continuous updating involves the CPU scanning the input channels as they occur in
the program instructions. Here each input point is scanned individually and its effect
on the program is determined. Due to scanning built in delay may be occurred
about 3ms, when each input is examined in order to ensure that only valid input
signals are road by the microprocessor.
This delay enables the microprocessor to avoid counting as input signal twice, or
more frequently, if there is contact bounce at a switch.
Here the number of inputs may have to be scanned. Each with a 3ms delay, before
the program has the instruction for a logic operation to be executed and an output
to occur. The outputs are latched so that they retain their status until the next
updating.
ii)Mass Input/Output Copying:
In continuous updating, there has to be a 3ms delay on each input, the time taken
to examine several hundred input/output points can become comparatively long
time.
To avoid such a delay, the input/output is processing in a Mass Input/Output copying
method for a more rapid execution of a program.
In Mass Input/Output Copying method, a specific area of RAM is used as a buffer
store between the control logic and input/output unit. Each input/output has an
address in this memory.
At the start of each program cycle the CPU scan all the inputs and copies their
status into the input/output addresses in RAM.
As the program is executed the stored input data is Read, as required from RAM and
the logic Operations are carried out.
The resulting output signals are stored in the reserved input/output section of RAM.
At the end of each program cycle all the outputs are transferred from RAM to the
output channels. The outputs are latched so that they retain their status until the
next updating.
4.5 PROGRAMMING
The programming of PLC is based on the Ladder Diagram. Ladder diagram
involves writing a program in a similar manner to drawing a switching circuit.
The symbols used in ladder diagram are known as ladder symbols. Some of basic
symbols used in ladder diagram are given below

The Ladder Diagram consists of two vertical lines representing the power rails and
circuits are connected as horizontal lines i.e, the rungs of the ladder between these
two vertical lines.

In drawing the circuit line for a rung, input must always proceed output and there
must be at least one output on each line. Each rung must start with an input or a
series of inputs and end with an output.

The inputs and outputs are numbered, the notation used depending on the PLL
manufacturing.
Example 4.2 To illustrate the concepts of ladder diagram. Consider the following
logics

And the circuit i.e., inputs and outputs are connected horizontal. Hence the ladder
diagram describes the output A occurs when the input 1 occurs.

Here the ladder diagram describes the output A occurs when both the inputs 1 and
2 occurs.

Here the ladder diagram describes the output A when input 1 or input 2 occurs.
Example 4.3 To illustrate the drawing of a ladder diagram, consider a situation
where the output from the PLC is to energize a solenoid when a normally open start
switch connected to the input is activated by being closed.

Above circuit diagram gives the switch controlling a solenoid. Ladder diagram of the
circuit, starting with the input, we have the normally open symbol [II]. This might
have an input address X400. The line terminates with the output, the solenoid, with
the Symbol [0]. This might have the output address Y430. To indicate the end of the
program the end rung is marked. When the switch is closed the solenoid is
activated. Hence the ladder diagram of the circuit is give by

This might be an example of a solenoid valve which opens to allow water to enter a
vessel.

Example 4.4 Consider another example, ON-OFF temperature control in which the
input goes from low to high when the temperature sensor reaches the set
temperature, then the output goes from ON to OFF.

Here the temperature sensor i.e., thermistor is connected in a bridge arrangement


with output to an operational amplifier connected as a comparator. The program
shows the input as a normally closed pair of contacts. So it gives the ON signal and
hence an output is switched ON. When the contacts are opened to give the OFF
signal then the output is switched OFF.
Hence the ladder diagram can be drawn with a closed rung.

Depend on the sensor, the output will be ON or OFF, such ladder programs can be
entered from special keypads or selected from a monitor screen. They can also be
specified by using a mnemonic language. However they are entered, the programs
are then translated by the PLC into machine language for the benefit of the
Microprocessor and its associated elements.

4.5.1 Logic Functions


Logic is the ability of PLC to make decisions when more than one factor must be
taken into account before a device is operated.
The logic functions can be obtained by combinations of switches and following show
how we can write ladder programs for such combinations.
i)AND Functions
An AND function operates like a series circuit and works with two inputs to produce
a single output.
Consider a situation where a coil is not energized unless two, normally open,
switches are both closed. Switches A and B have both to be closed, which thus gives
an AND logic situation.

The ladder diagram starts with rung I I, labeled input A, to represent switch A and in
series with it another I I, labeled input B, to represent switch B. The line then
terminates with O to represent the output.
ii)OR Function:
The OR function has many inputs, but provides only one output. Here the output is
energized when either switch 1 or switch 2 are closed or both switch 1 and switch 2
are closed.

Consider a situation where a coil is not energized until either, normally open, switch
A or B is closed.

The Ladder diagram starts with I I, labeled input A, to represent switch A and
parallel with it I I, labeled input B, to represent switch B. The line then terminates
with O the output.
iii)NOT Function:
The NOT function will have one input and one output. It normally incorporates an NC
switch in series with the input. The output is ON when the switch is not closed and
output is OFF when the switch is closed. The NOT gate is sometimes known as
inverter gate.

iv)NOR function:
An OR function is inverted by the NOT function, then the output is known as NOR
function.
Since there has to be an output when neither A nor B have an input and when there
is an input to A or B the output ceases.

The ladder program shows input A in parallel with input B, with both being
represented by normally closed contacts.

v)NAND Function:
An NAND function is inverted by the NOT function, then the output is known as
NAND function. There is no output when both A and B have on input.

Thus for the ladder program line to obtain an output we require no inputs to input A
and to input B.

vi)EXCLUSIVE-OR(XOR) Function:
It is an OR functions with no output when there is no input to both the inputs s well
as there is an input to both the inputs.

The ladder program line for an XOR function, there being no output when there is no
input A to input B and when there is an input to both input A and input B. We have
represented each input by two sets of contacts, one normally open and one
normally closed.
Example 4.5 Consider a situation. i) Where a normally open switch A must be
activated and either of two other, normally open. Ii) Switches B and C must be
activated for a coil to be energized.
Solution:
We can represent this arrangement of switches as switch A in series with two
parallel switches B and C as shown below.

For the coil to be energized we required A to be closed and either B or C to be


closed. According to this, switch A when considered with the parallel switches give
an AND logic. The two parallel switches gives an OR logic.
Hence the possible combination of two gates with respect to three switches A,B and
C are given by the truth table.
Example 4.6 Consider the requirement for there to be an output to the solenoid
controlling the valve that will open a shop door when the shopkeeper has closed a
switch to open shop and a customer approaches the door and is detected by a
sensor which then gives a high signal.

The truth table for the given requirements is,

This truth table is that of an AND gate and thus the program for a PLC controlling
the door is given by,

4.5.2. LATCHING
A Ladder latch circuit facilitates to hold an output energized, even when the input
ceases. The term latch circuit is used for the circuit used to carry out such an
operation. The output coil maintains its status until a different condition occurs
which is used to reset the coil to OFF.
It is a self-maintaining circuit in that, after being energized, it maintains that state
until another input is received. It remembers its last state.
Example 4.7 Consider a latch circuit, when input energized and closes, there is an
output. However, when there is an output, a set of contacts associated with the
output is energized and closes.

These contacts OR the input 1 contacts. Thus, even if input contacts open, the
circuit will still maintain the output energized. The only way to release the output is
by operating the normally closed contact input 2.

Example 4.8 Consider the requirement for a PLC to control a Motor so that when the
start signal button is momentarily pressed the motor starts and when the stop
switch is used the motor switches OFF, signal lamps indicating when the motor is
OFF and when ON.

According to the requirements with no inputs, the signal lamp for the motor
indicates that it is OFF. The motor contacts which are normally closed have the OFF
lamp ON. When the start button is pressed, normally open contacts are closed and
the motor switched ON. This is latched ON by the motor contacts in parallel with the
start contacts.

Also other motor contacts which normally closed open and the OFF lamp goes OFF
and motor contacts which are normally open close and the ON lamp goes ON. The
motor is stopped by the stop switch which opens previously closed contacts.
4.5.3 SEQUENCING
Sequencing are often control situations where sequences of outputs are required
with the switch from one output to another being controlled by sensors.
Example 4.9 Consider the requirement for a Ladder program for a pneumatic
system with double solenoid valves controlling two double acting cylinders A and B
if limit switches a-, a+, b-, b+ are used to detect the limits of the piston rod
movements in the cylinders and the cylinder activation sequence A+,B+,A-,B- is
required.
A start switch input has been included in the first rung. Thus cylinder extension for
A, i.e., the solenoid A+, energized, only occurs when the start switch is closed and
the b- switch is closed. This switch indicating that the B cylinder is retracted.

When cylinder A is extended, the switch a+, which indicates the extension of A, is
activated. This then leads to an output to solenoid B+ which results in B extending.
This closes the switch indicating extension of B i.e., the b+ switch, and leads to the
output to solenoid A- and retraction of cylinder A. This retraction closes limit switch
a- and so gives the output to solenoid B- which results is B retracting.
This concludes the program cycle and leads to the first rung again, which awaits the
closure of the start switch before being repeated.

4.6 MNEMONICS

Each horizontal rung on the ladder in a ladder program represented a line in the
program and the entire ladder gives the complete program in Ladder Language.
The programmer can enter the program into the PLC using keyboard with the
graphic symbols for the ladder elements, and mouse is used to select symbols and
the computer translates these symbols into machine language than can be stored in
the PLC memory.
There is an alternative way entering the program and that is translate the ladder
program into mnemonics, each code corresponding to ladder element, and then
enter these into the programming panel or computer. These are then translated into
machine language. The mnemonics used by different PLC manufacturers differs.

Mnemonics form the instruction; the list of instruction forms the program of the
specific functions.
Instruction lists consists of a series of instruction with each instruction being on a
separate line. An instruction consist of an operator followed by one or more
operands i.e., the subjects of the operator.
Example: LD A
LD is the mnemonics i.e., operator for loading, the operand A.
List of instruction used to represent basic logic function
The following shows how individual rungs on a ladder are entered using the
mnemonics,

4.7 TIMERS, INTERNAL RELAY AND COUNTERS


Since, we discussed about, the task requiring the series and parallel connections of
input contact. However, there are tasks can involve time delays and event counting.
These requirements can be met by the timers and counter which are the features of
PLC.

The numbering system used for the functions varies from one PLC manufacturing to
another.
Example: For the Mitsubishi F series, the numbers are used are,
Timers

450-457, 8 points, delays-on period 0.1-999S.

550-557, 8 points, delays on period 0.1-999S.

Internal relay or

100-107,170-177,200-207,270-277,

Marker
M

128 points
300-307,370-377, battery backed, 64 points.

Counters

460-467, 8 points, 1 to 999

560-567, 8 points, 1 to 999

Point: The term point is used to indicate the data points of timing. Internal relay
(Markers) or counter element. Thus, the 16 points for timers mean that there are 16
timer circuits.
Delay-ON: The term delay-on is used to indicate that this type of timer waits for a
fixed delay period turning on.
In the given data, this period which can be set between 0.1 and 999S is steps of
0.1S.
4.7.1 TIMERS
A Timer circuit is specified by starting the interval to be timed and the conditions or
events that are to start and/or stop the timer.
They are commonly regarded as relays with coils which, when energized, result in
the closing or opening of input contacts after some preset timer.

When there is an input, the timer is energized and starts timing. After some preset
time the contacts associated with the timer close and the output occurs.
Timer can be linked together, using cascaded connection, to give larger delay times
than is possible with just one timer.

When the input contacts close, timer 1 is started. After its time delay, its contacts
close and timer 2 is started. After its time delay, its contacts close and there is an
output.

Example 4.10 Consider a Timer that can be programmed to cause an output to go


ON for 0.5s, then OFF for 0.5s, and so on.

When the input contacts close, Timer 1 is started and comes ON after 0.5s, this
being the time for which it was preset. After this time the Timer 1 contacts close and
start Timer 2.
It comes an after 0.5s, its preset time, and opens its contacts. This results in Timer 1
being switched OFF. This results in its contact opening and switching OFF Timer 1.
This then closes its contact and so starts the entire cycle again.
The result is that timer contacts for Timer 1 are switched ON for 0.5s, then OFF for
0.5s, ON for 0.5s, and so on. Thus the output is switched ON for 0.5s, then OFF for
0.5s, ON for 0.5s and so on.
Delay-OFF Timer:
A delay off timer is a timer which switches OFF an output after a timer delay from
being energized can be devised. When the input contacts are momentarily closed
the output energized and the timer started.

The output contacts latch the input and keep the output ON. After the preset timer,
the timer comes ON and break the latch circuit, and the output OFF.
4.7.2 INTERNAL RELAY (MARKER)
Most PLCs have an area of the memory allocated for internal storage that are used
to hold data, which behave like relays, being able to be switched ON or OFF but only
for internal purposes.

The internal relay or auxiliary relay or marker are behave like relays with their
associated contacts, but in reality are not actual relays but simulations by the
software of the PLC.
Internal relays are often used when there are programs with multiple input
conditions.
Internal relays can be very useful aids in the implementation of switching
sequences.
Internal relays are also used for the starting of multiple outputs.
An internal relay can be used to switch between groups of outputs to give the form
of control for pneumatic cylinders which is termed cascade control.
Example 4.11 Consider the situation where the excitation of on output depends on
two different input arrangements with internal relays.

The first rung shows one input arrangement being used to control the coil of internal
relay IR1.
The second rung shows the other input arrangement controlling the coil of internal
relay IR2.
The contacts of the two relays are then put in an OR situation to control the output.
An internal relay output is represented using the symbol of an output device with an
address to indicate an internal relay.
4.7.3 COUNTERS
Counters are used when there is a need to count a specified number of contact
operations.
Example: Where items pass along a conveyor into boxes, and when the specified
number of items has passed into a box and next item is divided into another box.

Counters allow a number of occurrences of input boxes, and when the specified
number of times some event occurs.
In most cases, the counter operates as a down-counter. This means that the counter
counts down from the present values to zero i.e., events are subtracted from the set
value. When zero is reached the counters contact changes state.
An up-counter would count up to the present value, i.e., events are added until the
number reaches the set value. When the set value is reached the counters contact
change state.
Example 4.12 Consider a basic counting program.

Here the counter is represented by a rectangle spanning two lines.


One line is the reset which is used to reset the counter.
Other line is the outline and the K 10 indicates that the counter contact of input 2
closing and opening. When this reaches the set value 10, the counter contact
closes.
Thus output is switched ON after 10 pulses have been from input 2. If the contacts
of input 1 are momentarily closed any time during the count, the counter will reset
to 10.
Example 4.13 Consider the problem of the control for a machine which is required
to direct 6 items along one path for packaging in a box, and then 12 items along
another path for packaging in another box.
As per the requirement we need two counters.
One preset to count 6
Other to count 12.
Here Input 1 momentarily closes its contact to start the counting cycle, resetting
both counters.
Input 2 contacts could be activated by a micro switch which is activated every time
an item passes upto the junction in the paths. Counter 1 counts 6 item and then
closes its contact. This activates the output, which might be a solenoid used to
activate a flap which closes one path and opens another. Counter 1 also has
contacts which close and enables counter 2 to start counting

When the counter 2 has counted 12 items it resets both the counters and opens the
counter 1 contacts which then results in the output becoming deactivated and items
no longer directed towards the box to contain 12 items.

4.8 SHIFT REGISTERS


Shift registers can be used here sequence of operations is required or it simulates
movement or it tracks the flow of parts and information.
A number of internal relays can be grouped together to form a register which can
provide a storage area for a series sequences of individual bits. Thus a 4-bit
register, would be formed by using four internal registers.
The term shift register is used because the bits can be shifted along by one bit when
there is a suitable input to the register.

Here all the bits shift along one place and the last bit overflows. The grouping
together of a number of auxiliary registers to forms a shift register is done
automatically by a PLC when the shift register function is selected at the control
panel.
Shift registers have three inputs:
One to load into the first element of the register(OUT),
One as the shift command (SFT)
One for resetting (RST)
OUT: A logic level 0 or 1 is loaded into the first element of the shift register.
SFT: A pulse moves the contents of the register along one bit at a time, the final bit
overflowing and being lost.
RST: A pulse of a closure of a contact resets the registers contents to all 0s.
Example 4.14 Consider a shift register.

In the ladder diagram, M140 has been designated as the first relay of the register.
When the X400 is switched ON, a logic 1 is loaded into the first element of the shift
register i.e., M140. The shift register is load with 1000 0000. This circuit shows that

each element of the shift register has been connected as a contact in the circuit.
Thus M140 contact closes and Y430 is switched ON.
When contact X401 is closed, then the bits in the register are shifted along the
register by one place to give 1100 00 00, a 1 being shifted into the register because
X400 is still ON.
Contact M141 thus closes and Y430 is switched ON. As each bit is shifted along the
outputs are energized in turn. Shift registers can thus be used to sequence events.
Common applications for shifts registers
Tracking parts through assembly line.
Controlling Machine operations.
Inventory Counter.
System diagnostics.
4.9 MASTER AND JUMP CONTROLS
A whole block of outputs can be simultaneously turned OFF or ON by using the
same internal relay contacts in each output rung so that switching it ON or OFF
affects every one of the rungs.
An alternative way or programming to achieve without affecting the other rungs are
with the use of Master relay.
It is often necessary to provide a means of executing sections of the control logic
when certain criteria are realized. They include instructions comprising the override
instructions.
Example 4.15 Consider the Master control reset instruction, programmer to the
control section of ladder.
When the Master start button is ON, the master control relays is ON and latched,
and thus output acts according to their rungs logic as usually followed in normal
cases.
When the master control relay(MCR) condition is false, the subsequent scan ignores
the inputs and de-energies all outputs. This means that all the rungs between where
it is designated to operate are switched OFF.
4.9.2 JUMPS
The jump instruction is an output instruction enabling part of a ladder program to be
jumped over.

With the jump instruction, the processor scan time can be reduced by jumping over
instructions not pertinent to the machine operation.
Example 4.16 Consider a Ladder diagram with jump instruction.

Program A rung is encountered with input 1 and the conditional jump relay CJP. If
input 1 occurs then the program jumps to the rung with the end of jump relay coil
EJP and so continuous with that section of the program labeled as C, otherwise it
continues with the program rungs labeled as program B.
4.10 DATA

Das könnte Ihnen auch gefallen