0% found this document useful (0 votes)
10 views

Chapter 3 - Basics of PLC Programming

Uploaded by

Quyết Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Chapter 3 - Basics of PLC Programming

Uploaded by

Quyết Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Lecture 3’s sequence

3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.1. Program scan

▪ During each program scan cycle, the processor reads all the inputs, takes
these values, and energizes or de-energizes the outputs according to the
user program
3.1. Program scan

▪ The time it takes to complete a scan cycle is a measure of how fast the
controller can react to changes in inputs

▪ If a controller must react to an input


signal that changes states twice during
the scan time, it is possible that the PLC
will never be able to detect this change

▪ The scan time is a function of:


❑ The speed of the processor module
❑ The length of the ladder program
❑ The type of instructions executed
❑ The actual ladder true/false conditions
3.1. Program scan

▪ Overview of the data flow during the scan process


3.1. Program scan

▪ The controller evaluates logic rung base on the rung conditions preceding
the output instruction (rung-condition-in)
3.1. Program scan

▪ Scan process applied to a program


3.1. Program scan

▪ Vertical versus horizontal scan patterns

Horizontal scanning order


Vertical scanning order
Lecture 3’s sequence
3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.2. PLC programming languages

▪ PLC programming language refers to the method by which the user


communicates information to the PLC

Standard IEC 61131 languages associated with PLC programming


3.2. PLC programming languages

▪ Ladder diagram language is the most used PLC language and is designed
to mimic hardwired relay logic

Hardwired relay control circuit Equivalent ladder diagram program


3.2. PLC programming languages

▪ Functional block diagram


programming uses instructions
that are programmed as blocks
wired together to accomplish
certain functions
3.2. PLC programming languages

▪ Ladder diagram and functional block diagram programming used to


produce the same logical output

Ladder diagram

Equivalent function block diagram


3.2. PLC programming languages

▪ Sequential function chart (SFC)


programming language is similar
to a flowchart of your process

The program is split into steps with


multiple operations happening in
parallel branches
3.2. PLC programming languages

▪ Instruction list programming language consists of a series of instructions


that refer to the basic AND, OR, and NOT logic gate function

Equivalent instruction
Hardwired relay control circuit
list program
3.2. PLC programming languages

▪ Structured text is a high-level language primarily used to implement


more complex procedures that cannot be easily expressed with
graphical languages

Ladder diagram

Equivalent structured text program


Lecture 3’s sequence
3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.3. Bit-level logic instructions

▪ The ladder diagram language is a symbolic set of instructions used to


create the controller program

Representations of contacts and coils are the basic


symbols of the logic ladder diagram instruction set
3.3. Bit-level logic instructions

▪ Addressing format
3.3. Bit-level logic instructions

▪ The Normally Open Contact instruction looks and operates


like a normally open relay contact
3.3. Bit-level logic instructions

▪ The Normally Closed Contact instruction looks and


operates like a normally closed relay contact.
3.3. Bit-level logic instructions

▪ The Coil instruction looks and operates like


a relay coil
3.3. Bit-level logic instructions

▪ Action of the field device and PLC bit


A signal present makes the NO
bit (1) true; a signal absent
makes the NO bit (0) false. The
reverse is true for an NC bit.
3.3. Bit-level logic instructions

▪ The main function of the ladder logic diagram program is to control


outputs based on input conditions
Each contact or coil symbol is referenced with an address that identifies what is being
evaluated and what is being controlled

The same contact instruction can


be used throughout the program
whenever that condition needs to
be evaluated

Not place the same addressed Coil


instruction on multiple rungs
within the same program
3.3. Bit-level logic instructions

▪ For an output to be activated or energized, at least one left-to-right true


logical path must exist

A complete closed path is referred


to as having logical continuity

When logical continuity exists


in at least one path, the rung
condition and Coil instruction
are said to be true
3.3. Bit-level logic instructions

The logic states (0 or 1) indicate whether an


instruction is true or false and is the basis of
controller operation.
3.3. Bit-level logic instructions

The time aspect relates to the repeated scans


of the program, wherein the input table is
updated with the most current status bits.
Lecture 3’s sequence
3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.4. Branch instructions

▪ Branch instructions are used to create parallel paths of input condition


instructions (OR logic)

The rung will be true


if either instruction A
or B is true.
3.4. Branch instructions

▪ Input branching by formation of parallel branches can be used in your


application program to allow more than one combination of input
conditions.

Either A and not B, or C provides logical continuity and energizes output D.


3.4. Branch instructions

▪ Output branching allows a true logic path to control multiple outputs.

