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

Module 3 Lesson 1

This document provides an overview of Module III which focuses on PLC programming. It discusses important programming methods and elements of PLCs. The module contains two lessons - the first lesson discusses programming methods like ladder logic, statement lists, and function block diagrams. The second lesson covers elements of PLCs like processing, memory, and input/output. The objectives are to learn how to program PLCs using different instructions, simulate and run programs, and understand how PLCs work. The document provides examples of ladder logic programming.

Uploaded by

Kurisuchan Wolf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Module 3 Lesson 1

This document provides an overview of Module III which focuses on PLC programming. It discusses important programming methods and elements of PLCs. The module contains two lessons - the first lesson discusses programming methods like ladder logic, statement lists, and function block diagrams. The second lesson covers elements of PLCs like processing, memory, and input/output. The objectives are to learn how to program PLCs using different instructions, simulate and run programs, and understand how PLCs work. The document provides examples of ladder logic programming.

Uploaded by

Kurisuchan Wolf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

51

MODULE III

PLC PROGRAMMING

LESSON 1 IMPORTANT PROGRAMMING


METHODS

LESSON 2 ELEMENTS OF PLC

EMTC 135 - Programmable Logic Controller Application -Module III-


52

MODULE III
PLC PROGRAMMING

 INTRODUCTION

In this module you will learn about the different PLC systems. PLC’s are like
computers which also consist of three functional areas: processing, memory, and
input/output. Input signals to the PLC are read and then stored in the memory,
where the processor performs the programmed logic instructions on these input
signals. Output signals are then generated to drive output devices. The action
taken depends totally on the program which is stored in the memory. In addition, a
programming unit is used to download the program to the PLC memory.

Learn to make programs for PLC. The user or the system designer is usually
the one who develops the control program. The control program is made up of things
called instructions. Instructions are little computer codes that make the inputs and
outputs do what you want to get the result you need.

OBJECTIVES

After reading the module, you should be able to:


1. Identify the different programming methods used in the PLC software
2. Translate and apply PLC instruction in a circuit.
3. Create a simple to complex plc program
4. Simulate and run the program
5. To conceptualized control processing, memory and input /output signals
6. To figure out power supply, input field devices, output field devices,
Central Processing Unit, memory and programming devices on the PLC
system.
7. To distinguish different accessories interfaced in the PLC system.

 DIRECTIONS/ MODULE ORGANIZER

There are two lessons in the module. Read and understand the lessons
carefully. Answer the exercises and activities given after each lesson then submit
your output to the concern instructor.
You may contact the concern faculty whenever problems arises regarding the
lesson and or discuss the matter with your instructor during face-to-face meeting.

EMTC 135 - Programmable Logic Controller Application -Module III-


53

Lesson 1

 PLC PROGRAMMING

A program consists of one or more instructions that accomplish a task.


Programming a PLC is simply constructing a set of instructions. There are several
ways to look at a program such as: These presentations are also known as
programming languages.

 ladder logic,
 statement lists, or
 function block diagrams.

Ladder diagram

Ladder logic (LAD) is one programming language used with PLCs. Ladder logic
uses components that resemble elements used in a line diagram format to describe
hard-wired control.

Ladder Logic

One of the best visual programming languages is a PLC programming language.


It’s called ladder logic or ladder diagram (LD) and you can learn it very fast.

The smart thing about ladder logic is that it looks very similar to electrical
relay circuits. So if you already know a little bit about relay control and electrical
circuits, you can learn ladder logic even faster.

Ladder logic (also known as ladder diagram or LD) is a programming language


used to program a PLC (Programmable Logic Controller). It is a graphical PLC
programming language which expresses logic operations with symbolic notation.
Ladder logic is made out of rungs of logic, forming what looks like a ladder – hence
the name ‘Ladder Logic’.

EMTC 135 - Programmable Logic Controller Application -Module III-


54

How to Read Ladder Logic

Another difference between ladder logic diagrams and electrical schematics


is the way they are drawn. Where electrical schematics are often drawn horizontal,
ladder logic diagrams are drawn vertically.

The best explanations for drawing ladder logic vertical instead of horizontal:

1. Easier to read

First of all, it makes ladder logic easier to read because it is natural for the
eye to go from the left to right and then down to the next line. Just like when you
are reading. Of course, this applies only to people living in countries where the
reading is done from left to right.

2. Drawn on computer

When you draw ladder logic on a computer you will make one line at a time.
As you draw more and more lines (in ladder logic called rungs) they will stack on top
of each other, making up what looks like a ladder. The best way to look at a large
ladder diagram with many lines is to scroll vertically along with the screen.

3. Order of execution

The last reason for drawing ladder logic vertically is to set the order of
execution. The order of execution is how the PLC will run your ladder logic. To be
more precise in what order your ladder logic instructions will be executed by the
PLC. A PLC will always start at the top of your ladder logic and then execute its way
down.

Ladder Logic

As I said before ladder diagrams can look a lot like electrical schematics going
vertical. Most people learn to draw ladder logic diagrams this way – by building them
as electrical schematics. But there are some differences. This is why I will advise
you to learn it in a different way.

I will explain this way in this ladder logic tutorial.

The problem here is that electrical control systems and the PLC work in different
ways. Here are the biggest differences:

• The PLC takes one ladder logic line (rung) and executes that and then goes to
the next line
• In electrical systems, multiple lines (current pathways) can be executed
(activated) at the same time

EMTC 135 - Programmable Logic Controller Application -Module III-


55

