99
4
4 Instructions 4.3.2 Comparison Output
Example:
ǒDECMP D100 D200 M10Ǔ
X10
S1 S2 D
M10
M11
M12
Floating-point number (D101, D100) > (D201, D200), M10=ON
Floating-point number (D101, D100) < (D201, D200), M12=ON
Floating-point number (D101, D100) = (D201, D200), M11=ON
When X10 = ON, M10, M11, or M12 switches to ON.
The DECP instruction is not executed when X10 switches from ON to
OFF, and M10 to M12 remain in the state prior to X10 = OFF.
Use the RST or ZRST instruction to clear the comparison result of
M10 to M12.
Connect M10 to M12 in serial or parallel mode to acquire the ≥, ≤,
and ≠ results.
If the constant K or H is used as S1 or S2, the value is converted to a oating-point number before the
comparison operation.
ZCP: Range comparison
◆
Overview
When driving conditions are met, the ZCP instruction sets the end-address bit element D (D+1 or D+2) to
ON based on the range of the source address S (S < S1, S1 ≤ S ≤ S2, or S > S2).
ZCP S1 S2 S D
Range
comparison
Applicable model:
H3U
S1
Lower limit for range
comparison
Data, or address of the word element that
stores the data
16-bit instruction
(9 steps)
ZCP: Continuous
execution
ZCPP: Pulse
execution
32-bit instruction
(17 steps)
DZCP: Continuous
execution
DZCPP: Pulse
execution
S2
Upper limit for range
comparison
Data, or address of the word element that
stores the data
S
Comparative variable
Data, or address of the word element that
stores the data
D
Comparison result
Head address of three consecutive
elements that store the comparison result
(ON or OFF)
◆
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
S 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 ZCP instruction requires contact driving and has four operands. When the control ow is active, use
this instruction to algebraically compare operands as signed numbers. The comparison result is indicated
by the position of S within the range dened by S1 and S2 and stored in three consecutive bit variables
from head address D.