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.
Table of Contents
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.
Address | Description | Type |
I0.0 | START SWITCH | INPUT |
I0.1 | STOP SWITCH / SWITCH 13 | INPUT |
I0.2 | SWITCH 1 | INPUT |
I0.3 | SWITCH 2 | INPUT |
I0.4 | SWITCH 3 | INPUT |
I0.5 | SWITCH 4 | INPUT |
I0.6 | SWITCH 5 | INPUT |
I0.7 | SWITCH 6 | INPUT |
I1.0 | SWITCH 7 | INPUT |
I1.1 | SWITCH 8 | INPUT |
I1.2 | SWITCH 9 | INPUT |
I1.3 | SWITCH 10 | INPUT |
I1.4 | SWITCH 11 | INPUT |
I1.5 | SWITCH 12 | INPUT |
M0.0 | CYCLE ON MEMORY | MEMORY |
M0.1 | MEMORY M1 FOR SWITCHES 1, 2, 3 | MEMORY |
M0.2 | MEMORY M2 FOR SWITCHES 4, 5, 6 | MEMORY |
M0.3 | MEMORY M3 FOR SWITCHES 7, 8, 9 | MEMORY |
M0.4 | MEMORY M4 FOR SWITCHES 10, 11, 12 | MEMORY |
Q0.0 | LAMP L1 | OUTPUT |
Q0.1 | LAMP L2 | OUTPUT |
Q0.2 | LAMP L3 | OUTPUT |
Ladder Logic Diagram
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.