Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 277

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
Precautions
Example
0.00
3-6-12 DOUBLE AREA RANGE COMPARE: ZCPL(116)
Purpose
Ladder Symbol
Variations
244
Name
Equal Flag
Not Equal Flag
Less Than Flag
Less Than or Equal Flag
Negative Flag
Do not program another instruction between ZCP(088) and an input condition
that accesses the result of ZCP(088) because the other instruction might
change the status of the Arithmetic Flags.
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 100.00 is turned ON if 0005 hex
CIO 100.01 is turned ON if the content of D0 > 001F hex.
CIO 100.02 is turned ON if the content of D0 < 0005 hex.
ZCP
D0
CD
#5
LL
#1F
UL
100.00
=
100.01
>
100.02
<
Compares a 32-bit unsigned binary value (CD+1, CD) with the range defined
by lower limit (LL+1, LL) and upper limit (UL+1, UL). The results are output to
the Arithmetic Flags.
ZCPL(116)
CD: First word of Comparison Data
CD
LL: First word of Lower Limit
LL
UL: First word of Upper Limit
UL
Variations
Executed Each Cycle for ON Condition
Executed Once for Upward Differentiation
Executed Once for Downward Differentiation Not supported
Immediate Refreshing Specification
Label
=
ON if LL
CD
OFF in all other cases.
<>
Left unchanged.
<
ON if CD < LL.
OFF in all other cases.
< =
Left unchanged.
N
Left unchanged.
content of D0
LL
CD
D0
0005 hex
D0
>
D0
0005 hex
>
Section 3-6
Operation
UL.
001F hex.
UL
Arithmetic
Flags
001F hex
=
ON
>
ON
001F hex
<
ON
ZCPL(116)
Not supported
Not supported

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?

Questions and answers

Table of Contents