Mitsubishi MELSEC-Q/L Programming Manual page 468

Table of Contents

Advertisement

STR, STRP, DSTR, DSTRP
(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
Total number of digits
Number of digits
in decimal fraction
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
DSTR
(1) Adds a decimal point to the BIN 32-bit data designated by
character string data, and stores it following the device number designated by
S1
Total number of digits
S1
+1
Number of digits in decimal fraction
+1
S2
S2
b31
b16 b15
Upper 16 bits
Lower 16 bits
BIN 32 bits
S1
+1
S1
BIN data
(2) The total number of digits that can be designated by
(3) The number of digits that can be designated by
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
466
6
2
1 2 3 4
Total number of digits
6
Number of digits
3
in decimal fraction
BIN data
1 2
8
1
BIN data
1 2 3
.
Sign
b0
8
3
.
6 5 4
+1
S2
S2
6 5 4 3 2 1
+1 as a part of the decimal fraction is from 0 to 10.
S1
and
+1 is within the range of from -2147483648 to 2147483647.
S1
S2
.
1 2 3 4
Number of digits in decimal fraction
Automatically added
0 .
0
1 2
Automatically added
1 2
. 3
Filled with 20
at the location designated by
S2
.
D
b15
ASCII code for the
D
(total number of digits -1)
th digit
ASCII code for the
+1
D
(total number of digits -3)
th digit
ASCII code for the
+2
D
(total number of digits -5)
th digit
ASCII code for the
(total number of digits -7)
D
+3
th digit
ASCII code for the
(total number of digits -9)
D
+4
th digit
D
+5
00
H
b15
D
36
(6)
H
+1
34
(4)
D
H
3 2 1
D
+2
33
(3)
H
31
(1)
D
+3
H
+4
D
is from 2 to 13.
S1
" (.) will automatically
H
" (.) will not be stored.
H
(space)
H
, converts the data to
S1
b8 b7
b0
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)
Designated total
th digit
number of digits
ASCII code for the
(total number of digits -6)
th digit
ASCII code for the
(total number of digits -8)
th digit
ASCII code for the
(total number of digits -10)
th digit
Automatically stored at the
end of the character string
b8 b7
b0
2D
( )
H
35
(5)
H
2E
(.)
H
32
(2)
H
00
H
".

Advertisement

Table of Contents
loading

Table of Contents