Omron C40K Video Game Controller User Manual


 
35
Both of the coding methods described above can also be used when using
both AND LD and OR LD, as long as the number of blocks being combined
does not exceed eight.
The following diagram contains only two logic blocks as shown. It is not nec-
essary to break block b down further, because it can coded directly using
only AND and OR.
0000 0001 0002 0003
0201
0101
0004
Block
a
Block
b
Address Instruction Operands
0000 LD 0000
0001 AND NOT 0001
0002 LD 0002
0003 AND 0003
0004 OR 0201
0005 OR 0004
0006 AND LD ---
0007 OUT 0101
Although the following diagram is similar to the one above, block b in the dia-
gram below cannot be coded without being broken down into two blocks
combined with OR LD. In this example, the three blocks have been coded
first and then OR LD has been used to combine the last two blocks followed
by AND LD to combine the execution condition produced by the OR LD with
the execution condition of block a.
When coding the logic block instructions together at the end of the logic
blocks they are combining, they must, as shown below, be coded in reverse
order, i.e., the logic block instruction for the last two blocks is coded first, fol-
lowed by the one to combine the execution condition resulting from the first
logic block instruction and the execution condition of the logic block third from
the end, and on back to the first logic block that is being combined.
0000 0001 0002 0003
0102
0004 0202
Block
a
Block
b
Block
b2
Block
b1
Address Instruction Operands
0000 LD NOT 0000
0001 AND 0001
0002 LD 0002
0003 AND NOT 0003
0004 LD NOT 0004
0005 AND 0202
0006 OR LD ---
0007 AND LD ---
0008 OUT 0102
When determining what logic block instructions will be required to code a dia-
gram, it is sometimes necessary to break the diagram into large blocks and
then continue breaking the large blocks down until logic blocks that can be
coded without logic block instructions have been formed. These blocks are
then coded, combining the small blocks first, and then combining the larger
blocks. AND LD and OR LD is used to combine either, i.e., AND LD or OR
LD always combines the last two execution conditions that existed, regard-
less of whether the execution conditions resulted from a single condition,
from logic blocks, or from previous logic block instructions.
When working with complicated diagrams, blocks will ultimately be coded
starting at the top left and moving down before moving across. This will gen-
erally mean that, when there might be a choice, OR LD will be coded before
AND LD.
Combining AND LD and
OR LD
Complicated Diagrams
The Ladder Diagram Section 4-3