30
Programming Concepts Section 1-1
• Repeat for as many A to n blocks as are present.
Complex Rungs
5.00
a b
c n
A block B block C block n block
Z
0.00
0.03
0.01
0.02
102.04
0.050.04
0.070.06
0.00
0.03
0.01
0.02
Z0.00
Z
0.030.02 0.00
0.01
LD
LD
LD
AND
OR LD ---
AND LD ---
LD
AND
OR LD ---
LD
AND
OR LD ---
OUT
0.00
0.01
0.02
0.03
0.04
0.05
0.06
0.07
102.04
Instruction Operand
The diagram above is based on the diagram below.
A simpler program can be written by rewriting
this as shown below.
0.00
0.03
0.02 102.05
0.05
b
0.01
a d
0.04
0.06 0.07
e
c
0.00
0.03
0.02 102.05
0.03
0.01
0.00 0.050.04
0.060.04 0.070.00
LD
0.01
AND
LD
0.04
LD
LD
0.07
OR LD ---
AND LD ---
OR LD ---
AND LD ---
OUT
LD NOT
AND NOT
AND NOT
0.00
0.02
0.03
0.05
0.06
102.05
a
b
c
d
e
d + e
(d + e) · c
(d + e) · c + b
((d + e) · c + b) · a
Instruction Operand
Block
Block
Block Block
Block
The above rung can be rewritten as follows: