Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
19 Applied Instructions (Data Operation 2)
19.2 WTOB / WORD to BYTE
501
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
Function and operation explanation
1. 16-bit operation (WTOB/WTOBP)
1) This instruction separates n/2 points of 16-bit data stored after the device specified by into n bytes,
and stores into n devices starting from the device specified by as explained below.
2) 00H is stored in the higher byte (8 bits) of the device for storing the separated byte data (after the device
specified by ).
3) In the case of n = odd number, the final data of separation source is applicable only to the data in the
lower byte (8 bits) as shown below.
For example, in the case of n=5, data of lower byte (8 bits) of to +2 is stored in to
+4.
4) Instruction is not processed in the case of n=0.
Related instructions
Cautions
1) The device storing the separation source data and the device storing the separated data can be used in
overlap. However, in the case of n = odd number, it must be noted that the data of the higher byte (8 bits)
of the final data of the separation source may be overwritten and erased as shown below.
2) The instruction is provided in the FX
3UC PLC Ver. 2.20 or later.
Instruction Content
BTOW This instruction couples the lower 8 bits (lower byte) of continuous 16-bit data.
b15 b8b7 b0
+0
+1
+n/2
*
* If n is an odd number,
fractions are rounded up.
In the case of n=5, the result is +3.
+0
+1
00H is stored.
+2
+3
+n-2
+n-1
n bytes
Higher byte
Higher byte
Higher byte
Lower byte
Lower byte
Lower byte
00H
00H
Lower byte
Higher byte
00H
00H
Lower byte
Higher byte
00H
00H
Lower byte
Higher byte
b15 b8 b7 b0
WTOB
EN
s
n
ENO
d
Command
input
Head device for storing the
result separated in byte unit.
Head device of the data to be separated.
Number of byte data to be separated.
s
d
s
b15 b8 b7 b0
+0
+1
+2
Ignored when n=5.
+0
+1
00H is stored.
+2
+3
+4
In the case o
f
n=5
12H
56H
FEH
39H
78H
DCH
00H
00H
39H
12H
00H
00H
78H
56H
00H DCH
b15 b8 b7 b0
ds
=D12
Ignored when n=5, and
devices and are
overlapped, and "36H"
is overwritten and erased.
=D12
D13
00H is stored.
In the case
of n=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
d
ds