Ladder Logic Diagram Examples - 3
Ladder Logic Diagram Examples - 3
1. Draw a ladder diagram that will cause the output, pilot light PL2, to be ON when
selector switch SS2 is closed, push-button PB4 is closed and limit switch LS3 is open.
(Note: no I/O addresses yet.)
Solution
The first question to answer is “What is the output?” The output is PL2, so the coil labeled as
PL2 is put on the right side of the rung. Secondly, consider the type of connection of contacts
to use. Since all three switches must be in a certain position to turn on the pilot light, a series
connection is needed. Thirdly, the type of contact is determined by the switch position to turn
on the pilot light:
Putting all the pieces together, only one rung of ladder logic is needed as shown below.
Design Tip
The concept of placing the output on the rung first and then “looking back” to determine the
input conditions is very important. Because of the way the diagram is configured, one has a
tendency to consider the input conditions first and then position the output coil as the last step.
As will be shown later, the coil or negated coil instruction referring to a particular output must
only occur once in a ladder program. Considering the output coil first and the conditions for
which it is active (on) will avoid repeating coils.
2. Draw a ladder diagram that is equivalent to the digital logic diagram in the figure below:
Page 1 of 5
Solution
The Boolean logic equation is given by:
𝑌 = 𝐴𝐵𝐶̅ + 𝐷 + 𝐸̅
In words:
Y is ON when (A is ON and B is ON and C is OFF) or D is ON or E is OFF.
First, find out the output. The output is Y, so the coil labeled as Y is put on the right side of the
rung. Secondly, consider the type of connection of contacts to use.
For this problem, there is more than one type of connection. The three inputs within the
parentheses (the AND gate in the figure) are connected with “and,” so a series connection is
required for these three contacts. The other two inputs (D and E) are connected with the three
series contacts by “or” (the OR gate inputs), so a parallel connection is required.
Thirdly, the type of contact is determined by the input state that turns ON the output, Y:
Putting all the parts together, only one rung of ladder logic is needed, as shown in the figure
below.
Suppose one changes the D contact in the above ladder diagram to refer to Y, the output as
shown below.
Is this legitimate?
Page 2 of 5
Yes, it is legitimate, though probably not something one would want to do for this example.
This concept is called sealing or latching an output without using the set (or latch) coil
instruction. In this example, it is not a good idea because once Y is sealed ON, there is no
provision to turn it OFF.
Why?
There are some precautions to observe when programming in ladder logic:
1. DO NOT repeat normal output coils or negated coils that refer to the same tag. To
illustrate what happens when this is done, consider the ladder logic diagram in the figure
below.
Page 3 of 5
In this illustration, it was obvious there is a problem. Normally, when this problem occurs, the
rungs are not adjacent, and it is not so obvious.
Compounding the problem, not all PLC programming software checks for this situation.
Therefore, the best way to prevent this problem is to consider the output coil first and then
consider all of the conditions that drive that output.
2. Use the set (latch) coil and reset (unlatch) coils together. If a set coil refers to an output,
there should also be a reset coil for that output. Also, for the same reason that output
coil and negated coils should not be repeated, do not mix the set/reset coils with an
output coil or negated coil that refer to the same output.
3. Be careful when using the set/reset coils to reference PLC physical outputs. If the
system involves safety and a set coil is used for a PLC physical output, simply
interrupting the condition on the set coil rung will not turn off the physical output. All
of the conditions that prevent the device from being turned on must also appear on a
rung with a reset coil output. For this reason, some companies forbid the use of the
set/reset coils.
4. Reverse power flow in the contact matrix is not allowed. When electromechanical
relays implement ladder logic, power can flow either way through the contacts. For
example, consider the ladder logic in figure below.
If implemented with electromechanical relays, power may flow right-to-left through the SS2
contact. When solid state relays replaced electromechanical relays for ladder logic, power can
flow only one way (left-to-right) through the contacts. This restriction was carried to PLC
ladder logic.
If the reverse power flow path is truly needed, then insert it as a separate path, where the power
flows from left to right. The reverse power flow path in the above figure is added as a separate
path as shown below.
Page 4 of 5
Reverse power flow in ladder logic corrected
Page 5 of 5