6. BASIC INSTRUCTIONS
6 − 2
MELSEC-A
6.1 Comparison Operation Instructions
(1) The comparison operation instructions make numerical magnitude comparisons
(such as =, >, and <) between two pieces of data. They are handled as a contact,
and turn on when their preceding condition holds.
(2) The application of comparison operation instruction is the same as that of the
contact instruction for the corresponding sequence instruction as indicated
below:
• LD, LDI: LD =, LDD =
• AND, ANI: AND =, ANDD =
• OR, ORI: OR =, ORD =
(3) The comparison operation instructions are available in the following 36 types:
Classifica-
tion
Instruction
Symbol
Ref. Page
Classifica-
tion
Instruction
Symbol
Ref. Page
Classifica-
tion
Instruction
Symbol
Ref. Page
LD= LD> LD<
AND= AND> AND<
OR=
6-4
OR>
6-4
OR<
6-4
LDD= LDD> LDD<
ANDD= ANDD> ANDD<
=
ORD=
6-6
>
ORD>
6-6
<
ORD<
6-6
LD<> LD<= LD>=
AND<> AND<= AND>=
OR<>
6-4
OR<=
6-4
OR>=
6-4
LDD<> LDD<= LDD>=
ANDD<> ANDD<= ANDD>=
≠
ORD<>
6-6
≤
ORD<=
6-6
≥
ORD>=
6-6
(4) The conditions, by which the comparison operation instructions turn on, are as
shown below.
Dn=K100 OFF ON OFF
Dn≠K100
ON OFF ON
Dn>K100 OFF ON
Dn≤K100
ON OFF
Dn<K100 ON OFF
Dn≥K100
OFF ON
98 99 100 101 102