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

PLC Programming Lecture 7

The document discusses PLC programming and ladder logic programming. It defines PLC programming as implementing control applications according to user requirements using instructions in graphical or textual form. There are different PLC programming languages including ladder logic, sequential flow charts, structured text, function block diagrams, and instruction lists. Ladder logic uses symbols to represent logical operations and is commonly used. The document then focuses on ladder logic programming and describes logic gates, their truth tables, and how to represent them using ladder diagrams with normally open and normally closed contacts.

Uploaded by

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

PLC Programming Lecture 7

The document discusses PLC programming and ladder logic programming. It defines PLC programming as implementing control applications according to user requirements using instructions in graphical or textual form. There are different PLC programming languages including ladder logic, sequential flow charts, structured text, function block diagrams, and instruction lists. Ladder logic uses symbols to represent logical operations and is commonly used. The document then focuses on ladder logic programming and describes logic gates, their truth tables, and how to represent them using ladder diagrams with normally open and normally closed contacts.

Uploaded by

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

PLC Programming

• Contents:
• What is PLC Programming
• Types of PLC Programming
• Ladder Logic Programming

1/31/2023 PLC Programming 1


PLC Programming
• PLC Programming
• PLC programming is a crucial task of implementing and designing control
applications as per the user requirements.
• It is the set of instructions that can be in the graphical or textual form.
• The programming is carried out in the PLC software.

1/31/2023 PLC Programming 2


Types PLC Programming

• The control logic of the PLC can be programmed using different


programming languages.
• Out of all the programming languages, Ladder is the most common
programming language used for PLC. Therefore, we will discuss
Ladder programming in detail.
• The standard-based programming language to program PLC is called
the Ladder diagram.
• ST and IL are the textual programming language, while Ladder, FBD,
and SFC are the graphical programming languages.

1/31/2023 PLC Programming 3


Types PLC Programming

• There are about five programming language most commonly use


• Ladder diagram (LD)
• Sequential flow chart (SFC)
• Structured Text (ST)
• Function Block Diagram (FBD)
• Instruction List (IL)

1/31/2023 PLC Programming 4


Types PLC Programming

• Sequential flow chart (SFC)


• The Sequential Flow charts are defined by the function of charts in a
sequence. We can use it if the process can be divided into steps.
Sample Program:

1/31/2023 PLC Programming 5


Types PLC Programming

• Structured Text (ST)


• The Structured Text is a block-structured language that is based on Pascal. It is
a high-level language. It is also a text-based language.

1/31/2023 PLC Programming 6


Types PLC Programming

• Function Block Diagram (FBD):


• The functions in the FBD diagram are described as the set of elementary
blocks. The variables (input and output) in the Function Block Diagram are
connected to blocks by the lines.
• Instruction List (IL):
• The instruction List is a text-based and a low-level language.

1/31/2023 PLC Programming 7


Types PLC Programming

• Ladder Logic:
• It is defined as a graphical programming language that uses symbolic notation
for expressing the logical operations.
• We can program the PLC on any software using the ladder logic.

1/31/2023 PLC Programming 8


Types PLC Programming

Basic concepts.
• Push Buttons
• The pushbuttons are the simple buttons to control the machine or a process.
• We are required to push the button to change its electrical state from ON to
OFF or vice-versa.

1/31/2023 PLC Programming 9


Ladder Logic Programming
• Push buttons are further categorized as NO (Normally Open) and NC
(Normally Closed), as shown below:

1/31/2023 PLC Programming 10


Ladder Logic Programming
• NC: The Normally Close is the default state of a circuit that makes
electrical contact with the circuit. It means the circuit is in ON state.
• NO: The Normally Open is the state of a circuit that makes no
electrical contact with the circuit. It means the circuit is in the OFF
state. It opens the terminal of the circuit to interrupt the flowing
current.
• NOTE: We will use pushbuttons for programming in PLC.

1/31/2023 PLC Programming 11


Ladder Logic Programming
Symbols used in Programming
• Various symbols are used to create a ladder circuit for PLC
programming.
• Let's consider some essential symbols.
• The symbols are shown below:

1/31/2023 PLC Programming 12


Ladder Logic Programming
• The concept of NO and NC.
• The output of NO and NC buttons when the input is 0 or 1.
1. NO
• The NO button turns NC when it is pressed. It means, when the input is 1, NO
turns NC. It means the current can pass through.
• Consider the below image:

• It clearly shows that when the input is 0, NO remains NO. It turns NC when
the input is 1.

1/31/2023 PLC Programming 13


Ladder Logic Programming
2. NC
• The NC button remains the same when the input is 0. It turns NO when the
input is 1.
• Consider the below image:

• NOTE: We can arrange NO and NC in parallel or series according to


the requirements.

1/31/2023 PLC Programming 14


Ladder Logic Programming
• The logic gates with their ladder diagram.
• The concept of using NO and NC in a ladder diagram will help in building the
circuits of PLC. The ladder diagram of Logic gates are discussed below:

