Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
8 Applied Instructions (Move and Compare)
8.8 XCH / Exchange
158
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation(XCH, XCHP)
Data is exchanged between the device specified by and the device specified by .
2. 32-bit operation(DXCH, DXCHP)
Data is exchanged between the device specified by and the device specified by .
Extension function
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 each other.
(The FX
U PLC of V2.30 or earlier does not support the extension function.)
This is the same operation as SWAP instruction, so use SWAP instruction for newly programming.
In the case of 32-bit operation, high-order 8 bits (byte) and low-order 8 bits (byte) of a word device are
changed.
Cautions
1) Some restrictions to applicable devices
S1:The FX
3U and FX3UC PLCs only are applicable.
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 numbers specified by and are different.
XCH
EN ENO
d1
d2
Command
input
Data exchanged 1
Data exchanged 2
d1 d2
Before execution After execution
K10
K36
K36
K10
Exchange
d1
d2
d1
d2
K10000
K1433600
K1433600
K10000
DXCH
EN ENO
d1
d2
+1,
+1,
d1 d2
d1
d2
+1,
d1 d1
+1,
d2 d2
+1,
d1 d1
+1,
d2 d2
Command
input
Before execution After execution
Exchange
Data exchanged 1
Data exchanged 2
M8000
SWAP
High-order
8 bits
Low-order
8 bits
D 11
High-order
8 bits
Low-order
8 bits
D 10
X000
DXCH
EN ENO
d1
d2
D10
D10
M8160
M8160