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.

Incorrect Use

=

=

CMP

0010

D00100

Reflects CMP execution results.

MOV

(1)

0200

D00200

Reflects MOV execution results.

MOV

(2)

0300

D00300

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.

Correct

Use

=

=

A

B

CMP

#0010

D00100

A

B

MOV

#0200

D00200

MOV

#0300

D00300

283

Page 306
Image 306
Omron FQM1-CM001, FQM1-MMA21, FQM1-MMP21 operation manual Cmp, Mov