Omron FQM1-CM001 Home Security System User Manual


 
283
Programming Appendix A
Example: The following example will move #0200 to D00200 if D00100 contains #0010 and move #0300
to D00300 if D00100 does not contain #0010.
The Equals Flag will turn ON if D00100 in the rung above contains #0010. #0200 will be moved to D00200
for instruction (1), but then the Equals Flag will be turned OFF because the #0200 source data is not 0000
hex. The MOV instruction at (2) will then be executed and #0300 will be moved to D00300. A rung will
therefore have to be inserted as shown below to prevent execution results for the first MOVE instruction
from being picked up.
CMP
0010
D00100
MOV
0200
D00200
MOV
0300
D00300
=
=
Incorrect
Use
(1)
(2)
Reflects MOV execution results.
Reflects CMP execution results.
CMP
#0010
D00100
MOV
#0200
D00200
MOV
#0300
D00300
B
A
A
B
=
=
Correct
Use