Download Print this page

Exchanging The Upper And Lower Bytes Of 32-Bit Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Exchanging the upper and lower bytes of 32-bit data

DSWAP(P)
These instructions swap the value of 8 bits of the upper and lower bytes of the word devices specified by (d).
Ladder diagram
(d)
FBD/LD
EN
ENO
d
Setting data
■Descriptions, ranges, and data types
Operand
Description
(d)
Head device for storing the data to be swapped
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(d)
Processing details
These instructions swap the value of each of the upper and lower 8 bits of the device specified by (d) and (d)+1.
b15
b12
b11
b8
b7
b4
b3
∙∙∙
∙∙∙
∙∙∙
(d)+1
0
1
0
1
0
1
0
1
1
0
1
0
1
b15
b12
b11
b8
b7
b4
b3
∙∙∙
∙∙∙
∙∙∙
(d)+1
1
0
1
0
1
0
1
0
0
1
0
1
0
Precautions
If a continuous operation type instruction is used, swap is done in each operation cycle.
Operation error
There is no operation error.
Word
T, ST, C, D, W,
U\G
SD, SW, R
b0
b15
b12
∙∙∙
∙∙∙
(d)
0
1
0
0
1
0
b0
b15
b12
∙∙∙
∙∙∙
1
0
1
(d)
1
0
1
Structured text
ENO:=DSWAP(EN,d);
ENO:=DSWAPP(EN,d);
Range
Double word Indirect
specification
Z
LC
LZ
b11
b8
b7
b4
b3
b0
∙∙∙
∙∙∙
∙∙∙
1
0
1
0
1
1
0
1
0
1
0
1
0
b11
b8
b7
b4
b3
b0
∙∙∙
∙∙∙
∙∙∙
0
1
0
1
0
0
1
0
1
0
1
0
1
Data type
Data type (label)
32-bit signed binary
ANY32
Bit
BOOL
Bit
BOOL
Constant
K, H
E
$
7 BASIC INSTRUCTIONS
7.7 Data Transfer Instructions
7
Others
363

Hide quick links:

Advertisement

loading