
Chapter 5. Application instructions
5-129
5.20.2 BAND, BANDN
BAND
(Bit AND)
FUN(250) BAND
FUN(251) BANDN
Applicable
CPU
K200S
K300S
K1000S
Available Device
Flag
Instructions
M
P
K
L
F
T
C
S
D
#D Integer
Steps
Error
(F110)
Zero
(F111)
Carry
(F112)
O O
BAND
BANDN
O
5
O
1) Functions
-
BAND : A series connection of a NO contact. Reads the on/off status of the n
th
bit from the bit 0 of
[ D ] and performs the AND operation with previous result, and use it as an new operation result.
-
BANDN : A series connection of a NC contact. Reads the on/off status of the n
th
bit from the bit 0 of
[ D ] and performs the AND operation with previous result, and use it as an new operation result..
2) Program example
-
Program that turns on P001A and P001B according to the status of bit 1 and bit 8 of the D0003
word.
Operand setting
B
BN
D
D
The start address of source
data
D
n
n
Offset from the bit 0 to the
destination bit
n
n
D
1
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
bit 0
bit 1
bit 2
bit 3
bit 4
bit n
D
1
0
1
D +1
MOV h0F0F D0003
M0000
MOV hF0F0 D0003
M0000
B D0003 00001
( P001A )
M0001
BN D0003 00008
( P001B )
M0000 P001A P001B
0
0
1
1
1
0
Result (M0001=1)