Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Robotics & Automation Lab

LAB No. 2
GETTING FAMILIAR TO LADDER
LOGIC PROGRAMMING
____________________________________
Objectives
1. Constructing LAD of basic gates to get familiar with LAD functions and testing it on PLC.
2. Constructing LAD for Boolean Equations and testing it on PLC.

Introduction to Ladder Logic Diagrams


Ladder logic is a programming language that creates and represents a program through ladder
diagrams that are based on circuit diagrams. It is mainly used in developing programs or software
for programmable logic controllers (PLCs), which are used in industrial applications.

In drawing a ladder diagram, certain conventions are adopted:

1. The vertical lines of the diagram represent the power rails between which circuits are
connected. The power flow is taken to be from the left-hand vertical across a rung.
2. Each rung on the ladder defines one operation in the control process.
3. A ladder diagram is read from left to right and from top to bottom, Figure 11.3 showing
the scanning motion employed by the PLC. The top rung is read from left to right. Then
the second rung down is read from left to right and so on.
4. When the PLC is in its run mode, it goes through the entire ladder program to the end, the
end rung of the program being clearly denoted, and then promptly resumes at the start. This
procedure of going through all the rungs of the program is termed a cycle. The end rung
might be indicated by a block with the word END or RET for return, since the program
promptly returns to its beginning.

1
Robotics & Automation Lab

5. Each rung must start with an input or inputs and must end with at least one output. The
term input is used for a control action, such as closing the contacts of a switch, used as an
input to the PLC. The term output is used for a device connected to the output of a PLC,
e.g., a motor.
6. Electrical devices are shown in their normal condition. Thus a switch, which is normally
open until some object closes it, is shown as open on the ladder diagram. A switch that is
normally closed is shown closed.
7. A particular device can appear in more than one rung of a ladder. For example, we might
have a relay that switches on one or more devices. The same letters and/or numbers are
used to label the device in each situation.
8. The inputs and outputs are all identified by their addresses, the notation used depending on
the PLC manufacturer. This is the address of the input or output in the memory of the PLC.

Symbols Used for Inputs and Outputs


There are two types of input symbols used in LAD.

Normally Open:
Normally open (NO) i.e. the contacts are normally open and close when the switch is actuated.

Symbol for normally open in PLCs

Normally Closed:
Normally closed (NC) i.e. the contacts are normally closed and open when the switch is actuated.

Symbol for normally closed in PLCs

NO & NC push buttons

2
Robotics & Automation Lab

Output Coil
There is just a one symbol in LAD to denote output Known as Coil. Ladder logic outputs are
known as coil because plc were modelled on relay logic diagrams. The output in a relay ladder
diagram is a relay coil that switches a set of output contacts.

Symbol for output coil in PLCs

Operation of NO & NC switches

Steps for Building a Ladder Diagram


1. Determine the No. of digital Input/Output.
2. Determine if there are special functions in the process.
3. Estimate the program capacity depending on the process.
4. Choose a suitable PLC series.
5. Prepare the wiring diagram.
6. Draw flowchart or control diagram.
7. Program the PLC using the ladder diagram.

Logic Functions
There are many control situations requiring actions to be initiated when a certain combination of
conditions is realized. Thus, for an automatic drilling machine, there might be the condition that
the drill motor is to be activated when the limit switches are activated that indicate the presence of
the workpiece and the drill position as being at the surface of the workpiece. Such a situation
involves the AND logic function, condition A and condition B having both to be realized for an
output to occur. Now we will consider such logic functions and design there LAD.

3
Robotics & Automation Lab

AND Gate
AND gate is a gate which produces an output signal only when signals are received simultaneously
through all input connections.

Truth Table for AND Gate

Ladder Diagram for AND Gate

OR Gate
OR gate is a gate which produces an output if there is a signal on any of its inputs.

Truth Table for OR Gate

4
Robotics & Automation Lab

Ladder Diagram for OR Gate

NOT Gate
NOT gate is a gate which inverts the input signal.

Truth Table for NOT Gate

Ladder Diagram for NOT Gate

Latching
There are often situations where it is necessary to hold an output energized, even when the input
ceases. A simple example of such a situation is a motor, which 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 used to carry
out such an operation. It is a self-maintaining circuit in that, after being energized, it maintains that
state until another input is received.

Latched Circuit

5
Robotics & Automation Lab

Multiple Outputs
With ladder diagrams, there can be more than one output connected to a contact as shown below.

Ladder Diagram with Two Outputs

Ladder Diagram with Two inputs and Two Outputs

Boolean algebra
Boolean algebra was developed in the 1800s by James Bool, an Irish mathematician. It was found
to be extremely useful for designing digital circuits, and it is still heavily used by electrical engi-
neers and computer scientists. The techniques can model a logical system with a single equation.
The equation can then be simplified and/or manipulated into new forms. The same techniques
developed for circuit designers adapt very well to ladder logic programming.

Boolean Logic Design


Every Boolean equation can be implemented using a ladder logic. Following are the few
examples which shows the Ladder diagrams for Boolean equations.

1.

6
Robotics & Automation Lab

2.

3.

7
Robotics & Automation Lab

4.

8
Robotics & Automation Lab

5.

Multiplexers
Multiplexers allow multiple devices to be connected to a single device. These are very popular for
telephone systems. A telephone switch is used to determine which telephone will be connected
to a limited number of lines to other telephone switches. This allows telephone calls to be made to
somebody far away without a dedicated wire to the other telephone. In older telephone switch
boards, operators physically connected wires by plugging them in. In modern computerized
telephone switches the same thing is done, but to digital voice signals.

9
Robotics & Automation Lab

LAD for Multiplexers

PLC Implementation
Design the ladder logics of all gates, Boolean equation and multiplexer studied on GX developer
and verify the truth tables by running LAD on PLC.

10
Robotics & Automation Lab

Post Labs:
Question 1: Draw Ladder diagram for the following gates and design it on GX developer:
a) NAND Gate
b) NOR Gate
c) XOR Gate
d) XNOR Gate

11
Robotics & Automation Lab

Question 2: Draw Ladder diagram for the following Boolean Equations and design it on GX
developer:
a) X=A + B + C + (E.D.Z)
b) Z=ASDP + (QWERTY)
c) A=QPN & B=A + C + XYZ

Lab Instructor: Engr. Abdullah Hasan Signature: ______________

Date: ______________

12

You might also like