Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-131
5.13.1
SWAP (FNC 147)
Contents:
The upper byte and the lower byte of the source
device are swapped. 
This instruction is equivalent to operation 2 of FNC
17 XCH (see page 5-21).
Points to note:
a) In single word (16 bit) operation the upper and lower byte of the source device are
exchanged.
b) In double word (32 bit) operation the upper and lower byte of each or the two 16 bit devices
are exchanged.
Result of DSWAP(P) D10:
c) If the operation of this instruction is allowed to execute each scan, then the value of the
source device will swap back to its original value every other scan. The use of the pulse
modifier or an interlock program is recommended.
Mnemonic
Function 
Operands
Program steps
S
SWAP
FNC 147
(Byte
Swap)
The high and low
byte of the
designated
devices are
exchanged
KnY, KnM, KnS, T, C, D, V, Z 
SWAP,SWAPP
: 5 steps
DSWAP,
DSWAPP:
9 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X34
D10
SWAPP
D10
Byte 1
Values are in Hex for clarity
Byte 2
D11
Byte 1
Byte 2
Before DSWAP
After DSWAP
1F
H
8B
H
C4
H
35
H
1F
H
8B
H
C4
H
35
H