# PLC Ladder Logic Examples – Example 3

We have discussed many PLC ladder logic examples on our blog and in this article, we are going to see another example. To understand this concept, we have taken the example of lamps that will be controlled with the use of different switches.

A switch is a device used to make or break the connection in an electric circuit. We use switches in our daily life. A common example of a switch is the on/off button in our homes and offices.

In this article, we are going to see how to draw a ladder logic diagram for controlling the motor outputs using PLC. One should note that these are the basic examples of PLC ladder logic examples for PLC ladder logic practices.

## PLC Ladder Logic Example 3

In this ladder logic example, we will see how to draw a ladder logic diagram to control the different outputs of a system.

### Problem Statement

Draw a ladder logic diagram to control the lamp output as per the given logic. Make use of a start and stop push button to turn on and off the system. Use switches to turn on and off the lamps.

• Lamps L1, L2, and L3 will turn ON only when switches Switch1, Switch 2, and Switch 3 are turned ON. If any one of these three switches is off, lamps will not turn ON.
• Lamps L1 will turn OFF only when switches Switch 4, Switch 5, and Switch 6 are turned ON. If any one of these three switches is off, lamp L1 will not turn OFF.
• Lamps L2 will turn OFF only when switches Switch 7, Switch 8, and Switch 9 are turned ON. If any one of these three switches is off, lamp L2 will not turn OFF.
• Lamps L3 will turn OFF only when switches Switch 10, Switch 11, and Switch 12 are turned ON. If any one of these three switches is off, lamp L3 will not turn OFF.
• All lamps will turn OFF when switch 13 is turned ON.

Write down a ladder logic diagram for the above problem statement.

### List of Input and Output Tags

In this PLC ladder logic example, we have used 14 inputs, 3 outputs, and 5 memories.

In this PLC ladder logic example, we have used Siemens S7-1500 PLC and Siemens TIA portal for programming a ladder logic diagram. The PLC we selected has a work memory of 250 kB, 24 V DC power supply with 24V DC 32 digital inputs, 16 digital outputs, 4 analog inputs, and 2 analog outputs on board.

For a better explanation, we have divided the program into 3 networks. The function of each network is discussed below.

#### Network 1

It is the cycle Start and Stop network. Push Button (PB) is used for starting and stopping purposes.

A Normally Closed (NC) input is taken for Stopping the cycle. A Normally Open (NO) input is taken to start the cycle. A memory (M0.0) is taken that will be used in further networks. This memory is latched to the Start PB.

The cycle is started by pressing START PB (I0.0) and is stopped by pressing STOP PB(I0.1).

#### Network 2

Network 2 is used only to create memories of respective switches that will be further used in the main program in network 3.

• Switches 1, 2, and 3 connected in series togetherly form a memory M1.
• Switches 4, 5, and 6 connected in series togetherly form a memory M2.
• Switches 7, 8, and 9 connected in series togetherly form a memory M3.
• Switches 10, 11, and 12 connected in series togetherly form a memory M4.

#### Network 3

Network 3 contains the main program that gives desired outputs for the given problem statement.

Memory M1 is connected in series with all the inputs and outputs. Memory M2 (N.C) and M3 (N.O) are connected in parallel to the output lamp L1.

For lamp L2, memories M2 and M4 (both N.O) are in series and memory M3 is connected in parallel.

For lamp L3, memories M2 (N.O), M3 (N.O), and M4 (N.C) are in series, and another memory M4 (N.C) is connected in parallel.

##### Working of Network 3
• When switches 1, 2, and 3 from network 3 are turned ON, memory 1 will turn ON. This causes to turn on all the lamps L1, L2, and L3.
• Lamp L1 will turn ON through N.C contact M2, lamp L2 will turn on through N.C contact M3, and lamp L3 will turn ON through N.C contact M4
• Now, when memory M2 turns on, it will break the connection of lamp L1 by making M2 N.C contact to N.O, and hence the lamp L1 will turn OFF.
• Similarly, for lamp L2, when memory M3 turns ON, it will break the connection of the lamp L2 by making M3 N.C contact to N.O, and hence the lamp L2 will turn OFF.
• Again, for lamp L3, when memory M4 turns ON, it will break the connection of the lamp L3 by making M4 N.C contact to N.O, and hence the lamp L3 will turn OFF.