Ladder Logic Basics

The first thing you will see when you create a new piece of ladder logic is two
vertical lines. It is in between these two lines your ladder logic goes. When you draw
ladder logic, you will draw vertical connections between these two lines. Each of
those is called a rung. Just like on a physical ladder.

Examine if Closed

The first instruction here is called examine if closed. The symbol for the
instruction looks like this:

Examine if closed is also known as normally open. It works basically the same
way as a normally open contact in an electrical circuit. Of course, the normally open
contact has no memory bit as a condition. The condition is whether the contact is
activated or not. So the condition could be a finger pressing a button.

The main point here is that each instruction has to be assigned an address in
the PLC.

Yes, inputs and outputs are also bits of memory in the PLC. In the example
above, the examine if closed instruction has been given memory address I0.0 as a
condition. This address belongs to the first input of the PLC.

Here’s how that works:

• When the PLC scan cycle starts, the PLC will check the states of all its inputs.
• It will then write in memory the boolean value for these states (0 or 1).
• If an input is LOW the bit will be set to 0.
• And if the input is HIGH the memory bit will be set to 1.

Output Coil

The instruction itself even has a place in the PLC memory. What the PLC will
put there is the result of the instruction. To see what the PLC uses that result for,
we have to look at the next instruction:

EMTC 135 - Programmable Logic Controller Application -Module III-


56

An output coil is used to turn a bit on and off.

This symbol is placed on the right side of the rung. This means, that all the
instructions that come before (in the same rung) act as a condition for that
instruction.

Output Latch

In the previous example, you learned how to read the state of digital input
and set a digital output to the same state. Let’s say that digital input is a momentary
pushbutton. It is called momentary because it has a spring inside. This means, that
the pushbutton will only be active as long as you press it.

The ladder program above works just fine. But as you might have noticed, the
output will only be active as long as the input is active. You will have to hold your
finger on the button to keep the output activated. But let’s say that the output
controls a fan for a ventilation system. It would not be very convenient for the
operator to hold down the button all the time. We need a way to keep the output
active, even though the operator releases the pushbutton.

If you are familiar with electrical schematics, you may find this familiar. This
is called a latch or a self-hold.

The name reveals how this works. The coil simply holds itself. Let’s take it
step-by-step to see how that works:

When the PLC runs this ladder logic program the first time (with the button
pressed), the output will be activated. This is just like the example before. The fun
happens the second or third time the PLC runs the ladder logic. Since this is a
momentary pushbutton, it will not be active for long. Depending on how long time

EMTC 135 - Programmable Logic Controller Application -Module III-


57

the PLC takes to execute the program, the button might be deactivated again the
second, third or fourth time.

Let’s jump forward to the first scan cycle where the button is no longer
pressed.

The output is still active since the pushbutton was pressed in the last scan
cycle.

The reason that the self-holding instruction is put in parallel to the other
instruction is to make it an OR condition. I will come back to that later. Important
to know here is that either I0.0 OR Q0.0 has to be true to activate the output.

Examine if Open

Well, congratulations!

You just learned how to make a functioning ladder PLC program. A pushbutton
that activates an output. In our example, this would be connected to a contactor
giving supply to a fan. The output then holds itself.

But there is a practical problem with this program. How do we stop the fan?

We want, somehow to be able to turn off the output again. The simplest way
to do that would be to add a stop button. The button will be connected to the second
input. Thereby giving it the memory address I0.1.

The question is now; which instruction should we use for the stop button?

And even more important; where should we place it in our ladder logic?

To answer the first question, let me introduce you to another ladder logic
instruction: examine if open.

Here’s how the examine if open symbol looks like:

EMTC 135 - Programmable Logic Controller Application -Module III-


58

This instruction works the exact opposite way of the examine if closed
instruction. The result of this instruction will be an inverted condition. It simply
means that, if the condition is “0” the result will be “1”. Vice versa of course, so
with condition “1” the result will be “0”.
If you think about it, this is precisely how we want to stop button to work. To turn
off the output coil we must somehow give it the condition “0”.

Now to the second question. Where to place it?

We have to place it after the self-holding instruction. Said in another way –


serial connected. Otherwise, the latch would still give a “1” condition to the output
coil when stop button is pressed.

Now, we end up with this ladder logic:

You can see that it inverts the condition to the output coil. This will break
the latch. To activate the latch again, the start button has to be pressed.

In the example above I used the examine if open instruction for a stop button.

Logic instructions (Statement List)

 A statement list (STL) provides another view of a set of instructions. The


operation, what is to be done, is shown on the left. The operand, the item
to be operated on by the operation, is shown on the right.
 A comparison between the statement list shown below, and the ladder logic
shown on the previous page, reveals a similar structure. The set of
instructions in this statement list perform the same task as the ladder
diagram.

Network 1
LD I0.1
O Q0.4
A I0.3
= Q0.4

EMTC 135 - Programmable Logic Controller Application -Module III-


59

Function Block Diagram

 Function Block Diagrams (FBD) provide another view of a set of instructions.


Each function has a name to designate its specific task. Functions are
indicated by a rectangle.
 Inputs are shown on the left-hand side of the rectangle and outputs are
shown on the right-hand side. The function block diagram shown below
performs the same function as shown by the ladder diagram and statement
list.

THINK!

Design a Ladder Logic for a Start-Stop Control System. Start


button address is I0.0, stop button address is I0.1, and Coil
address is Q0.0

EMTC 135 - Programmable Logic Controller Application -Module III-

You might also like