Mitsubishi MELSEC-Q/L Programming Manual page 469

Table of Contents

Advertisement

(5) After conversion, character string data is stored at the device number following
(a) The sign "20
" (space) will be stored if the BIN data is positive, and the sign "2D
H
negative.
(b) If the setting for the number of digits after the decimal fraction is anything other than "0", "2E
be stored at the position before the first of the specified number of digits.
Total number of digits
Number of digits
in decimal fraction
BIN data
If the number of digits in the decimal fraction part of the number is "0", the ASCII code "2E
(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
" (space) will be stored between the sign and the numeric value.
H
If the number of BIN digits is greater, an error will be returned.
(e) The value "00
" is automatically stored at the end of the converted character string.
H
Operation Error
(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
The total number of digits specified by
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
4100
the number of digits in the decimal fraction specified by
follows :
Total number of digits -3
The number of digits specified by
digits of the BIN data + 2 specified by
((Number of digits of
S1
a sign + number of digits of a sign (+ or -) + number of digits of decimal
point (.))
The range of the devices that store the character string specified in
4101
exceeds the range of the corresponding device.
10
3
1
2 3 4 5 6 7 8
Total number of digits
13
Number of digits
10
in decimal fraction
5 4 3 2 1
BIN data
Total number of digits
13
Number of digits
2
in decimal fraction
5 4 3 2 1 0
BIN data
Error details
is outside the following
S1
Number of digits in the decimal fraction
is smaller than the number of
S1
S2
< Number of digits of the BIN data at
STR, STRP, DSTR, DSTRP
as indicated below:
D
1 2 3 4 5 . 6 7 8
Number of digits in decimal fraction
Automatically added
0 . 0 0 0 0 0 5 4 3 2 1
Automatically added
5 4 3 2 . 1 0
Filled with 20
(space) codes
H
Q00J/
Q00/
QnH
Q01
S
and
S1
+1 is not as
S1
without
S2
D
" (minus sign) will be stored if it is
H
" (.) will automatically
H
" (.) will not be stored.
H
".
QnPH QnPRH
QnU
LCPU
1
2
3
4
4
6
7
8
467

Advertisement

Table of Contents
loading

Table of Contents