
45
Although simple in appearance, the diagram below requires an AND LOAD
instruction.
Instruction
0002
0003
0000
0001
Address
Instruction
Operands
000
LD
0000
001
OR
0001
002
LD
0002
003
OR NOT
0003
004
AND LD
---
The two logic blocks are indicated by dotted lines. Studying this example
shows that an ON execution condition will be produced when: either of the
conditions in the left logic block is ON (i.e., when either bit 0000 or bit 0001 is
ON), and when either of the conditions in the right logic block is ON (i.e.,
when either bit 0002 is ON or bit 0003 is OFF).
The above ladder diagram cannot be converted to mnemonic code using
AND and OR instructions alone. If an AND between bit 0002 and the results
of an OR between bit 0000 and bit 0001 is attempted, the OR NOT between
bit 0002 and bit 0003 is lost and the OR NOT ends up being an OR NOT be-
tween just bit 0003 and the result of an AND between bit 0002 and the first
OR. What we need is a way to do the OR (NOT)’s independently and then
combine the results.
To do this, we can use the LOAD or LOAD NOT instruction in the middle of
an instruction line. When LOAD or LOAD NOT is executed in this way, the
current execution condition is saved in special buffers and the logic process
is begun over. To combine the results of the current execution condition with
that of a previous “unused” execution condition, an AND LOAD or an OR
LOAD instruction is used. Here “LOAD” refers to loading the last unused ex-
ecution condition. An unused execution condition is produced by using the
LOAD or LOAD NOT instruction for any but the first condition on an instruc-
tion line.
Analyzing the above ladder diagram in terms of mnemonic instructions, the
condition for bit 0000 is a LOAD instruction and the condition below it is an
OR instruction between the status of bit 0000 and that of bit 0001. The condi-
tion at bit 0002 is another LOAD instruction and the condition below is an OR
NOT instruction, i.e., an OR between the status of bit 0002 and the inverse of
the status of bit 0003. To arrive at the execution condition for the instruction
at the right, the logical AND of the execution conditions resulting from these
two blocks would have to be taken. AND LOAD does this. The mnemonic
code for the ladder diagram is shown in the previous table. The AND LOAD
instruction requires no operands of its own, because it operates on previous-
ly determined execution conditions. Here too, dashes are used to indicate
that no operand needs to be designated or input.
The following diagram requires an OR LOAD instruction between the top log-
ic block and the bottom logic block. An ON execution condition would be pro-
duced for the instruction at the right either when bit 0000 is ON and bit 0001
is OFF or when bit 0002 and bit 0003 are both ON. The operation of the
mnemonic code for the OR LOAD instruction is exactly the same as those for
a AND LOAD instruction except that the current execution condition is ORed
with the last unused execution condition.
AND LOAD
OR LOAD
Basic Programming
Section 3-4