Emtc 135 Module 3
Emtc 135 Module 3
MODULE III
PLC PROGRAMMING
MODULE III
PLC PROGRAMMING
INTRODUCTI
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.
OBJECTIV
ES
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.
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.
3
PLC PROGRAMMING
ladder logic,
statement lists, or
function block diagrams.
Ladder diagram
Ladder Logic
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.
with symbolic notation. Ladder logic is made out of rungs of logic, forming
what looks like a ladder – hence the name ‘Ladder Logic’.
1. Easier to read
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
The problem here is that electrical control systems and the PLC work in
different ways. Here are the biggest differences:
5
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
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
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.
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.
6
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:
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.
7
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 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.
Examine if Open
Well, congratulations!
The question is now; which instruction should we use for the stop
button?
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.
Network 1
LD I0.1
OR Q0.4
ANDN I0.3
ST Q0.4
THIN
Lesson 2
ELEMENTS OF PLC
I/O modules are devices with connection terminals to which the field
devices are wired.
Together, the rack and the I/O modules form the interface between
the field devices and the PLC. When set up properly, each I/O
module is both securely wired to its corresponding field devices and
securely installed in a slot in the rack. This creates the physical
connection between the field equipment and the PLC. In some small
PLCs, the rack and the I/O modules come prepackaged as one unit.
Example
13
An overhead light fixture and its corresponding wall switch are good
examples of everyday inputs and outputs. The wall switch is an input – it
provides a signal for the light to turn on. The overhead light is an output -
it waits until the switch sends a signal before it turns on.
Input Devices
Output devices
14
Discrete devices are inputs and outputs that have only two states:
on and off. As a result, they send/receive simple signals to/from a
PLC. These signals consist of only 1s and 0s. A 1 means that the
device is on and a 0 means that the device is off.
Analog devices are inputs and outputs that can have an infinite
number of states. These devices can not only be on and off, but
they can also be barely on, almost totally on, not quite off, etc.
These devices send/receive complex signals to/from a PLC. Their
communications consist of a variety of signals, not just 1s and 0s.
Discrete Inputs
15
While PLCs are powerful devices, they can’t always speak the
“language” of every device connected to them. That’s where the I/O
modules we talked about earlier come in. The modules act as
“translators” between the field devices and the PLC. They ensure that
the PLC and the field devices all get the information they need in a
language that they can understand.
17
Using Transducers
Position, level, temperature, pressure, flow and speed are just some
of the measurements that analog devices can provide to a control system.
You are probably asking yourself: “How does pressure, which is a physical
quantity, become an electrical signal?” That is a great question! The
conversion is done using transducers. A transducer will take a physical
quantity like pressure and convert it to an electrical signal. A lot of
transducers use the physical quantity to control the resistance in the
electrical circuit. For example, an RTD (Resistance Temperature Detector)
will change its resistance value based on heat. As heat increases so does
the resistance in the circuit, altering the supplied voltage or current. Same
holds true for pressure transducers that use strain gauges. As pressure is
applied to the strain gauge, the resistance in the circuit goes up and the
voltage or current level changes. Some flow detectors will use the flow of
a fluid to push a fin that is connected to a rotary potentiometer. Faster
flow equals more resistance change. One of the coolest transducers that I
ran across in my days working in the offshore oil industry was the sand
detector. This transducer was acoustic and was attached to pipes that
were drawing oil out from the sea floor. It would actually listen for sand
rubbing against the inside of the pipe. The amount of sound was
converted into an analog signal used to alert personnel if the drilling was
drawing out too much sand, which could collapse the well. The electrical
signals that transducers provide can be voltage or current based. 4 to
20mA, 0 to 20mA, 0 to 10VDC and -10 to +10 VDC are a few of the
available ranges produced by transducers. The PLC supplies the voltage or
current and the transducer will return a value in its configured range. That
value will be proportional to the amount of pressure, flow, etc. that is
present. We now arrive at two important parts of this discussion: scaling
and resolution.
The memory system is the section of the CPU that stores both the
control program and data from the equipment connected to the PLC.
Soft wiring makes changes in the control system easy and cheap. If
you want a device in a PLC system to behave differently or to control a
different process element, all you have to do is change the control
program.
Example:
Let’s say that two push buttons, PB1 and PB2, are connected to a
PLC. Two pilot lights, PL1 and PL2, are also connected to the PLC.
The way these devices are connected, pressing push button PB1
turns on pilot light PL1 and pressing push button PB2 turns on pilot
light PL2.
Let’s say that you want to change this around so that PB1 controls
PL2 and PB2 controls PL1.
In a traditional system, you would have to rewire the circuit so that
the wiring from the first push button goes to the second pilot light
and vice versa. However, because these devices are connected to a
PLC, making this change is as simple as making a small change in
the control program.
Scan Time
address tells where you live in your city, a device or piece of data’s
address tells where information about it resides in the PLC’s
memory. That way, if a PLC wants to find out information about a
field device, it knows to look in its corresponding address location.
Some addresses contain information about the status of particular
field devices. Other addresses store data that’s the result of control
program computations. Still others contain reference data entered
by the system programmer.
Nonetheless, no matter what type of data it is, a PLC uses its
addressing scheme to keep track of it all. That way, it’ll have the
right data when it needs it.
PLC Address
All PLCs follow the basic rules of operation we’ve just discussed. All
PLCs have a CPU and an input/output system. They also all use a
control program, instructions, and addressing to make the
equipment in the control system do what it’s supposed to do.
And no matter how many bells and whistles you add to it, every PLC
does the same three things: (1) examines its input devices, (2)
executes its control program, and (3) updates its output devices
accordingly.
So in reality, understanding PLCs is as simple as 1-2-3!
Software
Hardware
Memory Size
RAM
Random Access Memory (RAM) is memory where data can be
directly accessed at any address. Data can be written to and read
from RAM. RAM is used as a temporary storage area.
RAM is volatile, meaning that the data stored in RAM will be lost if
power is lost. A battery backup is required to avoid losing data in
the event of a power loss.
ROM
Read Only Memory (ROM) is a type of memory that data can be read
from but not written to. This type of memory is used to protect data
or programs from accidental erasure.
ROM memory is nonvolatile. This means a user program will not lose
data during a loss of electrical power. ROM is normally used to store
the programs that define the capabilities of the PLC.
EPROM
Firmware
Program space
Program space stores the ladder logic (LAD) or statement list (STL)
program instructions.
This area of memory controls the way data space and I/O points are
used. LAD or STL instructions are written using a programming
device such as a PC, then loaded into program memory of the PLC.
Data space
Putting it Together!
Creating or changing a
program
In order to create or
change a program, the
following items are
needed:
PLC
Programming
Device
Programming
Software
Connector Cable
THIN
MODULE
SUMMARY
In module III, The PLC System. You have learned about PLC control
systems, the different programming methods, and how the PLC process
signals its instructions.
There are two lessons in Module III. Lesson 1 discussed PLC
Programming and how to read ladder logic.
Lesson 2 deals with different elements of PLC: Central Processing
Unit (CPU), Input / Output Devices, Memory System, Software, and
Hardware.
SUMMATIVE
TEST
______________________________________________
______________________________________________
______________________________________________
______________________________________________