Fnc147 - Swap / Byte Swap - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

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
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.
566
Mnemonic
16-bit Instruction
P
3 steps SWAP
SWAPP
Word device whose high-order 8 bits and low-order 8 bits are swapped for each
other
Digit Specification
S
S
High-order 8 bits Low-order 8 bits
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
S
High-order 8 bits Low-order 8 bits
S
+1
19 Data Operation 2 – FNC140 to FNC149
19.6 FNC147 – SWAP / Byte Swap
Mnemonic
32-bit Instruction
DSWAP
5 steps
DSWAPP
16- or 32-bit binary
Con-
Real
Index
stant
Number
V Z Modify K H
E
S
High-order 8 bits Low-order 8 bits
,
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Data type
Others
Charac-
Pointer
ter String
" "
P

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents