Exchanging The Upper And Lower Bytes Of 32-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 32-bit binary data

DSWAP(P)
RnPCPU
RnCPU RnENCPU
(Process)
• The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.)
These instructions exchange upper and lower 8-bit data in the specified device.
Ladder
(d)
FBD/LD
EN
ENO
d
■Execution condition
Instruction
DSWAP
DSWAPP
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,
SM, F, B, SB,
FX, FY
*1
(d)
*1 FX and FY cannot be used.
Processing details
• The device specified by (d) exchanges its upper and lower 8-bit data.
b15
∙∙∙
b12
b11
∙∙∙
b8
(d)+1
0
1
0
1
0
1
0
1
b15
∙∙∙
b12
b11
∙∙∙
b8
(d)+1
1
0
1
0
1
0
1
0
Operation error
There is no operation error.
6 BASIC INSTRUCTIONS
522
6.7 Data Transfer Instructions
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
Execution condition
Word
J\
T, ST, C, D, W,
SD, SW, FD, R,
ZR, RD
b7
∙∙∙
b4
b3
∙∙∙
b0
1
0
1
0
1
0
1
0
b7
∙∙∙
b4
b3
∙∙∙
b0
0
1
0
1
0
1
0
1
ST
ENO:=DSWAP(EN,d);
ENO:=DSWAPP(EN,d);
Range
U\G, J\,
Z
U3E\(H)G
b15
∙∙∙
b12
b11
∙∙∙
b8
b7
∙∙∙
b4
b3
(d)
0
1
0
1
0
1
0
1
1
0
1
0
1
b15
∙∙∙
b12
b11
∙∙∙
b8
b7
∙∙∙
b4
b3
(d)
1
0
1
0
1
0
1
0
0
1
0
1
0
Data type
32-bit signed binary
Bit
Bit
Double word Indirect
specification
LT, LST,
LZ
LC
∙∙∙
b0
0
1
0
∙∙∙
b0
1
0
1
Data type (label)
ANY32
BOOL
BOOL
Constant
Others
K, H E
$

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents