Mitsubishi Electronics FX3G User Manual

Page of 964
164
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.7 Indexing
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.
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)