98
4
4 Instructions4.3.2 Comparison Output
Example:
…
M0 = ON when K100 > C23's current value.
M0
ǒCMP K100 C23 M0 Ǔ
S1 S2 D
M1 = ON when K100 = C23's current value.
M2 = ON when K100 < C23's current value.
…
…
M1
M2
X0
M0, M1, or M2 = ON when X0 = ON.
The CMP instruction is not executed when X0 switches from ON
to OFF, and M0 to M2 remain in the state prior to X0 = OFF. Use
the RST or ZRST instruction to clear the comparison result of M0
to M2.
Connect M0 to M2 in serial or parallel mode to acquire the ≥, ≤,
and ≠ results.
ECMP: Binary oating point comparison
◆
Overview
The ECMP instruction compares the values of two oating-point variables and outputs the comparison
result to three variables from head address D.
ECMP S1 S2 D
Binary oating
point comparison
Applicable model:
H3U
S1 Comparand 1 Binary oating-point number 1 to be compared
32-bit instruction
(13 steps)
DECMP:
Continuous
execution
S2 Comparand 2 Binary oating-point number 2 to be compared
D
Comparison
result
Comparison result storage unit, which occupies three
(bit) variables
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The values of two oating-point variables are compared. The comparison result is output to three variables
from head address
.