7.11 String Processing Instructions
7.11.9 16-/32-bit BIN data to character string data conversion
7-183
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
STR, DSTR
STR, DSTR
Function
STR(P)
(1) Adds a decimal point at the position specified for
, to the 16-bit BIN data specified for
,
converts the data to character string data, and stores the results to the device specified for
and the following devices.
(2) The total number of digits that can be specified for
is from 2 to 8 digits.
(3) The number of digits for decimal fraction that can be specified for
+1 is from 0 to 5 digits.
However, the number of digits in the decimal fraction must be smaller than or equal to the
total number of digits minus 3.
(4) BIN values between 32768 and 32767 can be specified for
.
(5) After conversion, character string data are stored to the devices 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.
s
1
s
2
d
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
Si
gn
.
s
1
s
1
s
2
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-1)
th
di
g
i
t
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-3)
th
di
g
i
t
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-5)
th
di
g
i
t
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-7)
th
di
g
i
t
ASCII
co
d
e
for
the
s
i
gn
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-2)
th
di
g
i
t
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-4)
th
di
g
i
t
ASCII
co
d
e
for
the
(
tota
l
num
b
er
of
di
g
i
ts
-6)
th
di
g
i
t
b15
b8b7
b0
S
pec
i
f
i
e
d
tota
l
num
b
er
of
di
g
i
ts
A
utomat
i
ca
lly
store
d
at
the
en
d
of
the
character
str
i
ng
00
H
d
d
d
d
d
[0]
[1]
[2]
[3]
[4]
5
1
+1
1 2 3
.
31
H
(1)
32
H
(2)
2E
H
(.)
b15
b7
b0
33
H
(3)
00
H
1 2
3
s
1
s
2
s
1
2
D
H
( )
b8
d
d
d
[1]
[0]
[2]
s
1
s
1
s
2
d
6
2
Total num
b
er of
d
igits
Num
b
er of
d
igits
in
d
ecimal fraction
BIN
d
ata
1 2
3
4
Num
b
er of
d
igits in
d
ecimal fraction
1 2 3
4
A
utomaticall
y
a
dd
e
d
.
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: ......