6-6
6.1 Comparison Operation Instructions
6.1.2 32-bit BIN data comparison
D=,
D<>,
D<=,
D<,
D>=,
D>
(2) The results of the comparison operations for each instruction are as follows.
(3) When assigning hexadecimal constants to
and
, and the numeric value (8 to F) whose
most significant bit (b31) is 1 is specified as a constant, the value is considered as a
negative BIN value in comparison operation.
(4) Data used for comparison should be specified by a 32-bit instruction (such as DMOV
instruction).
If specification is made with a 16-bit instruction (such as MOV instruction), comparisons of
large and small values cannot be performed correctly.
O
p
erat
i
on
E
rror
No operation error occurs in the execution of the D=, D<>, D<=, D<, D>=, and D> instructions.
Program
E
xam
pl
e
(1) In the following program, the value in Var_D0 is compared with the value in Var_D3, and Y33
turns ON, when the value in Var_D0 and the value in Var_D3 are matched.
[Structured ladder]
(2) In the following program, the BIN value of 38000 is compared with the value in Var_D3 when
M3 is ON, and Y33 turns ON when the value in Var_D3 is other than 38000.
[Structured ladder]
Instruction
symbol in
Condition
Comparison result
Instruction
symbol in
Condition
Comparison result
D=
=
Conduction state
D=
Non-conduction
state
D<>
D<>
=
D<=
D<=
>
D<
<
D<
D>=
D>=
<
D>
>
D>
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
s
1
s
2
s
1
s
2
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......