# PLC Ladder Logic Examples – Example 2

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 motors that will be controlled with the use of different switches and push-buttons. It is similar to the previous example of lamps, however, the approach to the ladder logic programming is different.

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 Examples 2

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 motor output as per the given logic. Make use of start and stop pushbuttons, 4 switches to turn on and off 2 motors (M), and a buzzer (B).

Take a start and stop push button to turn on and off the system.

• Pressing Switch 1 results in turning ON Motors M1 and M2 and a buzzer B1.
• After pressing switch 2, Motor M1 will turn OFF while Motor M2 and buzzer B1 remain ON.
• After pressing switch 3, Motor M2 will turn OFF while Motor M1 and buzzer B1 remain ON.
• After pressing switch 4, Buzzer B1 will turn OFF while Motors M1 and M1 remain 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 6 inputs, 3 outputs, and 4 memory. Among 6 inputs, 2 are push buttons and the rest switch.

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.

Memory M0.1 is the memory of switch 2. Similarly, memory M0.2 and M0.3 are memories of switch 3 and Switch 4 respectively.

#### Network 3

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

Switch 1 is normally open (N.O) switch connected in parallel to all other switches in the network. Switch 2 memory (N.C) and switch 3 memory (N.O) are in parallel connected to the output Motor M1.

Switch m memory (N.C) and switch 4 memory (N.O) are in parallel connected to the output Motor M2, and switch 4 memory (N.C) is connected in series with the output buzzer B1

##### Working of Network 3

When switch 1 is turned ON, all three outputs will turn ON since the switch memories are normally closed and are connected in series with the outputs.

Switch 2 memory is N.C and switch 3 memory is N.O for output M1 in network 3. Now, as we turn ON switch 2, switch 2 memory from network 2 will turn ON and this will result in switch 2 memory in network 3 to turn N.O. This will cut off the power supply to Motor M1 and the motor will stop.

Switch 3 memory is N.C and switch 4 memory is N.O for output M2 in network 3. Now, as we turn ON switch 3, switch 3 memory from network 2 will turn ON and this will result in switch 3 memory in network 3 to turn N.O. This will cut off the power supply to Motor M2 and the motor will stop. Also, switch 3 memory for output M1 will make contact with M1 and motor M1 will turn ON.

Similarly, switch 4 memory is N.C for output buzzer B1 in network 3. Now, as we turn ON switch 4, switch 4 memory from network 2 will turn ON and this will result in switch 4 memory in network 3 to turn N.O. This will turn OFF the buzzer B1 and switch ON motor 2 at the same time.