Mitsubishi Electronics Mitsubishi Digital Electronics Video Gaming Accessories FX3G ユーザーズマニュアル

ページ / 936
533
FX
3G
/FX
3U
/FX
3UC
 Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
19 Data Operation 2 – FNC140 to FNC149
19.2 FNC141 – WTOB / WORD to BYTE
11
FN
C
30
-FN
C
39
R
otati
on and 
Shi
ft
12
FNC4
0-F
NC4
9
D
ata O
per
ati
on
13
FN
C
50-FN
C
59
H
igh S
pe
ed 
P
rocessing
14
FM
C
60-FN
C
69
H
andy 
In
st
ru
ct
ion
15
FNC7
0-F
NC7
9
Ex
ter
nal FX
 I/O
 
D
evice
16
FN
C
80-FN
C
89
Ext
ernal
 FX 
De
vic
e
17
FN
C
100-
FN
C
10
9
Da
ta
 
Transf
er 2
18
FN
C
110-
FN
C
139
Floati
ng Poi
nt
19
FN
C
14
0-F
N
C
149
Da
ta
 
O
per
at
ion 2
20
FN
C
150-
FN
C
159
Posit
ioning 
C
ont
ro
l
3) When "n" is an odd number, only the low-order byte (8 bits) of the final separation source device is regarded as
the target data as shown in the figure below.
For example, when "n" is "5", the data from 
 to the low-order byte (8 bits) of 
+2 is stored in 
 to
+4.
4) When "n" is "0", WTOB instruction is not executed.
Related instruction
Caution
Devices storing the separation source data can overlap devices storing the separated data.
When "n" is an odd number, however, the high-order byte (8 bits) of the final separation source device is  overwritten
and erased.
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 separation source 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)
• When the separated data destination devices 
 to 
+n-1 are outside the specified device range (error 
code: K6706)
Program example
In the program shown below, the data stored in D10 to D12 is separated in byte units, and stored in D20 to D25.
Instruction
Description
BTOW (FNC142)
Combines the low-order 8 bits (low-order byte) of consecutive 16-bit data.
   
S
   
S
   
D
   
D
b15
b8 b7
b0
S ‚
+0
+1
+2
It is ignored when
"n" is "5".
D ‚
+0
+1
"00H" is stored.
+2
+3
+4
When "n"
is "5"
12H
56H
FEH
39H
78H
DCH
00H
00H
39H
12H
00H
00H
78H
56H
00H
DCH
b15
b8 b7
b0
S ‚
=D12
"36H" is ignored when "n" is "5".
Because D14 is also used in the
separation result destination devices D
and later, "36H" is erased and
overwritten.
D ‚
=D12
D13
"00H" is stored.
When "n"
is "5"
32H
34H
36H
31H
33H
35H
00H
00H
31H
32H
00H
00H
33H
34H
00H
35H
D13
D14
D14
D15
D16
b15
b8 b7
b0
b15
b8 b7
b0
   
S
   
S
   
D
   
D
X000
FNC141
WTOBP
D10
D20
K6
END
D10
D20
D21
6 bytes
FDH
57H
34H
58H
E2H
44H
00H
00H
58H
FDH
00H
00H
E2H
57H
00H
44H
D11
D12
D22
D23
D24
00H
34H
D25
b15
b8 b7
b0
b15
b8 b7
b0
"00H" is stored.