Swap (Data Swap) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

SWAP (Data Swap)

SWAP(*)
S1(R)
*****
Valid Devices
Device
S1 (Source 1)
D1 (Destination 1)
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the SWAP instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Valid Data Types
W (word)
X
I (integer)
D (double word)
X
L (long)
F (float)
Examples: SWAP
• Data Type: W (word)
When input I0 is turned on, upper- and lower-byte data of the 16-bit data in data register D10 assigned by source device S1 are exchanged, and the
result is stored to data register D20 assigned by destination device D1.
SWAP(W)
I0
• Data Type: D (double-word)
When input I1 is turned on, upper- and lower-word data of the 32-bit data in data registers D10 and D11 assigned by source device S1 are
exchanged, and the result is stored to data registers D20 and D21 assigned by destination device D1.
SWAP(D)
I1
D1(R)
REP
*****
**
Function
Binary data to swap
Destination to store conversion result
When a D (data register) is assigned as the source or destination, 1 point (word data) or 2 points (double-word
data) are used. When repeat is assigned, the quantity of device words increases in 1- or 2-point increments.
S1
D1
REP
D10
D20
S1
D1
REP
D10
D20
FC6A S
MICROS
ERIES
S1 → D1
When input is on, upper and lower byte- or word-data of a word- or double-word-data
assigned by S1 are exchanged, and the result is stored to destination assigned by D1.
I
Q
Before Execution
12345
D10
(3039h)
Before Execution
100
D10
D11
200
L
P
MART
ADDER
ROGRAMMING
10: D
C
ATA
ONVERSION
M
R
T
C
D
P
X
X
After Execution
14640
D20
(3930h)
After Execution
200
D20
D21
100
M
FC9Y-B1726
ANUAL
I
NSTRUCTIONS
Constant
Repeat
1-99
1-99
10-23

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents