0% found this document useful (0 votes)
19 views27 pages

Lecture 4

The document outlines the fundamentals of Programmable Logic Controllers (PLCs) and their operation based on binary logic, including the functions of AND, OR, and NOT gates. It explains how to construct circuits from Boolean expressions, convert relay ladder schematics to ladder logic programs, and develop PLC programs for logical operations. Additionally, it introduces the concept of latching circuits for maintaining output states in specific applications.
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)
19 views27 pages

Lecture 4

The document outlines the fundamentals of Programmable Logic Controllers (PLCs) and their operation based on binary logic, including the functions of AND, OR, and NOT gates. It explains how to construct circuits from Boolean expressions, convert relay ladder schematics to ladder logic programs, and develop PLC programs for logical operations. Additionally, it introduces the concept of latching circuits for maintaining output states in specific applications.
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/ 27

University of Baghdad

Al-Khwarizmi College of Engineering


Mechatronics Engineering Department

Programmable Logic Controllers


Asst. Lecturer: Oger Z. Amanuel
References:

• Book of programmable logic controllers by Frank Petruzella

• Book of programmable logic controllers by W. Bolton


Fundamentals of Logic
Contents
• Describe the binary concept and the functions of gates

• Draw the logic symbol, construct a truth table, and state the Boolean equation for the AND,
OR, and NOT functions

• Construct circuits from Boolean expressions and derive Boolean equations for given logic
circuits

• Convert relay ladder schematics to ladder logic programs

• Develop elementary programs based on logic gate functions

• Program instructions that perform logical operations

• Describe the operation of an electromagnetic latching relay and the PLC-programmed


LATCH/UNLATCH instruction.
The PLC, like all digital equipment, operates on the binary principle. The term binary
principle refers to the idea that many things can be thought of as existing in only one of two
states. These states are 1 and 0. The 1 and 0 can represent ON or OFF, open or closed, true or
false, high or low, or any other two conditions.
The key to the speed and accuracy with which binary information can be processed is that
there are only two states, each of which is distinctly different. There is no in-between state so
when information is processed the outcome is either yes or no.

Logic is the ability to make decisions when one or more different factors must be taken into
account before an action is taken. This is the basis for the operation of the PLC, where it is
required for a device to operate when certain conditions have been met. the outcome and a
symbol that represents the operation. For the purpose of this discussion, the outcome or
output is called Y and the signal inputs are called A, B, C, and so on. Also, binary 1 represents
the presence of a signal or the occurrence of some event, and binary 0 represents the absence
of the signal or nonoccurrence of the event.
The AND Function

An AND gate is a device with two or more inputs and one output. The AND gate output is 1 only if all
inputs are 1.
The OR Function

An OR gate can have any number of inputs but only one output. The OR gate output is 1 if one or
more inputs are 1.
Hardwired circuit of AND gate Hardwired circuit of OR gate
The NOT Function

Unlike the AND and OR functions, the NOT function can have only one input. The NOT output is 1 if
the input is 0. The output is 0 if the input is 1. The result of the NOT operation is always the inverse of
the input, and the NOT function is, therefore, called an inverter.

Hardwired circuit of NOT gate


The NOT symbol placed at the output of an AND gate would invert the normal output result. An AND
gate with an inverted output is called a NAND gate. The NAND function is often used in integrated
circuit logic arrays and can be used in programmable controllers to solve complex logic.
The same rule about inverting the normal output result applies if a NOT symbol is placed at the output of
the OR gate. The normal output is inverted, and the function is referred to as a NOR gate.
PLC digital systems may be designed using Boolean algebra. Circuit functions are represented by
Boolean equations. Logic operators are used in combination to form Boolean equations.
An understanding of the technique of writing simplified Boolean equations for complex logical
statements is a useful tool when creating PLC control programs. Some laws of Boolean algebra are
different from those of ordinary algebra.

The Boolean expression 𝑌 = 𝐴𝐵 + 𝐶. The procedure is as follows:


Boolean expression: 𝑌 = 𝐴𝐵 + 𝐶
Gates required: (by inspection)
1 - AND gate with input A and B
1 - OR gate with input C and output from previous AND gate
The Boolean expression 𝑌 = 𝐴(𝐵𝐶 + 𝐷). The procedure is as follows:
Boolean expression: 𝑌 = 𝐴(𝐵𝐶 + 𝐷)
Gates required: (by inspection)
1 - AND gate with input B and C
1 - OR gate with inputs B, C, and D
1 - AND gate with inputs A and the output from the OR gate
Write the Boolean equations for the logic circuits below:
Because the PLC uses ladder logic diagrams, the conversion from any existing relay logic to
programmed logic is simplified. Each rung is a combination of input conditions (symbols) connected
from left to right, with the symbol that represents the output at the far right. The symbols that represent
the inputs are connected in series, parallel, or some combination of the two to obtain the desired logic.
The following group of examples illustrates the relationship between the relay ladder schematic, the
ladder logic program, and the equivalent logic gate circuit.
Most PLCs provide word-level logic instructions as part of their instruction set. If you want to:

Know when matching bits in two different words are both ON use AND instruction.

Know when one or both matching bits in two different words are ON use OR instruction.

Know when one or the other bit of matching bits in two different words is ON use XOR instruction.

Reverse the state of bits in a word use NOT instruction.


Word-level AND instruction

The operation of the AND instruction to


perform a word-level AND operation using
the bits in the two source addresses. This
instruction tells the processor to perform
an AND operation on B3:5 and B3:7 and to
store the result in destination B3:10 when
input device A is true. The destination bits
are a result of the logical AND operation.
Word-level OR instruction

The operation of a word-level OR instruction,


which ORs the data in Source A, bit by bit,
with the data in Source B and stores the result
at the destination address. The address of
Source A is B3:1, the address of Source B is
B3:2, and the destination address is B3:20.
The instruction may be programmed
conditionally, with input instruction(s)
preceding it, or unconditionally, as shown,
without any input instructions preceding it.
Word-level XOR instruction

The operation of a word-level XOR


instruction. In this example, data from input
I:1.0 are compared, bit by bit, with data from
input I:3.0. Any mismatches energize the
corresponding bit in word O:4.0. As you can
see, there is a 1 in every bit location in the
destination corresponding to the bit locations
where Source A and Source B are different,
and a 0 in the destination where Source A and
Source B are the same.
Word-level NOT instruction

The operation of a word-level NOT


instruction. This instruction inverts the
bits from the source word to the
destination word. The bit pattern in
B3:10 is the result of the instruction
being true and is the inverse of the bit
pattern in B3:9.
AND Gate OR Gate

NOT Gate
NAND Gate

NOR Gate XOR Gate


Latching

There are often situations in which it is necessary to hold an output energized, even when the input
ceases. A simple example of such a situation is a motor that is started by pressing a push-button
switch. Though the switch contacts do not remain closed, the motor is required to continue running
until a stop push-button switch is pressed. The term latch circuit is used for the circuit that carries out
such an operation. It is a self maintaining circuit in that, after being energized, it maintains that state
until another input is received.
A typical ladder logic program for the motor start/ stop circuit.

Will be
explained in
the lecture

You might also like