Problem Solution
Logic gates
In very simple language, it is a Boolean decision that has one of only two values either “TRUE” or “FALSE”, not both. For instance, the decision to run or shut down a motor, open or close a valve etc. Well! For deciding such Boolean nature thing, there are two things, inputs and logic to apply on those inputs. On the other way, logic gates apply some sort of logic to the inputs to determine the state of the output.
Truth table
It’s a table that lists all possible combinations of the inputs and the state of the output for each record. For example, a gate with two inputs has four possible combinations of the inputs and four states of the output. inputs.
Basics of logic gate
There are seven basic logic gates. Some of them have only one input while others have two inputs. There are seven basic logic gates which are “AND”, “OR”, “NOT”, “NOR”, “XOR”, “XNOR”, and “NAND”.
Assuming that all the gates comprise two inputs and NOT Gate has only one input, Logic Gates can be well implemented in PLC using Ladder Diagram programming language as shown in “Program” section.
To implement Examine if closed, Normally Open contact is used and to implement Examine if open, Normally Closed contact is used.
These contacts is said to work as relay contacts.
In Normally Open / XIC contact, when logic 1, or in other words, when logic high is provided, the contact closes allowing current to pass through the circuit.
And in Normally Closed / XIO contact, when logic 1 is not present, or in other words, when logic 0 is present, it allows current to pass through the circuit. But when logic 1 is present in case of XIO, the contact opens inhibiting current to pass through the circuit.
By simply using these logics, all Logic Gates can be well implemented using Ladder Diagram programming language.
Parallel contacts are logically equivalent to an OR gate.
Series contacts are logically equivalent to an AND gate.
Normally closed (N.C.) contacts are logically equivalent to a NOT gate.
A relay must be used to invert the output of a logic gate function, while simple normally-closed switch contacts are sufficient to represent inverted gate inputs.