5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-127
API
Applicable model
20PM
218~
220
D
D
AND#
Logical operation
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
S
1
* *
* * * * * * * * *
S
2
* *
* * * * * * * * *
Note: # represents &, |, or ^.
Please refer to specifications for more information about device
ranges.
16-bit instruction (5 steps)
AND#
Continuity
instruction
- -
32-bit instruction (7 steps)
DAND#
Continuity
instruction
- -
Flag: None
Explanation
The instruct
ion is used t
o compare the value in S
1
with that in S
2
. If the
comparison result is not 0, the condition of the instruction is met. If the
comparison result is 0, the condition of the instruction is not met.
S
1
: Source device 1; S
2
: Source device 2
The instruction AND# is connected t
o a contact in series.
API No.
16-bit
instruction
32-bit
instruction
ON OFF
218
AND& DAND&
S
1
&
S
2
0
S
1
&
S
2
0
219
AND| DAND|
S
1
|
S
2
0
S
1
|
S
2
0
220
AND^ DAND^
S
1
^
S
2
0
S
1
^
S
2
0
&: Logical AND operation
|: Logical OR operation
^: Logical exclusive OR operation
If a 32-bit counter is used, the 32-bit instruction DAND# must be used. If a 32-bit
counter and the 16-bit instruction AND# are used, a program error will occur, and
the ERROR LED indicator on the DVP-10PM series motion controller used will
blink. (C200~C255 are 32-bit counters.)
Example
When X0 is ON, a logical AND operator takes the values in C0 and C10, and
performs the logical AND operation on each pair of corresponding bits. If the
operation result is not 0, Y10 will be set to ON.
When X1 is OFF, a logical OR operator takes the values in D10 and D0, and
performs the logical OR operation on each pair of corresponding bits. If the
operation result is not 0, Y1 will be set to ON.
When X2 is ON, a logical XOR operator takes the values in (D201, D200) and
(D101, D100), and performs the logical exclusive OR operation on each pair of
corresponding bits. If the operation result is not 0, or if M3 is ON, M50 will be
ON.
M3
DAND
D200 D100
M50
AND
C0 C10
AND
D10 D0
SET
&
^
I
Y11
Y10
X0
X1
X2