PLC Basicsand Ladder Programming-2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 86

PROGRAMMABLE LOGIC

CONTROLLER (PLC)
Programmable Logic Controller

A PROGRAMMABLE LOGIC CONTROLLER is a solid state control


system that continuously monitors the status of devices connected as
inputs. Based upon a user written program, stored in memory, it controls
the status of devices connected as outputs.
Definition Of PLC
A digital electronic device that uses a programmable memory to
store instructions and to implement specific functions such as
logic, sequence, timing, counting and arithmetic to control
machines and process.
It uses a programmable memory to store the instructions and
specific functions that include On/Off control, timing counting,
sequencing, arithmetic and data handling.
A PLC is a computer designed to work in an industrial
environment.
Areas of Application
PLC HARDWARE
PLC HARDWARE
PLC HARDWARE

Provides the voltage needed to run the primary PLC components.


PLCs are usually powered directly from 120 or 240 Vac. The power supply
converts the AC into DC voltages for the internal microprocessor components. It
may also provide the user with a source of reduced voltage to drive switches,
small relays, indicator lamps, and the like.

The processor is a microprocessor-based CPU and is the part of the PLC that is
capable of reading and executing the program instructions, one-by-one (such as
the rungs of a ladder logic program).
PLC HARDWARE
Program Memory:

The program memory receives and holds the downloaded program instructions
from the programming device. If this memory is standard RAM, the program
will be lost every time the power is turned off. To avoid this the program
memory may use an EEPROM (electrically erasable programmable ROM) or a
battery-backup RAM, both of which are capable of retaining data even when the
power is off.

Data Memory:

Data memory is RAM memory used as a “scratch pad” by the processor to


temporarily store internal and external program-generated data.
PLC HARDWARE

Used to enter the desired program that will determine the sequence of
operation and control of process equipment or driven machine.

PLC Bus :

The PLC bus are the wires in the backplane of a PLC modular system,
which contains the data bus, address bus, and control signals. The processor
uses the bus to communicate with the modules.
PLC HARDWARE
I/O Modules :

 The I/O interface section of a PLC connects it to external field devices.


 The main purpose of the I/O interface is to condition the various signals
received from or sent to the external input and output devices.
 Input modules converts signals from discrete or analog input devices to logic
levels acceptable to PLC’s processor.
 Output modules converts signal from the processor to levels capable of
driving the connected discrete or analog output devices.
PLC Input Module Circuits :
PLC Output Module Circuits :
PLC Analog I/O Modules :
PLC Operation
PLC Operation

Basic Function of a Typical PLC


 Read all field input devices via the input interfaces,
 Execute the user program stored in application memory,
 Then, based on whatever control scheme has been
programmed by the user, turn the field output devices on or off,
or perform whatever control is necessary for the process
application.
This process of sequentially reading the inputs, executing the
program in memory, and updating the outputs is known as
scanning.
PLC Operation

While the PLC is running, the scanning process includes the


following four phases, which are repeated continuously as
individual cycles of operation:
TYPES OF PLCs

Modular PLC (S-7 1500) Compact PLC (S-7 1200)


PLC PROGRAMMING LANGUAGE

• Ladder programming.
• Functional block diagram.
• SFC(sequential functional chart).
• CFC(continuous functional chart).
• Instruction list.
LADDER PROGRAMMING
BIT INSTRUCTIONS
DATA FILES
PLC ADDRESSING
Syntax:
• Input – I 0.0
Data file Bit no
Byte no
• Bit no can be vary from (0-7)
• Byte no can be vary from (0-255)

ADDRESSING
•For input (I0.0 ,I0.1……….)
•For output (Q0.0, Q0.1,…..)
•For memory (M0.0, M0.1,….)
DATA TYPES
Example:-

When the start button is pressed, motor M will be


ON. Simultaneously, V1 is on, V2 is OFF.

-When L1 on, V1 will off and V2 is ON .

-When L2 is ON, V2 will be OFF .


Solution:-
Example:-
Two conveyers
• When start PB is pressed, conveyer 2 starts
immediately and conveyer 1 starts after 10 sec.
• When stop PB is pressed, conveyer 1 stops
immediately and conveyer 2 stops after 5 sec.
Solution:-
Example:- Solution:-
Programming Counters
Up counter
Down counter
Up - down counter

CTU (Up counter)


CTD (Down counter)

CTUD (UP-Down counter)


Example:-

Write a program to turn RED light ON and GREEN


light OFF (initially GREEN light ON) after an
accumulated count of 7.
PARTS COUNTING PROGRAM
Counter C5:2 counts the total
number of parts coming off an
assembly line for final packaging

Each package must contain 10 parts


When 10 parts are detected, counter C5:1 sets bit B3/1 to initiate
the box closing sequence

Counter C5:3 counts the total number of packages filled per day
A pushbutton is used to restart the total part and package count from
zero daily
Ladder Diagram - Parts counting program

10
9
15

10
59

1
Draw the ladder rungs to represent the following:-

1. Either of the two, normally open, switches has to be closed for


a coil to be energized and operate an actuator.
2. A motor is switched ON by pressing a spring return push
button start switch, and the motor remains on until another
spring return push button stop switch is pressed.
3. A solenoid valve is to be activated if sensor A gives an input.
4. A lamp is to be switched ON if there is an input from sensor A
or sensor B.
CONTINUOUS FILLING OPERATION
The Sequence of operation for the continuous filling operation is as follows:-

