
67
instruction line, the instruction lines are coded first before the instruction that
they control.
KEEP(12)
DR 0000
0002
0004
0003
0005
R: reset input
S: set input
Address
Instruction
Operands
000
LD
0002
001
AND NOT
0003
002
LD
0004
003
OR
0005
004
KEEP(12)
DR
0000
3-6-5
Self-maintaining Bits (Seal)
Although the KEEP instruction can be used to create self-maintaining bits, it
is sometimes necessary to create self-maintaining bits in another way so that
they can be turned OFF when in an interlocked section of a program.
To create a self-maintaining bit, the operand bit of an OUTPUT instruction is
used as a condition for the same OUTPUT instruction in an OR setup so that
the operand bit of the OUTPUT instruction will remain ON or OFF until
changes occur in other bits. At least one other condition is used just before
the OUTPUT instruction to function as a reset. Without this reset, there would
be no way to control the operand bit of the OUTPUT instruction.
The above diagram for the KEEP instruction can be rewritten as shown be-
low. The only difference in these diagrams would be their operation in an in-
terlocked program section when the execution condition for the INTERLOCK
instruction was ON. Here, just as in the same diagram using the KEEP in-
struction, two reset bits are used, i.e., DR 0000 can be turned OFF by turning
ON either bit 0004 or bit 0005.
0002
0003
DR 0000
DR 0000
0004
0005
Address
Instruction
Operands
000
LD
0002
001
AND NOT
0003
002
OR
DR
0000
003
AND NOT
0004
004
AND NOT
0005
005
OUT
DR
0000
3-6-6
Work Bits (Internal Relays)
In programming, combining conditions to directly produce execution condi-
tions is often extremely difficult. These difficulties are easily overcome, how-
ever, by using certain bits to trigger other instructions indirectly. Such pro-
gramming is achieved by using work bits. Sometimes entire words are re-
quired for these purposes. These words are referred to as work words.
Work bits are not transferred to or from the PC. They are bits selected by the
programmer to facilitate programming as described above. I/O bits and other
dedicated bits cannot be used as works bits. All bits in the bit area that are
not allocated as I/O bits, and certain unused bits in the DR area, are avail-
able for use as work bits. Be careful to keep an accurate record of how and
where you use work bits. This helps in program planning and writing, and
also aids in debugging operations.
Work Bit Applications
Examples given later in this subsection show two of the most common ways
to employ work bits. These should act as a guide to the almost limitless num-
Advanced Programming
Section 3-6