Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L

Скачать
Страница из 1086
318
6  BASIC INSTRUCTIONS
6.4  Data Transfer Instructions
Upper and lower byte exchanges
SWAP(P)
Processing details
 • Exchanges the higher and lower 8 bits of the device designated by (D).
Operation error
 • There is no operation error in the SWAP(P) instruction.
Program example
 • The following program exchanges the higher 8 bits and lower 8 bits of R10 when X10 goes ON.
(D):   Head number of the devices where the data is stored (BIN 16 bits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
Others
Bit
Word
Bit
Word
(D)
[Ladder Mode]
[List Mode]
[Operation]
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
SW
AP
SW
APP
D
D
SWAP
SWAPP
0 1 0 1
1
0 1 0
0 1
1
0
b11
b
8
b1
5
b12
1
0 1 0
b
7
b4
b
0
b
3
1
1
1
1
1
1
b11
b
8
b1
5
b12
1
1
b
7
b4
b
0
b
3
0 0
0 0
0
0
0 0
D
D
Step
Instruction
Device
0 0 0 0
1 1 1 1
0 0
0
0
b11
b
8
b1
5
b12
1 1 1 1
b
7
b4
b
0
b
3
1
1
0 0
1
1
b11
b
8
b1
5
b12
0 0
b
7
b4
b
0
b
3
1
1
0 0
1
1
0 0
R1
0
R1
0