Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 313

Table of Contents

Advertisement

Precautions
• When ZCP(088)/ZCPL(116) is executed, the result is reflected in the Arithmetic Flags. Control the
desired output or right-hand instruction with a branch from the same input condition that controls
ZCP(088)/ZCPL(116), as shown in the following diagram.
• Do not program another instruction between ZCP(088)/ZCPL(116) and the instruction controlled by
the Arithmetic Flag because the other instruction might change the status of the Arithmetic Flag.
Example Programming
• When CIO 0.00 is ON in the following example, the 16-bit unsigned binary data in D0 is compared to
the range 0005 to 001F hex (5 to 31 decimal) and the result is output to the Arithmetic Flags.
CIO 20.00 is turned ON if 0005 hex
CIO 20.01 is turned ON if the content of D0 > 001F hex.
CIO 20.02 is turned ON if the content of D0 < 0005 hex.
0.00
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Arithmetic Flag
(Example: Equal Flag)
In this case, the Equals Flag and output A will be
turned ON when LL
Arithmetic Flag
(Example: Equal Flag)
In this case, the results of instruction B
might change the results of ZCP(088)/ZCPL(116).
content of D0
ZCP
D0
CD
0005Hex
#0005
LL
#001F
UL
20.00
0005Hex
=
20.01
>
20.02
<
ZCP
CD
LL
UL
A
CD
UL.
ZCPL
CD
LL
UL
Instruction
B
A
001F hex.
LL
CD
UL
D0
001FHex
D0
>
001FHex
D0
>
3. Instructions
3
Arithmetic Flags
=
ON(1)
>
ON(1)
<
ON(1)
277

Advertisement

Table of Contents
loading

Table of Contents