6. BASIC INSTRUCTIONS
6
−
3
MELSEC-A
CAUTION
(1) The comparison instructions make the comparison, regarding the specified data as a BIN
value. For this reason, in the case of comparison made in BCD value or hexadecimal, when
a numeric value (8 to F) having 1 at the highest bit (B15 in a 16-bit instruction or B31 in a
32-bit instruction) is specifies, the comparison is made with the numeric value regarded as
the negative of the BIN value.
Example
Comparison with 4-digit BCD value
Since the result is -30927<1384, Y10 does not turn ON.
(2) When the comparison of 32-bit data is made, specify the numeric value using the 32-bit
instruction such as DMOV. If a 16-bit instruction such as MOV is used, comparison cannot
be executed correctly.
Example
Regarded as
-30927 in
BIN value.
Regarded as
1384 in BIN
value.
(
)
(
)
M9036
K
DMOV 107 D0
D> D0
D10
M5
K
DMOV 79 D10
M9036
K
DMOV 256
D0
D> D0
D10
M5
K
MOV 86 D10
M5 turns ON.
Since values of 32-bit data D10 and D11
are determined by content of D11, the
comparison result is unknown.
Содержание MELSEC-A series
Страница 1: ......
Страница 2: ......
Страница 13: ...A 11 MEMO...
Страница 505: ...APPENDICES APP 100 MELSEC A MEMO...
Страница 507: ......
Страница 508: ......