19 Applied Instructions (Data Operation 2)
19.2 WTOB / WORD to BYTE
502
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Error
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in
D8067.
1) When devices to +n/2 of separation source exceed the device range of specified devices.
When n is an odd number, the devices are required in the number by rounding up. (Error code: K6706)
2) When devices to +n-1 for storing the separated data exceed the device range of specified
devices. (Error code: K6706)
Program example
This is a program for separating the data of D10 to D12 into byte unit when the X000 is turned ON, and
storing in D20 to D25.
[ST]
WTOBP(X000,D10,K6,D20);
WTOBP
EN
s
n
ENO
d
D20D10
K6
X000
[Structured ladder/FBD]
D10 D 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 34HD25
b15 b8 b7 b0
b15 b8 b7 b0
00H is stored.