6 - 95 6 - 95
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
High Performance
QnA Q4AR
Basic
QCPU
PLC CPU
Process CPU
6.4.9 Upper and lower byte exchanges (SWAP, SWAPP)
Usable Devices
Internal Devices
(System, User)
MELSECNET/10(H)
Direct J
\
Set
Data
Bit Word
File
Register
Bit Word
Special
Function
Module
U
\G
Index
Register
Zn
Constant
K, H
Other
D
[Instruction Symbol] [Execution Condition]
Command
Command
SWAP
SWAPP
D
D
WAP
WAPP
[Set Data]
Set Data Meaning Data Type
D
Head number of device where data is stored BIN 16 bits
[Functions]
(1) Exchanges the higher and lower 8 bits of the device designated by
D
.
0101 10100 110
b11 b8b15 b12
1010
b7 b4 b0b3
11 1111
b11 b8b15 b12
11
b7 b4 b0b3
00 000000
D
D
[Operation Errors]
(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] [List Mode]
Steps
Instruction
Device
0000 11110 000
b11 b8b15 b12
1111
b7 b4 b0b3
11 0011
b11 b8b15 b12
00
b7 b4 b0b3
11 001100
R10
R10
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com