350
TEST, TESTP, DTEST, DTESTP
Program Example
(1) The following program resets the 8th bit of D8 (b8) to 0 when XB is OFF, and sets the 3rd bit of D8 (b3) to 1 when XB is
ON.
[Ladder Mode]
[List Mode]
[Operation]
Remark
Bit set or reset of word devices can also be conducted by bit designation of word devices.
• For the bit specification for word devices, link direct devices, refer to the QnUCPU User's Manual (Function Explanation,
Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program Fundamentals).
The processing of program example (1) would be conducted as shown below if bit designation of a word device had been
used:
: Number of the device where bit data to be extracted is stored (BIN 16 bits)
: Location of the bit data to be extracted (0 to 15 (TEST)/0 to 31 (DTEST)) (BIN 16/32 bits)
: Number of the bit device where the extracted data will be stored (bits)
TEST, TESTP, DTEST, Bit tests
DTESTP
7.4.2
TEST, TESTP, DTEST, DTESTP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
––
––
––
Resets
b8
of
D8
.
Sets
b3
of
D8
.
Step
Instruction
Device
0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1
D8
b15
b8
b0
b3
Before
execut
i
on
0 0 1 1 0 1 0 0 1 1 1 1 1 0 0 1
D8
b15
b8
b0
b3
After
execut
i
on
W
hen
XB
turns
O
FF.
W
hen
XB
turns
O
N.
XB
XB
D8.3
D8.8
SET
RST
Resets b8 of D8.
Designation of b8 of D8
Sets b3 of D8.
Designation of b3 of D8
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
TEST, DTEST
TESTP, DTESTP
S1
S2
S1
S2
D
D
indicates an instruction s
y
mbol of TEST/DTEST.
S1
S2
D
S1
S2
D