4 - 6 4 - 6
MELSEC-Q
4 FUNCTIONS
4.1.3 Word data swap function
This is the function to exchange (swap) the upper and lower bytes of the I/O data
stored in the buffer memories of the CPU and QJ71PB92D.
For the PROFIBUS-DP and MELSEC series, the function is used to input and output
word data into and from the slave because the upper and lower bytes are reversed to
each other in the processing of the word data.
The function enables the upper and lower bytes to be swapped in the area for each
station, and the word data processing need not swap the bytes using the sequence
program.
For the swap function setting method for word data, refer to the PROFIBUS-DP
configurator operating manual.
Standard Swap Function Settings Classified by Slave Station
Classification by slave station
Swap function setting
Byte (I/O) data only
Not swapped
Word data only
Swapped
Mixture of byte (I/O) data and word data
Not swapped (Only for word data, swapped using the
sequence program)
The following shows the examples of data transmission for non-execution/execution of
swap function classified by processed data.
Slave station
Examples of data transmission (for input)
Nonexecution of swap (Initial setting)
1
1
0
0
b15
b8 b7
b0
to
to
to
to
X0 = 1
X7 = 1
X8 = 0
XF = 0
1
1
0
0
XF
X8 X7
X0
to
to
to
to
CPU
QJ71PB92D
Buffer memory
Slave station
Byte data (I/O)
only
Execution of swap
0
0
1
1
b15
b8 b7
b0
to
to
to
to
X0 = 0
X7 = 0
X8 = 1
XF = 1
1
1
0
0
XF
X8 X7
X0
to
to
to
to
CPU
QJ71PB92D
Buffer memory
Slave station
Swap
processing
Nonexecution of swap (Initial setting)
12
H
34
H
QJ71PB92D
Buffer memory
Slave station
12
H
34
H
12
H
34
H
CPU
Upper and
lower bytes
are reversed
to each other.
D0
Word data only
Execution of swap
12
H
34
H
QJ71PB92D
Buffer memory
Slave station
12
H
34
H
Upper and
lower bytes
are reversed
to each other.
Swap
processing
12
H
34
H
CPU
D0