
Chapter 5. Application instructions
5-23
5.3.5
OR ( =, >, <, >=, <=, <>)
OR
(Parallel NO
contact with
comparison result)
FUN(188) OR=
FUN(189) ORD=
FUN(196) OR>
FUN(197) ORD>
FUN(198) OR<
FUN(199) ORD<
FUN(216) OR>=
FUN(217) ORD>=
FUN(218) OR<=
FUN(219) ORD<=
FUN(228) OR<>
FUN(229) ORD<>
Applicable
CPU
K200S
K300S
K1000S
Available Device
Flag
Instructions
M
P
K
L
F
T
C
S
D
#D Integer
Steps
Error
(F110)
Zero
(F111)
Carry
(F112)
O O O O O O O
O
O
O
OR
ORD
O O O O O
O
O
O
O
O
5 / 9
O
1) Functions
-
Compares contents of [ S1 ] and [ S2 ], then operates as a parallel NO contact according to the
comparison operation result. The comparison is executed as signed operation.
-
The comparison operation result is as shown below :
Instruction
symbol in
Condition
Comparison
operation
result
Instruction
symbol in
Condition
Comparison
operation
result
=
S
1
=
S
2
=
S
1
≠
S
2
<=
S
1
≤
S
2
<=
S
1
>
S
2
>=
S
1
≥
S
2
>=
S
1
<
S
2
< >
S
1
≠
S
2
< >
S
1
=
S
2
<
S
1
<
S
2
<
S
1
≥
S
2
>
S
1
>
S
2
On
>
S
1
≤
S
2
Off
2) Program example
a) Compare P0000 ~ P000F and D0001. If their values are equal or M000 is on, P0010 bit will be
switched on.
b) Compare 1000 and contents of D0001 and D0002 (32 bits). If the content of D0001 and D0002 is less
than 1000 or M020 is on, P0010 will turn on.
Operand setting
S1
S2
Data to be compared
S1
S2
= P000 D0001
(
P0010
)
M000
D>= 1000 D0001
(
P0010
)
M020
S1
S2
S1
S2
D