294
6 BASIC INSTRUCTIONS
6.5 Data Conversion Instructions
Connecting data in byte units
BTOW(P)
These instructions link the lower-order 8 bits of the 16-bit binary data of (n) number of bytes stored in the device numbers
starting from the one specified by (s) onwards into word units, and store the linked data in the device numbers starting from
the one specified by (d) onwards.
■Descriptions, ranges, and data types
■Applicable devices
• These instructions link the lower-order 8 bits of the 16-bit binary data of (n) number of bytes stored in the device numbers
starting from the one specified by (s) onwards, and store the linked data in the device numbers starting from the one
specified by (d) onwards.
• The higher-order 8 bits of the data of (n) words stored in device numbers starting from the one specified by (s) are ignored.
If (n) is an odd number, 0 is stored in the higher-order 8 bits of the device for storing the data of the (n)th byte.
*1 Values after the decimal point are rounded up.
Ladder diagram Structured text
ENO:=BTOW(EN,s,n,d);
ENO:=BTOWP(EN,s,n,d);
Operand Description Range Data type Data type (label)
(s) Head device for storing the data to be linked in byte units 16-bit signed binary ANY16
(d) Head device storing data acquired by combination in byte
units
16-bit signed binary ANY16
(n) Number of byte data to be linked 0 to 65535 16-bit unsigned binary ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s)
(d)
(n)
(d)+1
(d)
(d)+( -1)
*1
2
n
b0b7b8b15 b0b7b8b15
(s)
(s)+1
(s)+2
(s)+3
(s)+(n-1)
(n)
Data of the 1st byte
Data of the 2nd byte
Data of the 3rd byte
Data of the 4th byte
Data of the nth byte
Data of the 1st byte
Data of the 2nd byte
Data of the 3rd byte
Data of the 4th byte
Data of the nth byte
Data of the (n-1)th byte
Higher order bytes are ignored.