7.4 Bit Processing Instructions
7.4.2 Bit test
7-55
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
TEST
, DTES
T
TEST, DTEST
[ST]
TESTP(SM400,Var_D0,10,Var_M0);
[Operation]
(2) In the following program, Var_M0 is turned ON or OFF, depending on the status of the 19th bit
of the 2-word data (Var_W0).
[Structured ladder]
[ST]
DTESTP(SM400,Var_W0,19,Var_M0);
[Operation]
Remark
Programs using the bit test instruction can be rewritten as programs using bit
specification for word devices.
If the program in example (1) were changed to use bit specification for word
devices, it would appear as follows.
1 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0
Var_D
0
b0
b15
b10
Turns Var_
M0
O
FF since
b10
is
0
.
0 0 1 0 0 1 1 1 1 0 1 0 0 0 0 1
Var_D
0
b0
b15
b10
Turns Var_
M0
O
N since
b10
is
1
.
1 0 1 1 0 0 1 0 1 0 1 1 0 0 0 0
b31
b19
Turns Var_
M0
O
FF since
b19
is
0
.
1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 0
b0
b15
b16
0 1 1 0 1 1 0 1 1 1 0 1 1 0 0 1
b31
b19
Turns Var_
M0
O
N since
b19
is
1
.
1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 1
b0
b15
b16
Var_
W0
Var_
W0
D
0
.
A
S
pecification of
b10
of D
0
M0
turns
O
N/
O
FF
d
epen
d
ing on the
O
N/
O
FF
status of
b10
of D
0
(
D
0
.
A)
.
O
UT
EN EN
O
d M0
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......