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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
Precautions
Examples
0.00
<
0.01
<S
0.00
0.01
214
Name
Not Equal Flag
Less Than Flag
Less Than or
Equal Flag
Input comparison instructions cannot be used as right-hand instructions, i.e.,
another instruction must be used between them and the right bus bar.
AND LESS THAN: AND<(310)
When CIO 0.00 is ON in the following example, the contents of D100 and
D200 are compared in as unsigned binary data. If the content of D100 is less
than that of D200, CIO 100.00 is turned ON and execution proceeds to the
next line. If the content of D100 is not less than that of D200, the remainder of
the instruction line is skipped and execution moves to the next instruction line.
100.00
D100
D200
100.01
D110
D210
AND SIGNED LESS THAN: AND<S(312)
When CIO 0.01 is ON in the following example, the contents of D110 and
D210 are compared as signed binary data. If the content of D110 is less than
that of D210, CIO 100.01 is turned ON and execution proceeds to the next
line. If the content of D110 is not less than that of D210, the remainder of the
instruction line is skipped and execution moves to the next instruction line.
100.00
D100
D200
100.01
D110
D210
Label
=
ON if S
S
with one-word data.
1
2
ON if S
+1, S
1
1
OFF in all other cases.
<
ON if S
< S
with one-word data.
1
2
ON if S
+1, S
< S
1
1
OFF in all other cases.
< =
ON if S
S
with one-word data.
1
2
ON if S
+1, S
1
1
OFF in all other cases.
S
: D100
Unsigned
1
LESS THAN
Comparison
Decimal: 34,580
Signed
S
: D110
1
LESS THAN
Comparison
Decimal:
Section 3-6
Operation
S
+1, S
with double-length data.
2
2
+1, S
with double-length data.
2
2
S
+1, S
with double-length data.
2
2
S
: D200
2
8714
3A1C
Decimal: 14,876
34,580 > 14,876
(Will not proceed to next line.)
S
: D210
2
8714
3A1C
30,956
Decimal:
30,956 < 14,876
(Will proceed to next line.)
14,876

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents