554 SECTION 9 Solid-State Controls
the number 33 is used for contact CR-4 and a nor-
mally open contact controlled by timer T200 is used
for the normally open timed contact labeled TR-3.
Coil 20 controls the operation of solenoid coil C.
The circuit shown in Figure 59–2 has now been
converted to a program that can be loaded into
a programmable logic controller. The process is
relatively simple if the rules concerning PLCs are
followed.
ENTERING A PROGRAM
The manner in which a program is entered into the
memory of the PLC is speci c to the manufacturer
and type of programming terminal used. Some pro-
gramming terminals employ keys that contain con-
tact, coil, and rung symbols to basically draw the
program as it is entered. Small programming termi-
nals may require that the program be entered in a
language called Boolean. Boolean uses statements
such as and, or, not, and out to enter programs.
Contacts connected in series, for example, would
be joined by and statements, and contacts that are
connected in parallel with each other would be pro-
grammed with or statements. In order to program a
contact normally closed instead of normally open,
the not statement is used. Different PLCs also require
the use of different numbers to identify particular
types of coils. One manufacturer may use any num-
ber between 600 and 699 to identify coils that are
used as timer and counters. Another manufacturer
may use any number between 900 and 999 to iden-
tify coils that can be used as timers and counters.
When programming a PLC, it is always necessary
to rst become familiar with the programming
requirements of the model and manufacturer of the
programmable logic controller being programmed.
PROGRAMMING
CONSIDERATIONS
When developing a program for a programmable
logic controller, there are certain characteristics of
a PLC that should be considered. One of these is the
manner in which a programmable logic controller
performs its functions. Programmable logic control-
lers operate by scanning the program that has been
entered into memory. This process is very similar
to reading a book. It scans from top to bottom and
from left to right. The computer scans the program
one line at a time until it reaches the end of the pro-
gram. It then resets any output conditions that have
changed since the previous scan. The next step is to
check all inputs to determine if they are high (power
applied to that input point) or low (no power applied
to that input point). This information is available for
the next scan. The next step is to update the display
of the programming terminal if one is connected.
The last step is to reset the
“watchdog” timer.
Most PLCs contain a timer that runs continually
when the PLC is in the RUN mode. The function of
this timer is to prevent the computer from becoming
hung in some type of loop. If the timer is not reset at
the end of each scan, the watchdog timer will reach
zero and all outputs will be turned off. Although this
process sounds long, it actually takes place in a few
milliseconds. Depending on the program length, it
may be scanned several hundred times each second.
The watchdog timer duration is generally set for
about twice the amount of time necessary to com-
plete one scan.
Scanning can eliminate some of the problems
with contact races that occur with relay logic.
The circuit shown in Figure 59–11 contains two
control relay coils. A normally closed contact, con-
trolled by the opposite relay, is connected in series
with each coil. When the switch is closed, which
relay will turn on and which will be locked out of the
circuit? This called a contact race. The relay that is
turned on depends on which one managed to open
its normally closed contact
rst and break the circuit
to the other coil. There is no way to really know
which relay will turn on and which will remain off.
There is not even a guarantee that the same relay
will turn on each time the switch is closed.
Programmable logic controllers eliminate the
problem of contact races. Because the PLC scans the
program in a manner similar to reading a book, if
it is imperative that a certain relay turn on before
another one, simply program the one that must
turn on rst ahead of the other one. A similar circuit
is shown in Figure 59–12. When contact 1 closes,
coil 100 will always be the internal relay that turns
on because it is scanned before coil 101.