Mitsubishi MELSEC-Q/L Programming Manual page 353

Table of Contents

Advertisement

Function
TEST
(1) Fetches bit data at the location designated by
designated by
.
D
(2) The bit device designated by
(3) The position designated by
more is designated at
S2
n
18, the target is the data at b2 since the remainder of 18 / 16
DTEST
(1) Fetches bit data at the location designated by
bit device designated by
(2) The bit device designated by
(3) The position designated by
more is designated at
S2
n
34, the target is the data at b2 since the remainder of 34 / 32
b31
Operation Error
(1) There is no operation error in the TEST(P) or DTEST(P) instruction.
Program Example
(1) The following program turns M0 ON or OFF based on the status of the 10th bit in the 1-word data block (D0).
[Ladder Mode]
[Operation]
b15
b10
D0
1 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0
b15
b10
D0
0 0 1 0 0 1 1 1 1 0 1 0 0 0 0 1
within the word device designated by
S2
is OFF when the relevant bit is "0" and ON when it is "1".
D
indicates the position of an individual bit in a 1-word data block (0 to 15). When 16 or
S2
, the target is the bit data at the position indicated by the remainder of n / 16. For example, when
S2
b15
S 1
within the 2-word device designated by
S2
.
D
is OFF when the relevant bit is "0" and ON when it is "1".
D
indicates the position of an individual bit in a 2-word data block (0 to 31). When 32 or
S2
, the target is the bit data at the position indicated by the remainder of n / 32. For example, when
S2
(When
=21)
bit
S2
b21
b16
b15
S 1 +1
[List Mode]
Step
b0
Turns M0 OFF since b10 is "0."
b0
Turns M0 ON since b10 is "1."
TEST, TESTP, DTEST, DTESTP
1 is "2".
(When
=5)
bit
S2
b5
b0
D
1 is "2".
b0
S 1
Instruction
Device
, and writes it to the bit device
S1
, or
+1, and writes it to the
S1
S1
D
351
1
2
3
4
4
6
7
8

Advertisement

Table of Contents
loading

Table of Contents