Lecture 3’s sequence
3.1 Program Scan
3.2 PLC Programming Languages
3.3 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
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 ladder logic rung instructions based on the rung
condition preceding the instruction (rung-condition-in).
3.1. Program Scan
Scan process applied to a single rung program.
3.1. Program Scan
Scan process applied to a
multiple rung 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 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
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 like 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 functions.
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 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
3.3. Relay Type 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. Relay Type Instructions
The Normally Open Contact instruction looks and
operates like a normally open relay contact.
3.3. Relay Type Instructions
The Normally Closed Contact instruction looks and
operates like a normally closed relay contact.
3.3. Relay Type Instructions
The Coil instruction looks and
operates like a relay coil.
Coil instruction is set to
1 to energize the
output.
A true logic path is
established by the input
instructions in the rung.
3.3. Relay Type 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. Relay Type 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.
Lecture 3’s sequence
3.1 Program Scan
3.2 PLC Programming Languages
3.3 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
3.4. Branch Instructions
Branch instructions are used to create parallel paths of input condition
instructions (OR logic).
Parallel branches can be used to allow more than one combination of
input conditions.
The rung will be true
if either instruction A
or B is true.
3.4. Branch Instructions
Output branching allows a true logic path to control multiple outputs.
Either A or B provides a true logical path to
all three output instructions: C, D, and E.
Additional input instructions can be
programmed in the output branches.
3.4. Branch Instructions
Input and output branches can be nested to avoid redundant instructions
and to speed up processor scan time.
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.
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 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
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.
Lecture 3’s sequence
3.1 Program Scan
3.2 PLC Programming Languages
3.3 Relay Type Instructions
3.4 Branch Instructions
3.5 Internal Relay Instructions
3.6
0 Examples
3.6. Examples
Example 1: Conveyor Motor
STOP button: Normally Close (NC)
START button: Normally Open (NO)
Proximity switch : Normally Close (NC)