5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-95
API
Applicable model
20PM
110
D
D
ECMP
P
P
Comparing binary floating-point values
Bit device Word device
X Y M S F H KnX KnY KnM KnS T C D V Z
S1
*
*
S2
*
*
D
* * *
Note: Please refer to specifications for more information about device
ranges.
Only the 32-bit instructions DECMP and DECMPP are valid.
The operand D occupies three consecutive devices.
F represents a floating-point value. There is a decimal point in a
floating-point value.
16-bit instruction
- - - -
32-bit instruction (9 steps)
DECMP
Continuity
instruction
DECMPP
Pulse
instruction
Flag: None
Explanation
S
1
: Binary floating-point value 1; S
2
: Binary floating-point value 2; D:
Comparison result (D occupies three consecutive devices.)
The instruction is used to compare the binary floating-point value in S
1
with that
in S
2
. The comparison result (>, =, or<)is stored in D.
If S
1
is a floating-point value, the instruction will be used to compare the S
1
with
the binary floating-point value in S
2
. If S
2
is a floating-point value, the
instruction will be used to compare the binary floating-point value in S
1
with S
2
.
Example
If the operand D is M10, M10, M11, and M12 will be occupied automatically.
When X0 is ON, the instruction DECMP is executed, and M10, M11, or M12 is
ON. When X0 is OFF, the execution of the instruction DECMP stops, and the
states of M10, M11, and M12 remain unchanged.
If users want to get the result that the value in (D1, D0)≧ the value in (D101,
D100), they have to connect M10 and M11 in series. If users want to get the
result that the value in (D1, D0)≦ the value in (D101, D100), they have to
connect M11 and M12 in series. If users want to get the result that the value in
(D1, D0)≠the value in (D101, D100), they have to connect M10, M11, and M12
in series.
If users want to reset M10, M11, or M12, they can use the instruction RST or
ZRST.
X0
DECMP D0 D100 M10
M10
M11
M12
If the value in (D1, D0)>the value in (D101, D100), M10 will be ON.
If the value in (D1, D0)=the value in (D101, D100), M11 will be ON.
If the value in (D1, D0)<the value i n (D101, D100), M12 will be ON.
Additional
remark
Please refer to section 5.3 for more information about performing operations
on floating-point values.