Mitsubishi Electronics FX3G User Manual

Page of 964
253
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
9 Move and Compare – FNC 10 to FNC 19
9.4 FNC 13 – SMOV / Shift Move
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
Explanation of function and operation
1. 16-bit operation (SMOV and SMOVP)
The contents of the transfer source 
 and transfer destination 
 are converted into 4-digit BCD (0000 to
9999) respectively.  "m2" digits starting from the "m1"th digit are transferred to the transfer destination 
 starting
from the "n"th digit, converted into binary, and then stored to the transfer destination 
• While the command input is OFF, the transfer destination 
 does not change.
• When the command input turns ON, only the specified digits in the transfer destination 
 are changed.  The 
transfer source 
 and unspecified digits in the transfer destination 
 do not change.
[1]
 is converted from binary into BCD.
[2] "m2" digits starting from the "m1"th digit are 
transferred to 
’ starting from the "n"th 
digit.
The digits of 10
3
 and 10
0
 of 
’ are not 
affected even if data is transferred from 
’.
[3] The composed data (BCD) is converted into 
binary, and stored to 
.
2. Extension function
When M8168 is set to ON first and then SMOV instruction is executed, conversion from binary to BCD is not executed.
Data is moved in units of 4 bits.
Program example
The data on three-digit digital switches are composed, and stored as binary data to D2.
   
S
   
D
   
D
   
D
   
D
   
D
   
S
   
D
FNC 13
SMOV
m1
m2
n
Command
input
4th digit
1st digit
2nd digit
3rd digit
10
0
10
1
10
2
10
3
10
0
10
1
10
2
10
3
Do not change.
(16-bit binary data)
Data is automatically
converted. [1]
'  (4-digit BCD data)
Digits are moved. [2]
'  (4-digit BCD data)
Data is automatically
converted. [3]
(16-bit binary data)
In the case of "m1 = 4,
m2 = 2, n = 3".
Command contact = ON
   
S
   
D
   
D
   
S
   
D
X010
M8168
M8168
X010
FNC 13
SMOV
D  1
K  4
K  2
D  2
K  3
 
 M8168 is used for other instructions also.
After using M8168 for SMOV instruction, return it to OFF.
FNC 13
SMOV
D  1
K  1
K  1
D  2
K  3
FNC 19
BIN
K2X020
D  2
FNC 19
BIN
K1X000
D  1
(X020 to X027) 2-digit BCD
→ D2 (binary)
(X000 to X003) 1-digit BCD
→ D1 (binary)
Data on three digital switches
connected to non-consecutive input
terminals are composed.
PLC
X003 to X000
X027 to X020
8
1
8
1
8
1
6
5
7
10
2
10
1
10
0
1-digit BCD data of D1 is transferred to
the 3rd digit (BCD data) of D2, and
automatically converted into binary data.
M8000