Module 2 - Bit Logic Instructions - Lecture Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

PLC & SCADA

BIT LOGIC INSTRUCTION

NISHCHITHA M H
Assistant Professor
Department of Mechatronics
Acharya Institute of Technology
Bit logic instructions work with two digits, 1 and 0. These two digits form the base of a number system
called the binary system. The two digits 1 and 0 are called binary digits or bits. In the world of contacts
and coils, a 1 indicates activated or energized, and a 0 indicates not activated or not energized. The
bit logic instructions interpret signal states of 1 and 0 and combine them according to Boolean logic.
These combinations produce a result of 1 or 0 that is called the ”result of logic operation” (RLO). The
logic operations that are triggered by the bit logic instructions perform a variety of functions.

There are bit logic instructions to perform the following functions:

---| |--- Normally Open Contact (Address)

• ---| |--- (Normally Open Contact) is closed when the bit value stored at the specified <address>
is equal to "1".
• When the contact is closed, ladder rail power flows across the contact and the result of logic
operation (RLO) = "1".
• Otherwise, if the signal state at the specified <address> is "0", the contact is open. When the
contact is open, power does not flow across the contact and the result of logic operation (RLO)
= "0".

---| / |--- Normally Closed Contact (Address)

• ---| / |--- (Normally Closed Contact) is closed when the bit value stored at the specified
<address> is equal to "0".
• When the contact is closed, ladder rail power flows across the contact and the result of logic
operation (RLO) = "1".
• Otherwise, if the signal state at the specified <address> is "1", the contact is opened. When
the contact is opened, power does not flow across the contact and the result of logic operation
(RLO) = "0".

---( )--- (Output Coil)

• ---( )--- (Output Coil) works like a coil in a relay logic diagram.
• If there is power flow to the coil (RLO = 1), the bit at location <address> is set to "1".
• If there is no power flow to the coil (RLO = 0), the bit at location <address> is set to "0". An
output coil can only be placed at the right end of a ladder.

EQUIVALENT LADDER DIAGRAM OF OR GATE


The function of an OR gate is simulated in the electric circuit displayed in Figure 1.

Notice that the lamp will be ON when one or both of the switches are closed. Figure 2 displays a two-
input OR logic gate symbol, its Boolean expression, and its truth table.

The truth table shows a logic high output for all combinations of inputs except where both A and B are
low. When either input A, B, or both are on, the output is on.

Figure 3 displays a ladder logic diagram that performs the function of a two-input OR gate. When
either normally open (NO) inputs I:0/0, I:0/1, or both are closed, output O:0/0 is energized.

NISHCHITHA M H 1
EQUIVALENT LADDER DIAGRAM OF AND GATE
The function of an AND gate is simulated in the electric circuit displayed in Figure 4. Notice that
the lamp will be on only when both switches are closed.

Figure 5 displays a two-input AND logic gate symbol, its Boolean expression, and its truth table.
In the truth table, you can see that there is only one set of inputs that produces a logic high output.
Figure 6 displays a ladder logic diagram that performs the function of a two-input AND gate. When
normally open inputs I:0/0 and I:0/1 are closed, output O:0/0 is energized.

NISHCHITHA M H 2
EQUIVALENT LADDER DIAGRAM OF NOT GATE

The output of a NOT gate is the inverse of the input. The NOT gate is sometimes called an inverter.
The function of a NOT gate is simulated by the electric circuit displayed in Figure 7. When the switch
is closed, the electric bulb is short circuited, and it turns off. When the switch is open, electric current
flows through the light bulb, and the light bulb turns on. Like the NOT gate, the output is on when the
input is off and vice versa. The input is inverted to generate an output. Figure 8 displays the NOT logic
gate symbol, its Boolean expression, and its truth table. Figure 9 displays that there are two different
types of PLC ladder logic diagrams that perform the NOT function.

• In rung 0000, the XIO (examine if open) device is connected to the output. Therefore, the XIO device
is normally closed and output zero is ON. When you press pushbutton #1 (I:0/0), the output zero (pilot
light #1) is turned off. (Notice that address I:0/0 references the port 0 on module 0.)

• In rung 0001, pushbutton #2 (I:0/1) is connected to internal coil bit B3:0/0. (Notice that address I:0/1
references the port 1 on module 0.) In rung 0002, the internal contact bit B3:0/0 is inverted and
connected to output one (pilot light #2). When normally open input I:0/1 is open, output one (O:0/1)
is ON. Press input 0/1 to close it, then output one will turn OFF.

NISHCHITHA M H 3
EQUIVALENT LADDER DIAGRAM OF NAND GATE

The function of a NAND gate is simulated in the electric circuit displayed in Figure 10. Notice that the
lamp will be off when both switches are closed. The NAND gate takes its name from NOT and AND. Its
outputs are the inverse of the AND gate. Figure 11 displays a two-input NAND logic gate symbol, its
Boolean expression, and its truth table. Notice that the NAND gate can be built by connecting an AND
gate in series with a NOT gate. Using the De-Morgan theorem, sometimes also called the Bubble
method, you can convert a NAND gate to an OR gate with inverted inputs where (A · B) ′ = A′ + B′.
Figure displays that there are two different types of ladder logic diagrams that perform the NAND
function.

• Both normally closed inputs I:0/0 and I:0/1 must be energized (opened) to turn off the output O:0/0.

NISHCHITHA M H 4
EQUIVALENT LADDER DIAGRAM OF NAND GATE

The function of a NOR logic gate is simulated in the electric circuit displayed in Figure 13. Notice that
the lamp will be ON when both switches are open. The NOR gate takes its name from NOT and OR. Its
outputs are the inverse of the OR gate.

Figure 14 displays a two-input NOR logic gate symbol, its Boolean expression, and its truth table.
Notice the NOR gate can be built by connecting an OR gate in series with a NOT gate. Using the De-
Morgan theorem, you can convert a NOR gate to an AND gate with inverted inputs where (A + B) ′ =

NISHCHITHA M H 5
A′ · B′. Figure 15 displays that there are two different types of ladder logic diagrams that perform the
NOR gate function.

• Both normally closed inputs I:0/0 and I:0/1 must be de energized (remain closed) to turn on the
output O:0/0.

EQUIVALENT LADDER DIAGRAM OF XOR GATE

The function of an XOR (exclusive OR) gate is simulated in the electric circuit displayed in Figure 16.
Notice that the lamp will be on if one switch is open while the other switch is closed. Figure 17 displays
an XOR logic gate symbol, its Boolean expression, and its truth table. Looking at the truth table, you
can see that either inputs A or B (but not both) must be high to produce a high output.

One input must be ON and the other one OFF in order to have the output ON. Figure 18 displays a
ladder logic diagram that performs the function of an XOR gate.

NISHCHITHA M H 6
When I:0/0 is on, I:0/1 must be off and vice versa in order to turn on output O:0/0. When either
Pushbutton #1 or Pushbutton #2 is pressed, the output is ON. When both pushbuttons are pressed,
output is OFF.

De-Morgan’s Law

NISHCHITHA M H 7
NISHCHITHA M H 8
NISHCHITHA M H 9
NISHCHITHA M H 10
NISHCHITHA M H 11
NISHCHITHA M H 12
NISHCHITHA M H 13

You might also like