133
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.7 Indexing
1
In
troduct
io
n
2
Ov
e
rv
ie
w
3
In
st
ru
ct
ion
Li
st
4
D
evi
ce
s
in
De
ta
il
5
Speci
fied t
h
e
D
evi
ce &
C
onst
a
nt
6
Bef
o
re
Pr
ogr
a
m
m
ing
7
Bas
ic
In
st
ru
cti
o
n
8
FNC0
0
-FNC0
9
P
ro
g
ra
m F
lo
w
9
FNC1
0
-FNC1
9
M
ov
e
&
C
om
par
e
10
FNC
20-
FNC
2
9
Ar
ith.
&
Logi
c
O
per
at
io
n
5.7
Indexing
The functions and structures of index registers are explained in detail in "4.10 Index Register [V and Z]".
Refer to Section 4.10 in advance.
5.7.1
Indexing in basic instructions
In the case of bit devices
Bit devices [X, Y, M (except special auxiliary relays), T, and C (C0 to C199)] used in LD, LDI, AND, ANI, OR,
ORI, OUT, SET, RST, PLS, and PLF instructions can be indexed with index registers.
The figure shown on the right explains an indexing operation with
the index register Z(0) for X000 and M0 in LD instruction.
Transfer K5 or K10 to the index register Z(0) in advance.
If Z(0) is "5", "X(0+5) = X005" is realized. When X005 turns ON,
Y000 turns ON and "M(0+5) = M5" is realized. When M5 turns ON,
Y001 turns ON.
If Z(0) is "10", "X(0+10) = X012
*1
" is realized. When X012
*1
turns
ON, Y000 turns ON and "M(0+10) = M10" is realized. When M10
turns ON, Y001 turns ON.
*1.
Refer to the caution 3) below.
• The index registers Z0 to Z7 and V0 to V7 can be used for
indexing.
• In OUT instruction for a timer or counter, the timer number (or
counter number) and a device specified for the set value can be
indexed.
Cautions
1) 32-bit counters and special auxiliary relays cannot be indexed with index registers.
2) It is not permitted to use 16-bit counters as 32-bit counters by executing indexing.
3) When an octal device number of X or Y is indexed with an index register, the contents of the index
register are converted into octal, and then added to the device number.
For example, when the value of an index register added to the input X000 is changed in the order "K0
→
K8
→
K16", the device number converted into octal is added to the input X000 and the input number is
changed in the order "X(000+0) = X000
→
X(000+8) = X10
→
X(000+16) = X20".
In the case of word devices and constants
The set value of bit devices [T and C] used in OUT instruction can be indexed with index registers.
The indexing operation is explained in an example in which the set
value D0 of T0 used in the index register V2 indexes OUT
instruction(as shown in the right figure).
Transfer K0 or K10 to the index register V2 in advance.
When X001 is set to ON, "D(0+0) = D0" is realized if V2 is "0", and
T0 operates with the set value D0.
When X001 is set to ON, "D(0+10) = D10" is realized if V2 is "10",
and T0 operates with the set value D10.
Caution
1) When a 32-bit counter is used in OUT instruction, the set value
cannot be indexed with index register.
X030
FNC 12
MOVP
K5
Z(0)
K5
→
Z(0)
X030
K10
Z(0)
K10
→
Z(0)
X000Z(0)
Z(0)=5 : X005=ON
→
Y000=ON
M5=ON
→
Y001=ON
Z(0)=10 : X012
*2
=ON
→
Y000=ON
M10=ON
→
Y001=ON
FNC 12
MOVP
Y000
MOZ(0)
Y001
*2 Refer to the caution 3).
X030
FNC 12
MOVP
K0
V2
K0
→
V2
X030
K10
V2
K10
→
V2
X001
V2 = 0 : The set value of T0 is the
present value of D0.
V2 = 10 : The set value of T0 is the
present value of D10.
FNC 12
MOVP
T 0
D0V2