466
STR, STRP, DSTR, DSTRP
(b) If the setting for the number of digits after the 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 in the decimal fraction part of the number is "0", the ASCII code "2E
H
" (.) will not be stored.
(c) If the total number of digits following the 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.
DSTR
(1) Adds a decimal point to the BIN 32-bit data designated by at the location designated by , converts the data to
character string data, and stores it following the device number designated by .
(2) The total number of digits that can be designated by is from 2 to 13.
(3) The number of digits that can be designated by +1 as a part of the decimal fraction is from 0 to 10.
However, the number of digits following the decimal point must be smaller than or equal to the total number of digits
minus 3.
(4) The BIN data that can be designated by and +1 is within the range of from -2147483648 to 2147483647.
6
2
T
ota
l
number
of
d
i
g
i
ts
N
umber
of
d
i
g
i
ts
i
n
dec
i
ma
l
fract
i
on
B
IN
data
1 2
3
4
N
umber
of
d
i
g
i
ts
i
n
dec
i
ma
l
fract
i
on
1 2 3
4
Automat
i
ca
ll
y
added
.
6
3
0 .
1 2
Automatically added
1 2
0
Total number of digits
Number of digits
in decimal fraction
BIN data
8
1
1 2
Filled
w
ith 20
H
(space)
. 3
1 2 3
Total number of digits
Number of digits
in decimal fraction
BIN data
S2
S1
D
b31
Total number of digits
Number of digits in decimal fraction
+1
ASCII code for the
(total number of digits -1)
th digit
Automatically stored at the
end of the character string
ASCII code for the
(total number of digits -3)
th digit
ASCII code for the
(total number of digits -5)
th digit
ASCII code for the
(total number of digits -7)
th digit
ASCII code for the sign
ASCII code for the
(total number of digits -2)
th digit
ASCII code for the
(total number of digits -4)
th digit
ASCII code for the
(total number of digits -6)
th digit
Designated total
number of digits
Lo
w
er 16 bits
Sign
+4
+3
+2
+1
00
H
+5
ASCII code for the
(total number of digits -9)
th digit
ASCII code for the
(total number of digits -8)
th digit
ASCII code for the
(total number of digits -10)
th digit
.
U
pper 16 bits
8
3
+1
BIN data
.
2D
H
( )
36
H
(6)
35
H
(5)
34
H
(4)
b15
b8 b7
b0
2E
H
(.)
00
H
33
H
(3)
32
H
(2)
31
H
(1)
BIN 32 bits
6 5 4
3 2 1
+4
+3
+2
+1
b16 b15
b0
6 5 4 3 2 1
+1
+1
S1
S2
D
S1
S2
D
D
D
D
D
D
D
D
D
D
S1
S1
S2
S2
b15
b8 b7
b0
S1
S1
S1
S2