1/31/2023 PLC Programming 15


Ladder Logic Programming
• Logic Gates
• Logic gates with their circuit using NO and NC buttons are discussed here:
• Basic Gates
• The Basic Gates are AND, OR, and NOT.
• The truth table of OR and AND Gate is given below:

1/31/2023 PLC Programming 16


Ladder Logic Programming

The truth table of NOT Gate is given


below:

1/31/2023 PLC Programming 17


Ladder Logic Programming
• Ladder Diagram of AND Gate
• The ladder diagram of AND Gate is given below:
• Here, A and B are the inputs, while L is the lamp. The lamp
will glow when the current flows through the circuit and
reaches the lamp. Otherwise, the lamp will not glow.

When A = 0 and B = 1, the circuit will appear as:


The lamp will not light because the starting
button is OFF. The current will not flow.

But, if A = 1 and B = 1, the circuit will appear


as:
Here, the lamp will light. Hence, the condition of the AND gate
is satisfied.

1/31/2023 PLC Programming 18


Ladder Logic Programming
• Ladder Diagram of OR Gate
• The ladder diagram of OR Gate is given below:

When A = 0 and B = 1, the circuit will appear as:

When A = 1 and B = 1, the circuit will appear as:

1/31/2023 PLC Programming 19


Ladder Logic Programming
• Ladder Diagram of NOT Gate
• The ladder diagram of NOT gate is a simple NC.
• It will give output 1 if the input is 0 and vice versa.
If the input is 0, the circuit will appear as:

If the input is 1, the circuit will appear as:

The lamp will not light because NC will become


NO.

1/31/2023 PLC Programming 20


Ladder Logic Programming
• Universal Gates
• The Universal Gates are NAND and NOR.
• The truth table of NAND and NOR gate is given below:

1/31/2023 PLC Programming 21


Ladder Logic Programming
• Ladder Diagram of NAND Gate
• The ladder diagram of NAND Gate is given below:

When, A = 1 and B = 0, the circuit will appear as:

Here, the lamp will light.

If A = 1 and B = 1, the lamp will not light because both NC will


become NO.

Hence, the condition is satisfied.

1/31/2023 PLC Programming 22


Ladder Logic Programming
• Ladder Diagram of NOR Gate
• The ladder diagram of NOR Gate is given below:
When, A = 1 and B = 0, the circuit will appear as:

Here, the lamp will not light because the first NC will become
NO.

If A = 0 and B = 0, the lamp will light because both NC will


remain the same.

Hence, the condition is satisfied.

1/31/2023 PLC Programming 23


Ladder Logic Programming
• Exclusive Gates
• The Exclusive Gates are XOR and XNOR.
• The truth table of EX-OR and Ex-NOR gate is given below:

1/31/2023 PLC Programming 24


Ladder Logic Programming
• For XOR For XNOR

1/31/2023 PLC Programming 25


Ladder Logic Programming
• Ladder Diagram of XOR Gate
• The ladder diagram of XOR Gate is given below:

When A = 0 and B = 1, the circuit will appear as:

Here, the lamp will light.

But, if A = 1 and B = 1, the circuit will appear as: Here, the lamp will not light because both the NC of the circuit
becomes NO.

Hence, the condition is satisfied.

1/31/2023 PLC Programming 26


Ladder Logic Programming
• The ladder diagram of XNOR Gate is given below:

When A = 0 and B = 1, the circuit will appear as:

The lamp will not light. The circuit is incomplete for the current
to flow.

But, if A = 1 and B = 1, the circuit will appear as:

Here, the lamp will light.

Hence, the condition is satisfied.

1/31/2023 PLC Programming 27


Ladder Logic Programming
• Examples
• Example 1: We have three pushbuttons. If A, B, and C are pressed, the
red LED goes ON. If A and B are pressed, the green LED goes ON. It
means that only one LED is on at a time.

1/31/2023 PLC Programming 28


Ladder Logic Programming
• Solution 1:
• Given: Here, there are two LEDs: green and red. At a time, one LED light. It
can be either green or red.
• Push buttons: A, B, C
• We will create a ladder diagram based on the above logic.
• The ladder diagram is shown below:

1/31/2023 PLC Programming 29


Ladder Logic Programming
• Here, we have inserted both NO and NC of the same button 'C' in the
ladder diagram. When we press a NO button, it turns NC.
• When we press NC button, it turns NO.
• When we press the C button, we are pressing both the NO and NC of
button C.

1/31/2023 PLC Programming 30


Ladder Logic Programming
• Case 1: Press all A, B, and C buttons together.
• The circuit will now appear as:
Here, the red LED will light, as shown above.

Case 2: Press only A and B button.

NC always allows the current to pass through the circuit. It only


becomes NO, when we press it.

The circuit will now appear as: Here, the green LED will light. Since, the C button was NC,
it also allows the current to pass.

1/31/2023 PLC Programming 31


Thanks for Listening

2/2/2023 PLC Programming 32

You might also like