Separating data in byte units
WTOB(P)
These instructions separate the 16-bit binary data in the device numbers starting from the one specified by (s) onwards into
(n) byte units, and store the separated data in the device number specified by (d) onwards.
Ladder diagram
(s)
(d)
(n)
FBD/LD
EN
ENO
s
d
n
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Head device where the separation target data is stored
(d)
Head device for storing the result of separation in byte unit
(n)
Number of byte units
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
(n)
Processing details
• These instructions separate the 16-bit binary data in the device numbers starting from the one specified by (s) onwards into
(n) byte units, and store the separated data in the device number specified by (d) onwards.
b15
∙∙∙
(s)
(1)
(s)+1
(1)
n
(s)+(
-1)
*1
(1)
2
(1): Upper byte
(2): Lower byte
(3): Upper byte data
(4): Lower byte data
*1 Values after the decimal point are rounded up.
Word
T, ST, C, D, W,
U\G
SD, SW, R
b8
b7
b0
∙∙∙
(2)
(2)
(2)
Structured text
ENO:=WTOB(EN,s,n,d);
ENO:=WTOBP(EN,s,n,d);
Range
Data type
16-bit signed binary
16-bit signed binary
0 to 65535
16-bit unsigned binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
b15
b8
∙∙∙
(d)
00H
(d)+1
00H
(d)+2
00H
00H
(d)+3
00H
(d)+(n-2)
00H
(d)+(n-1)
Data type (label)
ANY16
ANY16
ANY16
BOOL
BOOL
Constant
Others
K, H
E
$
b7
b0
∙∙∙
(4)
(3)
(4)
(n)
(3)
(4)
(3)
7 BASIC INSTRUCTIONS
7.5 Data Conversion Instructions
7
341