Upper And Lower Byte Exchanges (Swap(P)) - Mitsubishi MELSEC Q Series Programming Manual

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6.4.11

Upper and lower byte exchanges (SWAP(P))

SWAP(P)
SWAP
SWAPP
Setting
Data
D
Function
(1) Exchanges the higher and lower 8 bits of the device designated by
Operation Error
(1) There are no operation errors associated with 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
R10
0
b15
R10
1
Command
Command
: Head number of the devices where the data is stored (BIN 16 bits)
D
Internal Devices
R, ZR
Bit
Word
b15
b12
b11
D
0
1
0 1
0 1 0 1
b15
b12
b11
D
1
0
1
0
1
b12
b11
b8
b7
b4
b3
b0
0
0 0
0 0 0 0
1 1 1 1
1 1 1 1
b12
b11
b8
b7
b4
b3
b0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
High
Basic
performance
J
\
U
\G
Bit
Word
b8
b7
b4
b3
b0
1 0 1 0
1 0 1 0
b8
b7
b4
b3
b0
0
1
0
0
1
0
1
0
1
0
1
[List Mode]
Step
Instruction
SWAP(P)
Process
Redundant Universal
LCPU
SWAP
D
SWAPP
D
Zn
Constants
Other
––
.
D
Device
6-131
1
2
3
4
4
6
7
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents