Exchanging The Upper And Lower Bytes Of 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Exchanging the upper and lower bytes of 16-bit binary data

SWAP(P)
RnPCPU
RnPCPU
RnCPU RnENCPU
(Process)
(Redundant)
These instructions exchange upper and lower 8-bit data in the specified device.
Ladder
(d)
FBD/LD
EN
ENO
d
■Execution condition
Instruction
SWAP
SWAPP
Setting data
■Description, range, data type
Operand
Description
(d)
Start device for storing the data whose upper and lower 8-
bit data is exchanged
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L,
J\
SM, F, B, SB,
FX, FY
(d)
Processing details
• The device specified by (d) exchanges its upper and lower 8-bit data.
b15
∙∙∙
b12
b11
∙∙∙
b8
b7
∙∙∙
b4
b3
∙∙∙
(d)
0
1
0
1
0
1
0
1
1
0
1
0
1
0
b15
∙∙∙
b12
b11
∙∙∙
b8
b7
∙∙∙
b4
b3
∙∙∙
(d)
1
0
1
0
1
0
1
0
0
1
0
1
0
1
Operation error
There is no operation error.
RnSFCPU RnSFCPU
(Standard)
(Safety)
Execution condition
Word
T, ST, C, D, W,
U\G, J\,
SD, SW, FD, R,
U3E\(H)G
ZR, RD
b0
1
0
b0
0
1
ST
ENO:=SWAP(EN,d);
ENO:=SWAPP(EN,d);
Range
Data type
16-bit signed binary
Bit
Bit
Double word Indirect
Z
LT, LST,
LZ
LC
Data type (label)
ANY16
BOOL
BOOL
Constant
Others
specification
K, H E
$
6 BASIC INSTRUCTIONS
6.7 Data Transfer Instructions
6
521

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents