Вы находитесь на странице: 1из 45

Software Training

CHAPTER 1

INTRODUCTION TO P.L.C

Automation

The word Automation is drived from greek words Auto (self) and Matos (moving).

Definition:- Automation is a set of technologies that result in operation of machines

and system without significant human intervention and achieves performance

superior to manual operation

Types of Automation

Two common types of automation are feedback control, which is usually continuous

and involves taking measurement using sensors and making calculated adjustments to

keep the measured variables within a set range, and sequence control, in which a

programmed sequence of discrete operations is performed, often based on system logic.

Feedback control is called closed loop while non-feedback control is called open

loop.

Manual Control

All the actions related to process are control taken by operators.

Pneumatic control

Industrial automation with it machines and process control, had its orign in 1920 with

the advent of pneumatic system. Actions were controlled by a simplest manipulation of

pneumatic valves which in turn controlled by relay and switches.

1
Software Training

Hard wired logic control

The contactor and relays together with hard wire timer and counters were used to

achieving the desired level of automation.

Electronic and control logic using logic gates

In 1960s the advent of electronics, logics gates started replacing relays and auxiliary

contactor in control circuit. The hardware timer and counters are replaced by electronics

timer counters.

Programmable Logic Controller

In 1970s with the coming microprocessor and associated peripheral chips, the whole

process control and automation underwent a radical change. Instead of achieving the

desired control or automation through a physical wiring of control devices is controlled

by PLC through a program or software. The PLC in recent year experienced in an under

unprecedented growth as industrial automation. It can be effectively used in an

application ranging from simple control.

Advantages of Automation

Increased through output and productivity.

Improved quality and increased predictability of quality.


Increased consistency of output.

Reduced direct human labor cost and expense.

Reduce the cycle time

High degree of accuracy

2
Software Training

Disadvantages of Automation

Causing unemployment and poverty by replacing human labor.

Security threats/vulnerability: an automated system may have a limited level of

intelligence, and is therefore more susceptible to committing errors outside of

its immediate scope of knowledge.

Unpredictable/excessive development cost: the research and development cost

of automating a process may exceed the cost saved by the automation itself.

In manufacturing, purpose of automation has shifted to issue broader than

productivity, cost, and time.

PROGRAMMEBLE LOGIC CONTROLLER (PLC)

Programmable logic controllers, also called programmable controllers or PLCs, are

solid-state members of the computer family, using integrated circuits instead of electro

mechanical devices to implement control functions. They are capable of storing

instructions, such as sequencing, timing, counting, arithmetic, data manipulation, and

communication, to control industrial machines and processes.

Many technological advances in the programmable controller industry continue today.

These advances not only affect programmable controller design, but also the

philosophical approach to control system architecture. Changes include both hardware

(physical components) and software (control program) upgrades. The following list

describes some recent PLC hardware enhancements:

3
Software Training

Faster scan times are being achieved using new, advanced microprocessor and

electronic technology.

Small, low-cost PLCs, which can replace four to ten relays, now have more

power than their predecessor, the simple relay replacer.

High-density input/output (I/O) systems provide space-efficient interfaces at low

cost.

Intelligent, microprocessor-based I/O interfaces have expanded distributed

processing.

Special interfaces have allowed certain devices to be connected directly to the

controller. Typical interfaces include thermocouples, strain gauges, and

fastresponse inputs.

These families consist of a product line that ranges from very small microcontrollers,

with as few as 10 I/O points, to very large and sophisticated PLCs, with as many as

8,000 I/O points and 128,000 words of memory.

Allen-Bradleys programmable controller family PLCs.

4
Software Training

control systems, providing production reports, scheduling production, and diagnosing

their own failures and those of the machine or process. These enhancements have made

programmable controllers important contributors in meeting todays demands for higher

quality and productivity. Despite the fact that programmable controllers have become

much more sophisticated, they still retain the simplicity and ease of operation that was

intended in their original design.

PRINCIPLES OF OPERATION

A programmable controller, as illustrated in Figure, consists of two basic sections:

The central processing unit

The input/output interface system

Programmable controller block diagram.

The central processing unit (CPU) governs all PLC activities. The following three

