179
Work Bits (Internal Relays) Section 4-5
In the following example, HR 0000 will be turned ON when IR 00002 is ON
and IR 00003 is OFF. HR 0000 will then remain ON until either IR 00004 or IR
00005 turns ON. With KEEP, as with all instructions requiring more than one
instruction line, the instruction lines are coded first before the instruction that
they control.
4-4-4 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 below.
The only difference in these diagrams would be their operation in an inter-
locked program section when the execution condition for the INTERLOCK
instruction was ON. Here, just as in the same diagram using the KEEP
instruction, two reset bits are used, i.e., HR 0000 can be turned OFF by turn-
ing ON either IR 00004 or IR 00005.
4-5 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
programming is achieved by using work bits. Sometimes entire words are
required 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 IR area that are not
allocated as I/O bits, and certain unused bits in the AR area, are available 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.
00002
00004
00003
00005
R: reset input
S: set input
KEEP(11)
HR 0000
Address Instruction Operands
00000 LD 00002
00001 AND NOT 00003
00002 LD 00004
00003 OR 00005
00004 KEEP(11) HR 0000
00002 00003
HR 0000
HR 0000
00004
00005
Address Instruction Operands
00000 LD 00002
00001 AND NOT 00003
00002 OR HR 0000
00003 AND NOT 00004
00004 OR NOT 00005
00005 OUT HR 0000