467
STR, STRP, DSTR, DSTRP
1
2
3
4
4
6
7
8
7.11
Char
acter
string processing inst
ructions
7.11.9
S
TR, ST
RP, DSTR
, DSTR
P
(5) After conversion, character string data is stored at the device number following as indicated below:
(a) The sign "20
H
" (space) will be stored if the BIN data 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 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.
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The total number of digits specified by is outside the following
ranges:
When the STR instruction is in use......2 to 8
When the DSTR instruction is in use....2 to 13
The number of digits for a part of the decimal fraction specified by
+1 is outside the following ranges:
When the STR instruction is in use......0 to 5
When the DSTR instruction is in use...0 to 10
The relationship between the total number of digits specified by and
the number of digits in the decimal fraction specified by +1 is not as
follows :
Total number of digits -3
Number of digits in the decimal fraction
The number of digits specified by is smaller than the number of
digits of the BIN data + 2 specified by
((Number of digits of < Number of digits of the BIN data at without
a sign + number of digits of a sign (+ or -) + number of digits of decimal
point (.))
4101
The range of the devices that store the character string specified in
exceeds the range of the corresponding device.
D
1
10
3
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
5
.
6 7 8
Automat
i
ca
ll
y
added
2 3
4
5 6 7 8
N
umber
of
d
i
g
i
ts
i
n
dec
i
ma
l
fract
i
on
5
4
3 2 1
13
10
0
.
0 0 0 0 0 5
4
3 2 1
Automat
i
ca
ll
y
added
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
5 4 3 2 1 0
13
2
5 4 3 2 . 1 0
Filled
w
ith 20
H
(space) codes
Total number of digits
Number of digits
in decimal fraction
BIN data
S1
S
S1
S1
S1
S2
S1
S2
D