FX Series Programmable Controlers Applied Instructions 5
5-25
5.2.8 XCH (FNC 17)
Mnemonic Function
Operands
Program steps
D
1 D2
XCH
FNC 17
(Exchange)
Data in the
designated
devices is
exchanged
KnY, KnM, KnS, T, C, D, V, Z
Note: when using the byte XCH (i.e.M8160 is
ON) D
1 and D2 must be the same device other-
wise a program error will occur and
M8067 will be turned ON
XCH,XCHP:
5steps
DXCH, DXCHP:
9steps
FX
1S
FX1N FX2N
FX2NC
X0
XCH(P) D 1 D 17
[ D1 ] [ D2 ]
X20
DXCH(P)
D 10 D 10
[ D1 ] [ D2 ]
M8160
M8000
M8160
Data register Before XCH After XCH
D1
D17
20
530
530
20
Operation 1: The contents of the two destination devices D1 and D2 are swapped, i.e. the
complete word devices are exchanged. Ex.
Operation 2: This function is equivalent to FNC 147 SWAP The bytes within each word of the designated
devices D
1 are exchanged when ‘byte mode flag’ M8160 is ON. Please note that the mode will remain
active until it is reset,
i.e. M8160 is forced OFF. Ex.
D10
Byte 1 1F
H
8B
H
Byte 1
D11
Byte 1
Byte 1
8B
H
C4
H
35
H
1F
H
35
H
C4
H
ValuesareinHexforclarity Before DXCH After DXCH
PULSE-P
16 BIT OPERATION
32 BIT OPERATION