Mitsubishi Electronics FX3G User Manual

Page of 964
133
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
4 Devices in Detail
4.9 Data Register and File Register [D]
1
Introdu
ction
2
Ov
ervi
ew
3
Instruction 
Li
st
4
D
evices 
in Det
ai
l
5
Specifi
ed the
De
vice
 &
 
C
onst
ant
6
Bef
ore
 
Pr
og
ra
mmi
ng
7
Bas
ic 
Instruction
8
FN
C00-FN
C0
9
Program Fl
ow
9
FNC
10-FN
C19
Mov
e & Com
pare
10
FNC
20-FNC
29
Arith. & Lo
gi
Operati
on
3. Operation examples
Data registers can be used in various control with numeric data.
This section explains the operations of representative basic instructions and applied instructions among various
applications.
For the full use of data registers, refer to the explanation of applied instructions later.
1) Data registers in basic instructions
Specifying the set value of a timer or counter
2) Data registers using applied instructions
Operation examples using MOV (FNC 12) instruction
a) Changing the current value of a counter
b) Reading the current value of a timer or counter to a data register
c) Storing a numeric value to data registers
d) Transferring the contents of a data register to another data register
3) Using unoccupied timers and counters as data registers
Operation examples using MOV (FNC 12) instruction
Timers and counters not in a program can be used as devices for storing 16-bit or 32-bit numeric values (data
registers).
As in the case of data registers, when 16-bit timers or counters are used as 32-bit devices, two timers or two
counters (example: C1 and C0) store 32-bit numeric data.
One 32-bit counter (example: C200) can store 32-bit numeric data.
T  2
D 0
C 10
D 20
A counter or timer operates while regarding the
contents of a specified data register as its set value.
FNC 12
MOV
D  5
C  2
The current value of the counter C2 is changed to
the contents stored in D5.
FNC 12
MOV
C 10
D  4
The current value of the counter C10 is transferred
to D4.
FNC 12
MOV
K200
D 10
16-bit
FNC 12
DMOV
K80000 D10(D11)
"200 (decimal value)" is transferred to D10.
"80000 (decimal value)" is transferred to D10 and D11.
Because a numeric value larger than 32767 is 32-bit
data, a 32-bit operation is required.  When a data
register on the low-order side (D10) is specified, a
data register on the high-order side (D11) is
automatically occupied.
32-bit
FNC 12
MOV
D 10
D 20
The contents of D10 are transferred to D20.
FNC 12
MOV
K300
T 10
FNC 12
MOV
T 10
C 20
K300
C 20
"300 (decimal value)" is transferred to T10.
The contents of T10 are transferred to the current
value register of C20.
In this case, T10 is not working as a timer, but is
working as a data register.