91
2
3
4
5
6
7
8
3.3
Indexing
3.3
Indexing
(1) Overview of indexing
(a) Indexing is an indirect setting made by using an index register.
When an Indexing is used in a sequence program, the device to be used will become the device number specified
directly plus the contents of the index register.
For example, if D2Z2 has been specified, the specified device is calculated as follows: D(2+3) = D5 and the content
of Z2 is 3 become the specified device.
(b) Indexing with 32-bit index registers in addition to 16-bit index registers is available with the Universal model QCPU
and LCPU.
(2) Indexing with 16-bit index registers
(a) Example of indexing
Each index register can be set between -32768 and 32767.
Indexing is performed in the way shown below:
(b) Devices to which indexing can be used
With the exception of the restrictions noted below, Indexing can be used with devices used with contacts, coils,
basic instructions, and application instructions.
1) Devices to which indexing can not be used
*1:
SFC transfer devices and SFC block devices are devices for SFC use.
Refer to the manual below for how to use these devices.
• MELSEC-Q / L / QnA Programming Manual (SFC)
2) Devices with limits for use with index registers
Device
Meaning
E
Floating decimal point data
$
Character string data
.
Bit designated for word device
FX, FY, FD
Function devices
P
Pointers used as labels
I
Interrupt pointers used as labels
Z
Index register
S
Step relay
TR
SFC transfer devices*1
BL
SFC block devices*1
Device
Meaning
Application Example
T
• Only Z0 and Z1 can be used for timer
contacts and coils.
C
• Only Z0 and Z1 can be used for
counter contacts and coils.
X0
MO
V
K
Z0
X0
MO
V
D10Z0
D0
In
d
exin
g
S
t
o
res -
1
at
Z0
.
S
t
o
res the
d
ata
o
f
D10Z0
=
D
{
10
+
(
-
1)
} =
D9
at
D0
.
1
T0Z0
T1Z1
K100
C0Z1
C1Z0
K100