1. Start the conveyor when the start button is


momentarily pressed.
2. Stop the conveyor when stop button is
momentarily pressed.
3. Energize the run status light when the process
is operating.
4. Energize the standby light when the process
is stopped.
5. Stop the conveyor when the right edge of the
box is first sensed by the photo sensor.
6. With the box in position and the conveyor
stopped, open the solenoid valve and allow
the box to fill. Filling should stop when the
level sensor goes true.
7. Energize the full light when the box is full.
The full light should remain energized until t
he box is moved clear of the photo sensor.
Ladder Diagram - CONTINUOUS FILLING
OPERATION
MIXING OPERATION
The Sequence of operation is as follows:-

1. Normally open start and normally closed stop pushbuttons are used to start and stop
the process.
2. When the start button is pressed, solenoid A
energized to start filling the tank.
3. As the tank fills, the empty level sensor
Switch closes.
4. When the tank is full, the full level sensor switch closes.
5. Solenoid A is de-energized.
6. The agitate motor starts automatically and runs for
3 min to mix the liquid.
7. When the agitate motor stops, solenoid B is
Energized to empty the tank.
8. When the tank is completely empty, the empty
Sensor switch opens to de-energize solenoid B.
9. The start button is pressed to repeat the
sequence.
CAR PARKING GARAGE

Write a ladder Program to count the cars that


enter and leave a parking garage. Capacity of
the parking garage is 150.
LADDER DIAGRAM - CAR PARKING GARAGE
Traffic Light System
The times sequence of the
lights is:

Red – 30s on
Green – 25s on
Amber – 5s on

The sequence then repeats


itself.
Traffic Light System
The times sequence of the lights is:

Red – 30s on
Green – 25s on
Amber – 5s on

The sequence then


repeats itself.
Write a ladder Program for a 24-h clock to
display the time of day.
Ladder Diagram
for a 24-h clock
to
display the time
of day.
Sequencer Instruction
Circuit/Wiring Diagram
Car Washing Process
Ladder Diagram
for
Car Washing
Process
ADVANCED INSTRUCTIONS
DATA TRANSFER INSTRUCTION- MOVE

Use the Move instructions to copy data elements to a new memory


address and convert from one data type to another. The source data
is not changed by the move process.
DATA COMPARE INSTRUCTIONS

Compares two values of the same data type. When the LAD
contact comparison is TRUE, then the contact is activated.
MATH / ARITHMETIC INSTRUCTIONS

Performs Mathematical Operations on words in memory.

When enabled (EN = 1), the math instruction performs the specified operation on
the input values (IN1 and IN2) and stores the result in the memory address
specified by the output parameter (OUT). After the successful completion of the
operation, the instruction sets ENO = 1.
MATH / ARITHMETIC INSTRUCTIONS
LOGICAL INSTRUCTIONS

Performs logical operations such as AND, OR, XOR, NOT etc.

The corresponding bit values of IN1 and IN2 are combined to


produce a binary logic result at parameter OUT. ENO is always
TRUE following the execution of these instructions.
LOGICAL INSTRUCTIONS

INVERT INSTRUCTION
Calculates the binary one's complement of the parameter IN. The one's
complement is formed by inverting each bit value of the IN parameter (changing
each 0 to 1 and each 1 to 0). ENO is always TRUE following the execution of
this instruction.
Write a program to create variable preset timer
values using a two-position selector switch.
Ladder Diagram – Variable Timer
Write a program to create variable preset counter
values using a two-position selector switch.
Ladder Diagram – Variable Counter
Timer Program implemented using an equal (Data
Compare) instruction
Application of ADD and Data compare instruction.
IN-PROCESS MONITORING SYSTEM

Before start-up, the system is


completely empty of parts, and the
counter is reset manually to zero.

When the operation begins, raw parts move through the in-feed sensor, with
each part generating an up count.

After processing, finished parts appearing at the out-feed sensor generate down
counts, so the accumulated count of the counter continuously indicates the number
of in-process parts.
IN-PROCESS MONITORING SYSTEM

58

8
5
COUNTER SPEED

The maximum speed of transitions you can count is


determined by your program's scan time. Any counter
input signal must be fixed for one scan time to be counted
reliably.

If the input changes faster than one scan


period, the count value will become
unreliable because counts will be missed.
When this is the case you need to use a
high-speed counter.
CASCADING COUNTERS

Depending on the application, it


may be necessary to count events
that exceed the maximum number
allowable per counter instruction.
One way of accomplishing this is by
interconnection, or cascading, two
counters.
Counting Beyond The Maximum Count

The output of the


first counter is
programmed into
the input of the
The status second counter
bits of both
counters are
These two
programmed
counters allow
in series to
twice as many
produce an
counts to be
output
measured
Combining Counter And Timer Functions
When the start button is pressed,
conveyor M1 begins running.

After 15 plates have been


stacked, conveyor M1 stops and
conveyor M2 begins running.

After conveyor M2 has been


operated for 5 s, it stops and the
sequence is repeated
automatically.

The done bit of the timer resets


the timer and counter, and
Automatic Stacking Process provides a momentary pulse to
automatically restart conveyor
M1.
Automatic Stacking
Program

You might also like