Logic Gates using PLC Programming [Explained with Ladder Diagram]

PLC feature image

As we all know, logic Gate is a building block for the digital circuit. It takes binary input (0, 1) and gives binary output based on the input provided.

Logic gates using the programmable logic controller (PLC) is the basic thing you must learn if you want to enhance your Electrical and Electronics skills.

In this post, you will be learned to write the programming in PLC using Logic Gates.

For programmable logic controllers (PLCs) programming you need PLC software to build the logic module. 

PLC software is a control and input device for writing the programming using ladder diagram programming language…

Types of Logic Gates using PLC Ladder

Different types of ladder logic diagram that perform different logic gate functions. Basically, there are seven types of logic gates as below.

  1. NOT Gate
  2. AND  Gate
  3. OR  Gate
  4. NAND  Gate
  5. NOR  Gate
  6. EX-OR  Gate
  7. EX-NOR  Gate

Note: The circuit diagrams are connected to make and break input (I) and output (Q) contact in series and parallel circuits.

For all the circuit diagram, we are representing inputs (I1) and (I2) as switches, output (Q1) as coil/lamp.

Let’s see the explanation for each logic gate with PLC implementation,

1. NOT GATE

In electronics, NOT GATE is also called an ‘Inverter’ or ‘Buffer’.

Working: NOT gate works as inversion. It takes one input and gives one output. When the input is high then the output is low and vice-versa.

Logic Gate Truth Table for NOT Gate:

Input (I1)Output (Q1)
01
10

NOT Gate in PLC programming:

In the case of PLC ladder, there will be a push button to provide input. When (I1) is pressed then the coil (Q1) is on. And when Input (I1) is released then coil( Q1 is off.

Symbolic Representation.

Running NOT Gate ladder diagram program in PLC software.

2. AND GATE

Working: In AND Gate, when both inputs (I1 and I2) are high then the output (Q1) will be high.  For all other inputs, output (Q1) will be the low.

Logic Gate Truth Table for AND Gate:

Input (I1)Input (I2)Output (Q1)
000
010
100
111

AND Gate in PLC programming:

Using Ladder diagram programming, we are connecting two switches (I1 and I2) as input and coil/lamp (Q1) as output.

In the case of both switches (I1 and I2) are closed, the lamp (Q1) will glow. In another case, if any of the switches (I1 or I2) are open then lamp (Q1) will not glow.

Symbolic Representation as,

AND Gate repesent in PLC
AND Gate represent in PLC

Running AND Gate ladder diagram program in PLC software.

3. OR GATE

Working: If both inputs are low in the OR gate, then the output will be low. For all other cases, the output will be high.

Logic Gate Truth Table for OR Gate:

Input (I1)Input (I2)Output (Q1)
         0          0          0
         0          1           1
         1          0           1
         1          1           1

OR Gate in PLC programming:

In case both or anyone inputs (I1 and I2) are closed then coil (Q1) will on.

Symbolic Representation as,

In the above circuit diagram, switch (I1) is pressed then the coil (Q1) will be energized. After releasing switch (I1), the energizing coil (Q1) is providing supply to switch (I2). Then switch (I2) will become automatically activated.

Running OR Gate ladder diagram program in PLC software.

4. NAND GATE

NAND gate is operated as an AND gate and followed by the inverter.

Working: In NAND Gate,  the output will be low when both inputs are high. For all other cases, the output will be high.

Logic Gate Truth Table for NAND Gate:

Input (I1)Input (I2)Output (Q1)
        0         0          1
        0         1          1
        1         0          1
        1         1          0

NAND Gate in PLC programming:

If both switches (I1 and I2) or anyone switch (I1 or I2) are closed, the lamp will be glow. In the case, both switches are open then the lamp will not be glow.

Symbolic Representation as,

Running NAND Gate ladder diagram program in PLC software.

5. NOR GATE

NOR Gate is operated OR Gate followed by the NOT Gate.

When both inputs are low then the output will be high. Otherwise, the low output will occur if both inputs are high.

Logic Gate  Truth Table for NOR Gate:

Input (I1)Input (I2)Output (Q1)
         0          0           1
         0          1           0
         1          0           0
         1          1           0

NOR Gate in PLC programming:

The Coil (Q1) will be activated if both inputs are closed. Coil (Q1) will be deactivated if any one or bothe the inputs are open.

Symbolic Representation as,

Running NOR Gate ladder diagram program in PLC software.

6. EX-OR GATE

Working: If both inputs are high or low, the output will become low. For any other input condition, the output will be high.

Logic Gate Truth Table for EX-OR Gate:

Input (I1)Input (I2)Output (Q1)
000
011
101
110

EX-OR Gate in PLC programming:

In the function of EX-OR Gate, the lamp will be on if one switch is closed and another switch is opened.

Symbolic Representation as,

Running EX-OR Gate ladder diagram program in PLC software.

7. EX-NOR GATE

Working: When both inputs (I1 and I2) are high or low then the output will high. If anyone input is high or low then the output will become low.

Logic Gate Truth Table for EX-NOR Gate:

Input (I1)Input (I2)Output (Q1)
001
010
100
111

EX_NOR gate in PLC programming:

The function of EX-NOR Gate, the lamp (Q1) will be on if both switches (I1 and I2) are open or closed. The lamp (Q1) will not be on if anyone switches (I1) is activated and another switch (I2) is deactivated.

Symbolic Representation as,

Running EX-NOR Gate ladder diagram program in PLC software.

To Conclude…

This is all about different logic gates using PLC ladder programming. As well as PLC programming rules and programming instructions are also important for writing the program.

Programmable Logic Controller (PLC) Related Topics:

Ready for Test:

If you are ready for online test, here is a PLC Automation Quiz.

If you have any question, you can write in the comment section below.

Happy PLC Programming!

Test your knowledge and practice online quiz for FREE!

Practice Now »

 

33 thoughts on “Logic Gates using PLC Programming [Explained with Ladder Diagram]”

  1. Have a good day.
    Everything is fine.
    Boss if you give me some diagram using the logic gate for self-practice.
    Be well.

    Regards
    Md Shahjahan

    Reply
  2. Very useful. If you can also present a simple logic using these gates after describing in words that would have been useful to freshers.

    Reply
  3. Dear Dipaliji,

    Just seen your website , Very nice information not checked all , Will check all the information , notes if any query will contact you.

    Hemant

    Reply

Leave a Comment