
43
struction. If either is OFF, the result will also be OFF. The execution condition
for the first AND instruction in a series is the first condition on the instruction
line.
Each AND NOT instruction in a series would take the logical AND between
its execution condition and the inverse of its operand bit.
When two or more conditions lie on separate instruction lines running in par-
allel and then joining together, the first condition corresponds to a LOAD or
LOAD NOT instruction; the rest of the conditions correspond to OR or OR
NOT instructions. The following example shows three conditions which corre-
spond in order from the top to a LOAD NOT, an OR NOT, and an OR instruc-
tion. Again, each of these instructions requires one line of mnemonic code.
Instruction
0100
LR 0000
0000
Address
Instruction
Operands
000
LD
0000
001
OR NOT
0100
002
OR
LR
0000
003
Instruction
The instruction would have an ON execution condition when any one of the
three conditions was ON, i.e., when bit 0000 was OFF, when bit 0100 was
OFF, or when LR 0000 was ON.
OR and OR NOT instructions can be considered individually, each taking the
logical OR between its execution condition and the status of the OR instruc-
tion’s operand bit. If either one of these were ON, an ON execution condition
would be produced for the next instruction.
When AND and OR instructions are combined in more complicated dia-
grams, they can sometimes be considered individually, with each instruction
performing a logic operation on the execution condition and the status of the
operand bit. The following is one example. Study this example until you are
convinced that the mnemonic code follows the same logic flow as the ladder
diagram.
Instruction
0002
0003
0000
0001
0100
Address
Instruction
Operands
000
LD
0000
001
AND
0001
002
OR
0100
003
AND
0002
004
AND NOT
0003
005
Instruction
Here, an AND is taken between the status of bit 0000 and that of bit 0001 to
determine the execution condition for an OR with the status of bit 0100. The
result of this operation determines the execution condition for an AND with
the status of bit 0002, which in turn determines the execution condition for an
AND with the inverse (i.e., and AND NOT) of the status of bit 0003.
In more complicated diagrams, however, it is necessary to consider logic
blocks before an execution condition can be determined for the final instruc-
tion, and that’s where AND LOAD and OR LOAD instructions are used. Be-
fore we consider more complicated diagrams, however, we’ll look at the in-
structions required to complete a simple “input-output” program.
3-4-4
OUTPUT and OUTPUT NOT
The simplest way to output the results of combining execution conditions is to
output it directly with the OUTPUT and OUTPUT NOT. These instructions are
OR and OR NOT
Combining AND and OR
Instructions
Basic Programming
Section 3-4