Mitsubishi Electronics FX3G User Manual

Page of 964
537
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
19 Data Operation 2 – FNC140 to FNC149
19.3 FNC142 – BTOW / BYTE to WORD
11
FN
C30
-FN
C3
9
R
ota
tion and 
Shi
ft
12
FN
C40-FN
C49
D
ata O
perati
on
13
FNC
50-FNC
59
High-Speed
 
Proc
essing
14
FM
C60-FN
C69
H
andy 
In
struction
15
FN
C70-FN
C79
E
xternal
 F
X
 I/O
 
De
vice
16
FNC
80-FNC
89
External
 FX 
Dev
ice
17
FNC1
00-
FNC10
9
Dat
Transfer 2
18
FNC1
10-
FNC139
Fl
oati
ng Poi
nt
19
FNC14
0-F
N
C
149
Da
ta
 
Operation 2
20
FNC1
50-
FNC159
Pos
itioning 
Control
Related instruction
Caution
Devices storing the combination source data may be equivalent to devices storing the combined data.
After combination, however, the high-order byte (8 bits) of the combination source data stored in the devices used for
the combination destination data is erased and overwritten with the data acquired by combining the high-order byte (8
bits). 
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is stored in
D8067.
• When the combination source devices 
 to 
+n-1 are outside the specified device range (error code: 
K6706)
• When the combined data destination devices 
 to 
+n/2 are outside the specified device range (error 
code: K6706)
When "n" is an odd number, the number of a rounded up value decides the number of devices. (error code: K6706)
Program example
In the program shown below, the low-order byte (8 bits) data stored in D20 to D25 is combined, and stored in D10 to
D12.
Instruction
Description
WTOB (FNC141)
Separates consecutive 16-bit data in byte units (8 bits).
EFH
BCH
ABH
CDH
ABH
12H
34H
78H
EFH
56H
CDH
9AH
BCH
=D11
D12
The high-order bytes is ignored.
When
"n" is
"6"
=D10
34H
78H
12H
56H
9AH
It is not changed.
D13
D14
D15
CDH
EFH
ABH
56H
78H
9AH
D11
D12
D13
D14
D15
EFH
BCH
D16
b15
b8 b7
b0
b15
b8 b7
b0
D16
Because these combination source devices are
also used for the combination destination, "ABH"
and "CDH" are erased and overwritten.
   
S
   
S
   
D
   
D
31H
D20
D21
The high-order bytes is ignored.
D22
6 bytes
D10
D11
D12
12H
55H
78H
49H
67H
00H
31H
44H
78H
12H
55H
36H
49H
48H
67H
D23
D24
49H
31H
D25
b15
b8 b7
b0
b15
b8 b7
b0
X000
FNC142
BTOWP
D20
D10
K6
END