86
4
4 Instructions4.3.1 Contact Comparison
AND
☼
: Data comparison
◆
Overview
The AND☼ instruction compares two operands and outputs the comparison result as a logical state. The
variables in comparison are processed as signed numbers.
AND
☼
S1 S2
Contact data
comparison
Applicable model:
H3U
S1 Comparand 1 Data source to be compared or data variable unit 1 16-bit instruction
(5 steps)
AND=:
Continuous
execution
32-bit instruction
(9 steps)
ANDD=:
Continuous
execution
S2 Comparand 2 Data source to be compared or data variable unit 2
Note:
The AND ☼ instruction is preceded by other logical operations.
It compares two operands and
outputs the comparison result as a logical state, which is used for a program ow operation. The
variables in comparison are processed as signed numbers. The
☼
comparison operator can be =, >, <,
>=, <=, or <>.
◆
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
Note: The elements in gray background are supported.
The following table lists the methods of AND contact comparison.
16-bit
Instruction
FNC NO
32-bit
Instruction
Enabled State
Condition
Disabled State
Condition
AND= 232 ANDD= S1 = S2 S1 ≠ S2
AND> 233 ANDD> S1 > S2 S1 <= S2
AND< 234 ANDD< S1 < S2 S1 >= S2
AND<> 236 ANDD<> S1 <> S2 S1 = S2
AND<= 237 ANDD<= S1 <= S2 S1 > S2
AND>= 238 ANDD>= S1 >= S2 S1 < S2
Example:
M20 = ON when X0 =
ON and D10 = K123.
Y10 = ON and remains in this state when X1 =
ON and
D10
< K5566.
Y12
= ON and remains in this state when D0 > K6 and
D10 >
K6789.
Y15 = ON and remains in this state when X
2 = ON and
C235 < K999999 or X3 = ON
.