115
4
4 Instructions 4.4.2 Logical Operations
◆
Application
WAND D 20
S1 .
D 22 D 24
S2 . D .
0 10110100 0 1 0 0 0 1 1
0 11110010 1 0 1 0 0 1 0
0 10110000 0 0 0 0 0 1 0
D20
D22
D24
Logical AND
M20
WOR: Binary number logical OR
◆
Overview
When driving conditions are met, the WOR instruction performs a logical OR on S1 and S2 bit by bit. The
result is stored in D.
WOR S1 S2 D
Binary number
logical OR
Applicable model:
H3U
S1 Data 1
Data in an OR operation, or address of the word element
that stores the data
16-bit instruction
(7 steps)
WOR:
Continuous
execution
WORP: Pulse
execution
32-bit instruction
(13 steps)
DOR: Continuous
execution
DORP: Pulse
execution
S2 Data 2
Data in an OR 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 OR analysis is stored
in the variable D.
The result of a logical OR operation is 0 if the value of either S1 or S2 is 0.
1 + 1 = 1 1 + 0 = 1 0 + 1 = 1 0 + 0 = 0