Additional input instructions can be


programmed in the output branches

Either A or B provides a true logical path to


all three output instructions: C, D, and E
3.4. Branch instructions

▪ Input and output branches can be nested to avoid redundant instructions


and to speed up processor scan time

A nested branch starts or


ends within another branch
3.4. Branch instructions

In some PLC models, the programming of


a nested branch cannot be done directly

It is possible, however, to program a


logically equivalent branching condition
3.4. Branch instructions

▪ There may be limitations


to the number of series
contact instructions that
can be included in one
rung of a ladder diagram
as well as limitations to
the number of parallel
branches.
3.4. Branch instructions

The PLC will not allow for programming


of vertical contacts
Reprogrammed to eliminate
vertical contact
3.4. Branch instructions

The processor examines the ladder logic rung


for logic continuity from left to right only
If programmed as shown, contact
combination FDBC would be ignored

Reprogrammed circuit
Lecture 3’s sequence
3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.5. Internal relay instructions

▪ Internal relay used for a program that requires more series contacts than
the rung allows
This PLC allows for only 7
series contacts when 12
are required for the
programmed logic
3.5. Internal relay instructions

▪ Example 1: Conveyor Motor


▪ When START button pressed
▪ MOTOR will be started
▪ RUN indication lamp will be activated
▪ MOTOR running, so box will start move
▪ PROXIMITY sensor will detect when the box
arrives at other end
▪ MOTOR will be stopped
▪ RUN indication lamp will be de-activated
▪ STOP indication lamp will be activated
▪ An EMERGENCY STOP push button will be used
to stop the motor at any time
3.5. Internal relay instructions

▪ Example 1: Conveyor Motor


3.5. Internal relay instructions

▪ Example 2: Continuous Filling Operation


▪ STOP Switch : Normally Close (NC)

▪ START Switch : Normally Open (NO)

▪ Proximity Switch : Normally Open (NO)

▪ Level Switch : Normally Open (NO)


3.5. Internal relay instructions

▪ Example 2: Water Level Control


▪ Auto: Pump will be logically controlled based on Low Level Switch and High Level Switch
▪ Manual: Pump will be controlled manually using ON/OFF button in Local Control Panel
❑ When the water level reaches low level
then pump will be stopped.
❑ If the level of the water reaches high point,
the pump will started so that the water can
be drained and thus lowering the level.

▪ Indication:
❑ If pump is running then the Pump Running
status lamp will be ON.
❑ If Low Level Switch activated then Low Level
Status lamp will be ON.
❑ If High Level Switch activated then High Level
Status lamp will be ON.
3.5. Internal relay instructions

▪ Example 2: Water Level Control


3.5. Internal relay instructions

▪ Example 2: Water Level Control


3.5. Internal relay instructions

▪ Example 2: Water Level Control


3.5. Internal relay instructions

▪ Example 3: Water Level Control


❑ We use PLC system at filling station, which reject the fallen bottle
from the conveyor & clear the path for the next process.

❑ We use pneumatic piston


cylinder assembly for
pushing the fallen bottles
from the conveyor.

❑ There are two sensors are


used, for standing and fallen
bottles detection, one
pneumatic cylinder for
pushing the fallen bottle
from the conveyor.
3.5. Internal relay instructions

▪ Example 3: Water Level Control


Lecture 3’s sequence
3.1 Program Scan

3.2 PLC Programming Languages

3.3 Bit-Level Logic Instructions

3.4 Branch Instructions

3.5 Internal Relay Instructions

0 Modes Of Operation
3.6
3.6. Modes of operation

▪ A processor has basically two modes of operation: the program mode


and some variation of the run mode.

A three-position keyswitch may be


used to select different processor
modes of operation.
3.6. Modes of operation

▪ The program mode is used to enter a new program,


edit or update an existing program, upload files and
download files, document (print out) programs, or
change any software configuration file in the program.
▪ The run mode is used to execute the user program.
▪ The test mode is used to operate or monitor the user
program without energizing any outputs.
▪ The remote position allows the PLC to be remotely
changed between program and run mode by a
personal computer connected to the PLC processor.
Exercise1

Problem 1:
▪ When the water level goes below low level
(TLB 2) then feeding valve (MV1) will turned
ON automatically

▪ When water level reaches high and the it


senses by high level sensor (TLB 1), then
discharging process (MV2) will be turned ON
automatically.

▪ When high level is detected then buzzer will


turn ON for alarm purpose.

▪ Cycle will stop if user will press stop button


from the control panel.

You might also like