Mitsubishi Electronics FX3G User Manual

Page of 964
263
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.8 FNC 17 – XCH / Exchange
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
Extension function (function compatible between the FX
2
 Series and the FX
2C
 Series)
When the instruction is executed while M8160 is ON, high-order 8 bits (byte) and low-order 8 bits (byte) of a word
device are exchanged with each other.
Because this instruction works in the same way as SWAP (FNC147) instruction, use SWAP instruction when
programming a new exchange.
In a 32-bit operation, high-order 8 bits (byte) and low-order 8 bits (byte) of each word device are exchanged for each
other.
Error
An operation error occurs in the following case.  The error flag M8067 turns ON, and the error code is stored in D8067.
• When M8160 is ON, and the device number is different between 
 and 
M8000
FNC 17
DXCH
D10
D10
M8160
M8160
SWAP
X000
High-order 8 bits Low-order 8 bits
D11
High-order 8 bits Low-order 8 bits
D10
  
D
1
  
D
2