Swap, Swapp - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

6.4.11

SWAP, SWAPP

Upper and lower byte exchanges
6.4.11
SWAP, SWAPP
SWAP
SWAPP
: Head number of the devices where the data is stored (BIN 16 bits)
D
Setting
Internal Devices
Data
Bit
Word
D
Function
(1) Exchanges the higher and lower 8 bits of the device designated by
Operation Error
(1) There is no operation error in the SWAP(P) instruction.
Program Example
(1) The following program exchanges the higher 8 bits and lower 8 bits of R10 when X10 goes ON.
[Ladder Mode]
[Operation]
b15
b12
b11
b8
b7
R10
0
0
0 0
0 0 0 0
1 1 1 1
b15
b12
b11
b8
b7
R10
1
1
1
1
1
1
1
1
0
0
0
Command
Command
J
R, ZR
Bit
b15
b12
D
0
1
0 1
b15
b12
D
1
0
1
0
[List Mode]
Step
b4
b3
b0
1 1 1 1
b4
b3
b0
0
0
0
0
0
High
Basic
performance
\
U
\G
Word
.
D
b11
b8
b7
b4
b3
b0
0 1 0 1
1 0 1 0
1 0 1 0
b11
b8
b7
b4
b3
b0
1
0
1
0
0
1
0
1
0
1
0
1
Device
Instruction
SWAP, SWAPP
Process
LCPU
Redundant Universal
SWAP
D
SWAPP
D
Zn
Constants
Other
––
1
2
3
4
6
7
8
273

Advertisement

Table of Contents
loading

Table of Contents