FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
19.6
FNC147 – SWAP / Byte Swap
Outline
This instruction swaps the high-order 8 bits and low-order 8 bits of a word device.
1. Instruction format
FNC 147
D
P
SWAP
2. Set data
Operand type
S
S
1
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
S
S
1
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.
Command
input
FNC147
SWAPP
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.
Command
input
FNC147
DSWAPP
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 the XCH (FNC 17) instruction.
Mnemonic
16-bit Instruction
3 steps SWAP
SWAPP
Word device whose high-order 8 bits and low-order 8 bits are swapped for each other
Digit Specification
S
High-order 8 bits Low-order 8 bits
S
High-order 8 bits Low-order 8 bits
19 Data Operation 2 – FNC140 to FNC149
Operation Condition
32-bit Instruction
Continuous
5 steps
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Index
Unit
V
Z Modify K H
S
S
+1
,
19.6 FNC147 – SWAP / Byte Swap
Mnemonic
Operation Condition
Continuous
DSWAP
Operation
Pulse (Single)
DSWAPP
Operation
Data type
16- or 32-bit binary
Others
Con-
Real
Charac-
stant
Number
ter String
E
" "
S
High-order 8 bits Low-order 8 bits
11
12
13
14
Pointer
P
15
16
17
18
19
20
543