114
4
4 Instructions4.4.2 Logical Operations
4.4.2 Logical Operations
Logical operations
WAND Binary number logical AND
WOR Binary number logical OR
WXOR Binary number logical XOR
NEG Binary number negation
ENEG Binary oating-point sign negation
WAND: Binary number logical AND
◆
Overview
When driving conditions are met, the WAND instruction performs a logical AND on S1 and S2 bit by bit. The
result is stored in D.
WAND S1 S2 D
Binary number
logical AND
Applicable model:
H3U
S1 Data 1
Data in an AND operation, or address of the word
element that stores the data
16-bit instruction
(7 steps)
WAND:
Continuous
execution
WANDP: Pulse
execution
32-bit instruction
(13 steps)
DAND: Continuous
execution
DANDP: Pulse
execution
S2 Data 2
Data in an AND operation, or address of the word
element that stores the data
D
Operation
result
Address of the word element that stores the operation
result
◆
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 bit patterns of the BIN values in S1 and S2 are analyzed. The result of the logical AND analysis is
stored in the variable D.
The result of a logical AND operation is 0 if the value of either S1 or S2 is 0.
1•1 = 1 1•0 = 0 0•1 = 0 0•0 = 0