Indexing; Indexing In Basic Instructions - Mitsubishi Electric MELSEC-Q Structured Programming Manual

Hide thumbs Also See for MELSEC-Q:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
[Device & Common]
3.7

Indexing

The functions and structures of index registers are explained in detail in "2.10 Index Register [V and Z]".
Refer to this section in advance.
3.7.1

Indexing in basic instructions

Only FX
/FX
3U
3UC
In the case of bit devices
Bit devices [X, Y, M (except special auxiliary relays), T and C (C0 to C199)] used in the LD, LDI, AND, ANI,
OR, ORI, OUT, SET, RST, PLS and PLF instructions can be indexed with index registers.
The right figure shows an example of the indexing
operation using the index register Z(0) for X000
and M0 in the LD instruction.
Transfer "K5" or "K10" in advance to the index
register Z(0).
If Z(0) is "5", "X(0+5) = X005" and "M(0+5) = M5".
When X005 turns ON, Y000 turns ON. When M5
turns ON, Y001 turns ON.
If Z(0) is "10", "X(0+10) = X012
M10". When X012
When M10 turns ON, Y001 turns ON.
*1.
Refer to the caution 3) below.
• Index registers Z0 to Z7 and V0 to V7 can be
used for indexing.
• In the OUT instruction for a timer or counter, the
timer number (or counter number) and the
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 allowed to use 16-bit counters as 32-bit counters by indexing.
3) When the 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 to K0, K8 and K16,
the input X000 gets addition of the device number converted into octal in the way "X000 + 0 = X000",
"X000 + 8 = X010" and "X000 + 16 = X020", and the input number is changed accordingly.
In the case of word devices and constants
The set value of word devices (T and C (00 to 199)) used in the OUT instruction can be indexed with index
registers.
The right figure shows an example of the indexing
operation in which the set value D0 of T0 used in
the OUT instruction is indexed with an index
register V2.
Transfer K0 or K10 to the index register V2 in
advance.
When X001 is set to ON and if V2 is "0", T0
operates with the set value D0 (D (0+0) = D0).
When X001 is set to ON and if V2 is "10", T0
operates with the set value D10 (D (0+10) = D10).
Cautions
1) When a 32-bit counter is used in the OUT instruction, the set value cannot be indexed with index
registers.
PLCs support this function.
*1
" and "M(0+10) =
*1
turns ON, Y000 turns ON.
3 How to Specify Devices and Constants in Instructions
X030
EN
s
K5
X030
EN
s
K10
X000Z(0)
Y000
M0Z(0)
Y001
Z(0)=5 : X005 = ON
Y000 = ON
M5 = ON
Y001 = ON
*2
Z(0)=10 : X012 = ON
Y000 = ON
M10 = ON
Y001 = ON
*2 Refer to the caution 3) below.
X030
EN
s
K0
X030
EN
s
K10
OUT_T
X001
EN
TCoil
TC0
D0V2
TValue
V2=0 : The set value of T0 is the current value of D0.
V2=10 : The set value of T0 is the current value of D10.
3.7 Indexing
MOVP
ENO
K5
Z(0)
d
Z(0)
MOVP
ENO
K10
Z(0)
d
Z(0)
MOVP
ENO
K0
V2
d
V2
MOVP
ENO
K10
V2
d
V2
ENO
133
1
2
3
4
5
6
7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lMelsec-fFx3sFx3gFx3gcFx3u ... Show all

Table of Contents