7.11 String Processing Instructions
7.11.9 16-/32-bit BIN data to character string data conversion
7-185
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
STR, DSTR
STR, DSTR
(5) After conversion, character string data are stored to the device numbers following
as
indicated below.
(a) The sign 20
H
(space) will be stored if the BIN value is positive, and the sign 2D
H
(minus
sign) will be stored if it is negative.
(b) If the setting for the number of digits for decimal fraction is anything other than 0, 2E
H
(. )
will automatically be stored at the position before the first of the specified number of
digits.
If the number of digits for decimal fraction is 0, the ASCII code 2E
H
(. ) will not be stored.
(c) If the total number of digits for decimal fraction is greater than the number of BIN data
digits, a zero will be added automatically and the number converted by shifting to the
right, so that it would become 0.
.
(d) If the total number of digits excluding the sign and the decimal point is greater than the
number of BIN data digits, 20
H
(space) will be stored between the sign and the numeric
value.
If the number of BIN digits is greater, an error will be returned.
(e) The value 00
H
is automatically stored at the end of the converted character string.
d
1
10
3
Total num
b
er of
d
igits
Num
b
er of
d
igits
in
d
ecimal fraction
BIN
d
ata
1 2 3
4
5
.
6 7 8
A
utomaticall
y
a
dd
e
d
2 3
4
5 6 7 8
Num
b
er of
d
igits in
d
ecimal fraction
5
4
3 2 1
13
10
0
.
0 0 0 0 0 5
4
3 2 1
A
utomaticall
y
a
dd
e
d
Total num
b
er of
d
igits
Num
b
er of
d
igits
in
d
ecimal fraction
BIN
d
ata
5 4 3 2 1 0
13
2
5 4 3 2 . 1 0
Fill
e
d wi
th
20
H
(
space
)
co
d
es
T
ota
l
num
b
er
of
di
g
i
ts
N
um
b
er
of
di
g
i
ts
i
n
d
ec
i
ma
l
fract
i
on
B
IN d
ata
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......