components, form the CPU:

The processor

The memory system

The system power supply

5
Software Training

Block diagram of major CPU components

The operation of a programmable controller is relatively simple. The input/ output (I/O)

system is physically connected to the field devices that are encountered in the machine

or that are used in the control of a process. These field devices may be discrete or analog

input/output devices, such as limit switches, pressure transducers, push buttons, motor

starters, solenoids, etc.

TYPICAL AREAS OF PLC APPLICATIONS

Since its inception, the PLC has been successfully applied in virtually every segment of

industry, including steel mills, paper plants, food-processing plants, chemical plants,

and power plants. PLCs perform a great variety of control tasks, from repetitive

ON/OFF control of simple machines to sophisticated manufacturing and process

control.

PLC PRODUCT APPLICATION RANGES

This chart is not definitive, but for practical purposes, it is valid. The PLC market can

be segmented into five groups:

1. micro PLCs

6
Software Training

2. small PLCs

3. medium PLCs

4. large PLCs

5. very large PLCs (Rack type)

CHAPTER 2

HARDWARE INTRODUCTION

HARDWARE INTRODUCTION

Basic Components of a PLC System

There are five basic components in a PLC system:

The PLC processor, or controller

I/O (Input /Output) modules

Chassis or backplane

Power supply

Programming software that runs in a PC In addition to these 5, most PLCs also have:

A network interface

7
Software Training

PLC block diagram

The Central Processing Unit

The central processing unit, or CPU, is the most important element of a PLC. The CPU

forms what can be considered to be the brain of the system. The three components of

the CPU are:

the processor

the memory system

the power supply

Fig. illustrates a simplified block diagram of a CPU. CPU architecture may differ from

one manufacturer to another, but in general, most CPUs follow this typical

threecomponent organization. Although this diagram shows the power supply inside the

CPU block enclosure, the power supply may be a separate unit that is mounted next to

the block enclosure containing the processor and memory.

8
Software Training

PROCESSORS

Stores the control program and data in its memory


Reads the status of connected input devices

Executes the control program

Commands connected outputs to change state based on program execution. For

example: Turn a light on, start a fan, adjust a speed, or temperature

Comes in various physical forms

THE SYSTEM POWER SUPPLY

The system power supply plays a major role in the total system operation. In fact, it can

be considered the first-line manager of system reliability and integrity. Its

responsibility is not only to provide internal DC voltages to the system components (i.e.,

processor, memory, and input/output interfaces), but also to monitor and regulate the

supplied voltages and warn the CPU if something is wrong. The power supply, then, has

9
Software Training

the function of supplying well-regulated power and protection for other system

components.

Usually, PLC power supplies require input from an AC power source however, some

PLCs will accept a DC power source. Those that will accept a DC source are quite

appealing for applications such as offshore drilling operations, where DC sources are

commonly used. Most PLCs, however, require a 120 VAC or 220 VAC power source,

while a few controllers will accept 24 VDC.

The sensing section

This section consists of limit switches, photoelectric sensors, push buttons etc. These

incoming hardware devices provides input signal to the PLC. These devices are also

called as field input devices. The term field input" is used because this device provides

incoming signals that are tangible items that you physically connect to PLC.

Input section

This section is majorly divided into 2 parts:

First, the physical screw terminals, where incoming signal (i.e. input), from the

field input devices (e.g. limit switch) are connected to the PLC.

The second portion of the input section is the PLC's internal conversion

electronics. This section converts and isolates the high-voltage input level from

field input devices. High-voltage signals from field input devices are converted

to +5 volts direct current (VDC) for a valid ON input signal, and a 0 VDC for a

valid OFF input signal. Incoming signal conversion and isolation is necessary

because microprocessor components operate on +5 VDC, whereas an input

10
Software Training

signal may be of 24 VDC, 120 volts alternating current (VAC), or 220 VDC. If

120 VAC signal is inputted, for example, into 5 VDC, circuit will quickly

destroy your PLC.

Programmer

The programmer is a device used by the programmer or operator to enter or edit

program instructions or data. The programmer can be handheld unit, a personal

computer, or an industrial computer programming terminal.

