169
FX3G/
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
Introduction
2
Overview
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
In the case of constants
The indexing operation is explained in an example in which the
transfer destination in MOV instruction is indexed with the index
register V6 (as shown in the figure on the right).
Transfer K0 or K20 to the index register V6 in advance.
When X005 is set to ON, "K(6+0) = K6" if V6 is "0", and K6 is
transferred to D10.
When X005 is set to ON, "K(6+20) = K26" if V6 is "20", and K26 is
transferred to D10.
5.7.3 Indexing example for instruction with limited number of use.
By modifying the target device numbers using index registers V and Z, the target device numbers can be
changed using the program. In this way, an instruction with a limited number of uses per program can be
used with multiple devices.
Example using the TKY instruction (FNC 70)
Two groups of key entries (numeric keypad from 0 to
9) store the input data to D0 and D2. Although the
TKY instruction (FNC 70) can only be programmed
once, modifying the head device number of the input
data, storage destination and pressed key
information, the information can be input from the
two groups of keys (numeric keypad from 0 to 9).
Furthermore, even if V is changed while this
instruction is being executed, this change is invalid.
The change is invalid until the instruction is no longer
being driven.
X004
K0 V6
K0
→
V6
X004
K20 V6
K20
→
V6
X005
K6V6 D10
V6=0 : K6 (K6+0)
→
D10
V6=20 : K26(K6+20)
→
D10
FNC 12
MOVP
FNC 12
MOVP
FNC 12
MOVP
X010
K0 V0
X012
X013
FNC 70
TKY
X000V0 D0V1 M0V2
(K0)
→
(V0)
(K0)
→
(V1)
FNC 12
MOVP
TKY
Instruction
Input Data
Head
Device
Number
Data
Storage
Destinati
on
Head Device
Number of
Pressed Key
Information
K0 V1
FNC 12
MOVP
K0 V2
FNC 12
MOVP
(K0)
→
(V2)
K16 V0
(K16)
→
(V0)
(K2)
→
(V1)
FNC 12
MOVP
K2 V1
FNC 12
MOVP
K20 V2
FNC 12
MOVP
(K20)
→
(V2)