7 APPLICATION INSTRUCTIONS
7.4 Bit Processing Instructions
415
7
• There is no operation error in the TEST(P) or DTEST(P) instruction.
• The following program turns M0 ON or OFF based on the status of the 10th bit in the 1-word data block (D0).
• The following program turns Y40 ON or OFF, depending on the status of the 19th bit of the 2-word data (W0 and W1).
Programs using the bit test instruction can be rewritten as programs using bit designation of word devices.
The program example of the TESTP instruction would be conducted as shown below if bit designation of a
word device had been used:
[Ladder Mode] [List Mode]
[Operation]
[Ladder Mode] [List Mode]
[Operation]
Step Instruction Device
1
0
1 1
0 0
1 1
0
1 1
0
1
0
1
0
D0
b0b15 b10
Turns M0 OFF since b10 is "0."
0 0
1
0 0
1 1 1 1
0
1
0
0 0 0
1
D0
b0b15 b10
Turns M0 ON since b10 is "1."
1 0 1 1 0 0 1 0 1 0 110 0 00
b31b19
Turns Y40 OFF since b19 is "0."
1 0 1 1 0 1 1 1 0 1 110 1 10
b0
b15b16
0
1 1
0
1 1
0
1 1 1
0
1
1
0 0
1
b31b19
Turns Y40 ON since b19 is "1."
1
0
1
0
1 1
0 0 0 0
1
0
1 1
0
1
b0
b15b16
M0
D0.A
Designation of b10 of D0
M0 turns ON/OFF depending on the ON/OFF
status of b10 of D0 (D0.A).