5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-44
API
Applicable model
20PM
27
D
D
WOR
P
P
Logical OR operation
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
S1
* *
* * * * * * * * *
S2
* *
* * * * * * * * *
D
* * * * * * * *
Note: The instruction supports V devices and Z devices. (If the 16-bit
instruction is used, Z devices can not be used. If the 32-bit
instruction is used, V devices can not be used.)
Please refer to specifications for more information about device
ranges.
16-bit instruction (7 steps)
WOR
Continuity
instruction
WORP
Pulse
instruction
32-bit instruction (9 steps)
DWOR
Continuity
instruction
DWORP
Pulse
instruction
Flag: None
Explanation
A logical OR operator takes the bina
ry representations in S
1
and S
2
, and
performs the logical inclusive OR operation on each pair of corresponding bits.
The operation result is stored in D.
S
1
: Source device 1; S
2
: Source device 2; D: Operation result
The result in each position is 1 if the first bit is 1, the second bit is 1, or both bits
are 1. Otherwise, the result is 0.
Example 1
When X0 is ON, a logical OR operator takes the values in the 16-bit device D0
and the 16-bit device D2, and performs the logical inclusive OR operation on
each pair of corresponding bits, and the operation result is stored in D4.
X0
WOR D0 D2 D4
Before the instruction
is executed
After the instruction
is executed
011111 1
0000 0 0 0111
00 00
11 1
WOR
b15 b0
S
1
S
2
D
D0
D2
D4
000000011
011111
111 1 11111
Example 2
When X1 is ON, a logical OR operator takes the values in the 32-bit device
(D11, D10) and the 32-bit device (D21, D20), and performs the logical inclusive
OR operation on each pair of corresponding bits, and the operation result is
stored in (D41, D40).
X1
DWOR
D10 D20 D40
Before the instruction
is executed
After the instruction
is executed
DWOR
b15 b0b31
S
1
S
2
D
D11 D10
D21 D20
D41 D40
11111111
0000
1111
000
00
11 111
111
00000000
11111
11111111 1111
000 00 000 0 00
0000
111 11 1 111 11111111 11 1 111 11
00