Output section

The ON or OFF status of the inputs are read and the information is used to solve

the user ladder program and the updated signals is sent to the output section. The

output section is simply a series of switches, one for each output point, that are

controlled by CPU and are used to turn output field devices ON or OFF.

Field hardware devices

The devices that are controlled by the PLC's output section screw terminals are the

field hardware devices.

Fixed and modular PLC hardware

There are two types of physical configurations, fixed and modular.

In a fixed PLC, all of its components like, the input section, power supply, CPU

and associated memory and output section - is built into one self - contained unit.

11
Software Training

All the input and output screw terminals are built into the PLC package and are

fixed, which cannot be moved i.e. not removable. This type of PLC is also called

as a packaged controller.

The modular PLC comes as separate pieces. All the parts of modular PLC are

purchased separately i.e. piece by piece. Its like customizing , we may have 2

or 3 power supplies to choose from , a handful of different processors(CPU's) ,

many separate input modules , many separate output modules and a selection of

assemblies , called racks , chassis , or baseplates to hold the pieces together .

PLC inputs

Source and sink inputs

The term sourcesink refers to the direction of current flow into or out of the input

terminals of the PLC.

Source input

When the PLC is connected for source inputs, then the input signal current flows into

the X inputs

12
Software Training

Sink input

When the PLC is connected for source inputs, then the input signal current flows into

the X inputs

PLC outputs

There are three different types of output for PLCs, these are:

1. Relay.

2. Triac (solid-state relay SSR).

3. Transistor.

13
Software Training

Relay

This is the most commonly used type of output. The coils and the contacts of the output

relays enable electrical isolation to be obtained between the internal PLC circuitry and

the external output circuitry. Dependent on a number of factors, i.e. the supply voltage,

the type of load, i.e. resistive, inductive or lamp, the contact life, the maximum-switched

current per individual output is 2 A. The PLC will provide groups of 4, 8 or 16 outputs

each with a common. The commons are logically numbered COM1, COM2, etc. and

are electrically isolated from one another. connected

miniature relays to remain energized.

Triac

The TRIAC is an AC switch, which basically consists of two thyristors connected back

to back. Since the TRIAC output is solid state, the lifetime of a TRIAC output is far

longer than that of the relay output. The voltage range of these devices is 85240V AC

and each output can switch up to a maximum of 0.35 A. As with all other output

configurations, the physical output is isolated by a photo coupler. The response of the

TRIAC when turning ON is faster than the Relay, i.e. 1 msec but the OFF times are

identical, i.e. 10 msec

Transistor

The transistor outputs are used, where a very fast switching time is required. The

switching time of the transistor outputs, whether they are Sink or Source outputs, is <0:2

msec with a 24V DC, 100mA load.

14
Software Training

CHAPTER 3

PROGRAMMING INTRODUCTION

PROGRAMMING LANGUAGES IN PLC

Instruction List (IL)

15
Software Training

Structured Text (ST)

Sequential Function Chart (SFC)

Function Block Diagram (FBD)

The Continuous Function Chart Editor (CFC)

Ladder Diagram (LD)

LADDER DIAGRAMS AND THE PLC

Ladder logic is the main programming method used for PLCs. As mentioned before,

ladder logic has been developed to mimic relay logic. The decision to use the relay logic

diagrams was a strategic one. By selecting ladder logic as the main programming

method, the amount of retraining needed for engineers and tradespeople was greatly

reduced.

The ladder diagram has and continues to be the traditional way of representing electrical

sequences of operations. These diagrams 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 a predetermined sequence of events. Figure: illustrates a simple

electrical ladder diagram.

16
Software Training

Simple electrical and ladder diagram.

The original ladder diagrams were established to represent hardwired logic circuits used

to control machines or equipment. Due to wide industry use, they became a standard

way of communicating control information from the designers to the users of equipment.

it was easy to use and interpret and was widely accepted in industry. Note that 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 programmable controller. As previously

mentioned.

IN PLCS

Programmable controller contacts and electromechanical relay contacts operate in a very

similar fashion. For example, lets take relay which has two sets of contacts, one

normally open contact (A-1) and one normally closed contact (A-2). If relay coil A is

17
Software Training

not energized (i.e., it is OFF), contact A-1 will remain open and contact A-2 will remain

closed. Conversely, if coil A is energized, or turned ON, contact A-1 ill close and contact

A-2 will open. The blue lines highlighting the coil and contacts denote an ON, or closed,

condition.

Standard configuration for relay coil A with normally open contact A-1 and normally closed contact A-2.

Coil A de-energized. Coil A energized.

Remember that when a set of contacts closes, it provides power flow, or continuity, in

the circuit where it is used. Each set of available coils and its respective contacts in the

PLC have a unique

18
Software Training

reference address by which they are identified. For instance, coil 10 will have normally

open and normally closed contacts with the same address (10) as the coil. Note that a

PLC can have as many normally open and normally closed contacts as desired; whereas

in an electromechanical relay, only a fixed number of contacts are available.

Definition and Symbol Interpretation

Normally open contact.

Represents any input to the control logic. An input can be a connected switch closure or

sensor, a contact from a connected output, or a contact from an internal output. When

interpreted, the referenced input or output is examined for an ON condition. If its status

is 1, the contact will close and allow current to flow through the contact. If the status of

the referenced input/output is 0, the contact will remain open, prohibiting current from

flowing through the contact.

Normally closed contact.

Represents any input to the control logic. An input can be a connected switch closure or

sensor, a contact from a connected output, or a contact from an internal output. When

interpreted, the referenced input/output is examined for an OFF condition. If its status

is 0, the contact will remain closed, thus allowing current to flow through the contact. If

the status of the referenced input/output is 1, the contact will open, prohibiting current

from flowing through the contact.

19
Software Training

Output

Represents any output that is driven by some combination of input logic. An output can

be a connected device or an internal output. If any left-to-right path of input conditions

is TRUE (all contacts closed), the referenced output is energized (turned ON).

NOT output.

Represents any output that is driven by some combination of input logic. An output can

be a connected device or an internal output. If any left-to-right path of input conditions

is TRUE (all contacts closed), the referenced output is de-energized (turned OFF).

LOGIC FUNCTIONS

The binary concept shows how physical quantities (binary variables) that can exist in

one of two states can be represented as 1 or 0. Now, you will see how statements that

combine two or more of these binary variables can result in either a TRUE or FALSE

condition, represented by 1 and 0. Operations performed by digital equipment, such as

programmable controllers, are based on three fundamental logic functionsAND, OR,

and NOT. Each function has a rule that determines the statement outcome (TRUE or

FALSE) and a symbol that represents it.

20
Software Training

THE AND FUNCTION

Figure shows a symbol called an AND gate, which is used to graphically represent the

AND function. The AND output is TRUE (1) only if all inputs are TRUE (1).

Two-input AND gate and its truth table

AND gate with a ladder diagram rung

THE OR FUNCTION

Figure shows the OR gate symbol used to graphically represent the OR function. The

OR output is TRUE (1) if one or more inputs are TRUE (1).

21
Software Training

. Two-input OR gate and its truth table.

OR gate ladder diagram

THE NOT FUNCTION

Figure illustrates the NOT symbol, which is used to graphically represent the NOT

function. The NOT output is TRUE (1) if the input is FALSE (0). Conversely, if the

output is FALSE (0), the input is TRUE (1). The result of the NOT operation is always

the inverse of the input; therefore, it is sometimes called an inverter

22
Software Training

NOT gate and its truth table.

(a) NOT circuit (b) NOT logic with a ladder rung (c) high output when no input to A

Latching in PLC programming

There are often situations where it is necessary to hold an output energized, even when

the input ceases. A simple example of such a situation is a motor, which is started by

pressing a push button switch. Though the switch contacts do not remain closed, the

motor is required to continue running until a stop push button switch is pressed. The

term latch circuit is used for the circuit used to carry out such an operation. It is a self-

maintaining circuit in that, after being energized, it maintains that state until another

input is received.

23
Software Training

An example of a latch circuit is shown in Figure. When the input A contacts close, there

is an output. However, when there is an output, another set of contacts associated

Latched circuit

with the output closes. These contacts form an OR logic gate system with the input

contacts. Thus, even if the input A opens, the circuit will stillmaintain the output

energized.

The only way to release the output is by operating the normally closed contact B. As an

illustration of the application of a latching circuit, consider a motor controlled by stop

and start push button switches and for which one signal light must be illuminated when

the power is applied to the motor and another when it is not applied. shows the ladder

diagram with Mitsubishi notation for the addresses.

24
Software Training

Motor on-off, with signal lamps, ladder diagram.

Note that the stop contacts X401 are shown as being programmed as open. If the stop

switch used is normally closed then X401 receives a start-up signal to close. This gives

a safer operation than programming X401 as normally closed.

Flag or Memory or Internal Relays


Inputs are used to set outputs in simple programs. More complex programs also use

internal memory locations that are not inputs or outputs. These are sometimes referred

to as internal relays or control relays. Knowledgeable programmers will often refer

to these as bit memory. These have the same properties as outputs but they only exist

in software. They have many uses.

Triggers in PLC
In electronics, a signal edge is a transition in a digital signal either from low to high (1

to 0).

25
Software Training

It is called an edge because the square wave which represents a signal has edges at

those points. It is used to generate a pulse. It generate a pulse of 1/10*6 (0.000001) usec.

Rising edge trigger

A rising edge is the transition from low to high. It is also named positive edge. When a

circuit is rising edge triggered, it becomes active when its clock signal goes from low to

high, and ignores the high-to-low transition.

Falling edge trigger

A falling edge is a high to low transition.it is also known as negative edge. When a

circuit is falling edge triggered, it becomes active when clock signal goes from high to

low, and ignores low to high transition.

26
Software Training

Timers in PLC

Timers are used in applications to add a specific amount of delay to an output in the

program. Applications of PLC timers are innumerable, since they have completely

replaced hardware timers in automated control systems. As an example, timers may be

used to introduce a 0.01 second delay in a control program. The program may require

such a delay because the PLC turns ON its outputs very quickly as compared to the

hardwired relay system it is replacing. This small delay will slow down the response of

other components so that proper operation occurs.

The time base is the resolution, or accuracy, of the timer. For instance, if a timer must

time a 10 second event, the user must choose the number of times the time base must be

counted to get to 10 seconds.

Required Time Number of Ticks Time Base (secs)

10 sec 10 1

10 sec 100 0.1

1000 0.01

Note: Required time = (# of ticks)(Time base) Table:-Time


bases.

ON-DELAY ENERGIZE TIMER

An ON-delay energize timer (TON) output instruction either provides time delayed

action or measures the duration for which some event occurs. Once the rung has

27
Software Training

continuity, the timer begins counting time-based intervals (ticks) and counts down until

the accumulated time equals the preset time. When these two values are equal, the timer

energizes the output and closes the timed out contact associated with the output. The

timed contact can be used throughout the program as either a normally open or normally

closed contact. If logic continuity is lost before the timer times out, the timer resets the

accumulated register to zero.

ON-DELAY DE-ENERGIZE TIMER

An ON-delay de-energize timer (TON) instruction operates in a manner similar to an

ON-delay energize timer instruction, except that the timers output is already ON. This

instruction de-energizes the output once the rung has continuity and the time interval

has elapsed (accumulated register value = preset register value). PLC manufacturers

provide either ON-delay energize or ON-delay de-energize timers, since it is easy to

program one from the other. Fig, illustrates a timing diagram for both types of ON-delay

timer instructions.

28
Software Training

Timing diagram for (a) an ON-delay energize timer and (b) an ON-delay de-energize timer.

OFF-DELAY ENERGIZE TIMER

An OFF-delay energize timer (TOF) output instruction provides time delayed action. If

the control line rung does not have continuity, the timer begins counting time-based

intervals until the accumulated time value equals the programmed preset value. When

these values are equal, the timer energizes the output and closes the timed-out contact

associated with the output. The timed contact can be used throughout the program as

either a normally open or normally closed contact. If logic continuity occurs before the

timer times out, the accumulated value resets to zero.

OFF-delay energized timer instruction.

29
Software Training

OFF-DELAY DE-ENERGIZE TIMER

OFF-delay de-energize timer (TOF) instruction is similar to its OFF-delay energize

counterpart; however, this timers output is ON and will be de-energized once the rung

loses continuity and the time interval has elapsed (accumulated register value = preset

register value). Like ON-delay timers, PLC manufacturers usually provide either

OFFdelay energize or de-energize timers. Fig, shows timing diagrams for both types of

OFFdelay timers.

Timing diagram for (a) an OFF-delay energize timer and an OFF-delay de-energize timer.

RETENTIVE ON-DELAY TIMER

A retentive ON-delay timer (RTO) output instruction is used if the timers accumulated

value must be retained even if logic continuity or system power is lost. If any rung path

30
Software Training

has logic continuity, the timer begins counting time based intervals until the

accumulated time equals the preset value. The accumulated register retains this

accumulated value, even if power or logic continuity is lost before the timer has timed

out. When the accumulated time equals the preset time, the timer energizes the output

and turns ON (closes) the timed-out contact associated with the output. Again, these

timer contacts can be used throughout the program as normally open or normally closed

contacts. A retentive timer reset instruction resets a retentive timers accumulated value.

RETENTIVE TIMER RESET

A retentive timer reset (RTR) output instruction is the only way to automatically reset

the accumulated value of a retentive timer. If any rung path has logic continuity, then

this instruction resets the accumulated value of its referenced retentive timer to zero.

Note that the retentive timer reset address will be the same as the retentive timer output

instruction it is resetting.

Example:-Lets write a ladder logic program to control a card operated door lock. The

lock is disengaged (unlocked) by switching ON a solenoid. The solenoid is activated

using two switches: (a) from outside the room door, the signal to activate the solenoid

comes from the Number-Pad, if the correct sequence of code numbers is pressed; (b)

From inside the room door, there is just a simple push button, which can be used to

disengage the lock. Upon activation, the door stays unlocked for 5 seconds, and then

locks again.

The ladder logic program is shown below:

31
Software Training

I:0/1 Number Pad Signal to open door from outside the room
I:0/2 Push Button signal to open door from inside the room
O:0/1 Solenoid to unlock door

COUNTER IN PLC

Counter instructions are used to count events, such as parts passing on a conveyor, the

number of times a solenoid is turned ON, etc. Counters, along with timers, must have

two values, a preset value and an accumulated value. These values are stored in register

or word locations in the data table. The preset value is the target number of ticks or

counting numbers that must be achieved before the timer or counter turns its output ON.

The accumulated value is the current number of ticks (timer) or counts (counter) that

have elapsed during the timer or counter operation. The preset value is stored in a preset

register, while the accumulated value is kept in an accumulated

UP COUNTER (CTU)

An up counter (CTU) output instruction adds a count, in increments of one, every time

its referenced event occurs. In a control application, this counter turns a device ON or

OFF after reaching a certain count (i.e., the p in the preset register). Also, this counter

32
Software Training

can keep track of the number of parts (e.g., filled bottles, machined parts, etc.) that pass

a certain point. An up counter increases its accumulated value (the count value in its

accumulated register) each time the up-count event makes an OFF-to-ON transition.

When the accumulated value reaches the preset value, the counter turns ON the output,

finishes the count, and closes the contact associated with the referenced output. After

the counter reaches the preset value, it either resets its accumulated register to zero or

continues its count for each OFF-to-ON transition, depending on the controller. In the

latter case, a reset instruction is used to clear the accumulated value.

DOWN COUNTER (CTD)

A down counter (CTD) output instruction decreases the count value in its accumulated

register by one every time a certain event occurs. In practical use, a down counter is

used in conjunction with an up counter to form an up/down counter, given that both

counters have the same reference registers. In an up/down counter, the down counter

provides a way to correct data that is input by the up counter.

33
Software Training

COUNTER RESET

A counter reset (CTR) output instruction resets up counter and down counter

accumulated values to zero. When programmed, a counter reset coil has the same

reference address as the corresponding up/down counter coils. If the counter reset rung

condition is TRUE, the reset instruction will clear the referenced address. The reset line

in a block format counter instruction sets the accumulated count to zero (accumulated

register = 0).

I:0/0 Conveyor ON,I:0/1 Photo switch,I:0/2 Operator controlled Push Button to restart conveyor
,O:0/1 Conveyor belt,O:0/2 Light Indicator

ARITHMETIC INSTRUCTIONS

Arithmetic instructions in a PLC include the basic four operations of addition,

subtraction, multiplication, and division. In addition to these four math functions, large

34
Software Training

PLCs may also include square root operations. Like other instructions, arithmetic

instructions may be in either the basic ladder format or the functional block format;

however, operation in either format is essentially the same. Most arithmetic instructions

require three reference registers, which define the two operand registers and the

destination register of the operation. Some instructions, such as multiplication and

division, may use four registers.

ADDITION IN PLC

An addition (ADD) functional block adds two values stored within the controller and

places the sum in a specified register. The operand values can be fixed constants, values

contained in I/O or holding registers, or variable numbers stored in any memory

location. Figure illustrates a typical addition functional block.

Ladder format addition.

If A closes, the contents of register X and register Y are added and stored in register Z.

If A does not close, no addition is performed. If contact A was omitted, the addition

would be performed in every scan.

35
Software Training

SUBTRACTION IN PLC

The subtraction(SUB) functional block, as in the ladder format subtraction instruction,

finds the difference between two values and stores the result in a register.

Block for subtraction

The control input in a subtraction block operates the same way as in an addition block.

When the rung condition is logic 1, the controller performs the block operation. Three

registers hold the data during the operation. The values that these registers can hold vary

in format and may or may not include a sign bit.

MULTIPLICATION IN PLC

A multiplication (MUL) ladder instruction multiplies the values from two operand

registers. It then uses two other registers to hold the result of the multiplication. The

reason why the result is held in two registers is that, normally, the product of two 4-digit

numbers is an 8-digit number. Some controllers provide two adjacent registers in which

to store the result. One or two output coils reference the two result registers in a

multiplication instruction, depending on the PLC. GET instructions access the operand

registers

36
Software Training

Ladder format multiplication instruction.

DIVISION IN PLC

A division (DIV) functional block finds the quotient of two numbers, storing the result

in one or more registers. Fig:-illustrates this type of functional block. The division

calculation begins after the control rung has continuity. Register 1000 (the dividend) is

divided by the contents of register 1001 (the divisor), and the result is stored in two

contiguous destination registers.

Division functional

MOVE INSTRUCTION IN PLC

A move (MOV) functional block instruction transfers information from one location to

another, with the destination location being a single bit or register.

37
Software Training

Move register functional blocks.


Some PLCs perform a move function to special word table locations. In this case, the

PLC automatically converts the copied data to the proper numerical format for the

destination location.

CHAPTER 4

SOME PROGRAMS

Software Used for Practice - Logix Pro by Allen Bradley

1:- Make progam for:-

I0 I1 Q0 Q1
0 0 1 1
0 1 0 1
1 0 0 1
1 1 1 0

38
Software Training

2:- Make progam for:-

I0 I1 I2 Q0 Q1 Q2
1 1 0 1 0 1
1 0 1 1 1 1

39
Software Training

3:- Make progam for:-


I0 I1 I2 I3 Q0 Q2 Q3
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 0 1 1 0 1 1

40
Software Training

4: Door simulator

Parameters

Open I:1/00, Close-I:1/01, Stop-I:1/02,Ajar-O:2/02 , Open-O:2/03,Shut-O:2/04,

Motor Up-O:2/00,Motor Down-O:2/04,LS1-I:1/03,LS2-I:1/04

41
Software Training

Make this program with the help of memory bit, latch and Timer on

42
Software Training

Make this program by counter

Make this program with counter

43
Software Training

5:- Silo simulator

44
Software Training

Start-I:1/00(NO), Stop-I:1/01, Run-O:2/02,Fill-O:2/03, Full-O:2/04,Solenoid

Value-O:2/01(NC),Level Sensor-I:1/04(NO),Proxy Sensor-I:/03(NO),MotorO:2/00

45

Вам также может понравиться