520
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
19 Data Operation 2 – FNC140 to FNC149
19.6 FNC147 – SWAP / Byte Swap
19.6
FNC147 – SWAP / Byte Swap
Outline
This instruction swaps high-order 8 bits and low-order 8 bits of a word device.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
1. 16-bit operation (SWAP and SWAPP)
High-order 8 bits and low-order 8 bits are swapped for each other.
2. 32-bit operation (DSWAP and DSWAPP)
High-order 8 bits and low-order 8 bits are swapped for each other in each word device.
Caution
• When the continuous operation type instruction is used, swapping is executed in each operation cycle.
This instruction works in the same way as the extension function of XCH (FNC 17) instruction.
Operand type
Description
Data type
Word device whose high-order 8 bits and low-order 8 bits are swapped each
other
16- or 32-bit binary
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS
T
C
D
R U
\G
V
Z Modify K
H
E
"
"
P
3
3
3
3 3 3 3
3
3 3
3
DSWAP
DSWAPP
Mnemonic
Operation Condition
P
FNC 147
SWAP
D
16-bit Instruction
3 steps
SWAP
SWAPP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
5 steps
Continuous
Operation
Pulse (Single)
Operation
S
1
S
S
1
S
High-order 8 bits
Low-order 8 bits
S
Command
input
FNC147
SWAPP
S
High-order 8 bits Low-order 8 bits
,
High-order 8 bits Low-order 8 bits
+1
S
S
Command
input
FNC147
DSWAPP
S
Содержание FX3U Series
Страница 1: ...PROGRAMMING MANUAL Basic Applied Instructions Edition FX3U FX3UC SERIES PROGRAMMABLE CONTROLLERS ...
Страница 2: ......
Страница 889: ......