EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Page 560

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
558
7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
DVAL
Converts the character string stored in the area starting from the device designated by (S) to BIN 32-bit data, and stores the
digits numbers and BIN data in (D1) and (D2). For conversions from character strings to BIN, all data from the device
number designated by (S) to the device number where "00H" is stored will be processed as character strings.
The total number of characters in the character string indicated by (S) is from 2 to 13.
From 0 to 10 characters in the character string indicated by (S) can be the decimal fraction part. However, this number must
not exceed the total number of digits minus 3.
The range of the numerical character string that can be converted to BIN value is from -2147483648 to 2147483647,
excluding the decimal point. Numerical value character strings, excluding the sign and the decimal point, can be designated
only within the range from "30H" to "39H".
The sign "20H" will be stored if the numerical value is positive, and the sign "2DH" will be stored if it is negative.
"2EH" is set for the decimal point.
The total number of digits stored at D1 amounts to all characters expressing numerical values (including signs and decimal
points). The characters following the decimal point stored at (D1)+1 include the number of characters from "2EH" (.)
onward. The BIN data stored at (D2) is the character string ignoring the decimal point that has been converted to BIN data.
In cases where the character string designated by (S) contains "20H" (space) or "30H" (0) between the sign and the first
numerical value other than "0", these "20H" and "30H" are ignored in the conversion into a BIN value.
Indicates the end of character string
ASCII code for the sign
ASCII code for the 1st character
ASCII code for the 2nd character
ASCII code for the 3rd character
ASCII code for the 4th character
00
H
ASCII code for the 5th character
ASCII code for the 6th character
ASCII code for the 7th character
+4
+3
+2
+1
+5
+6
ASCII code for the 8th character
ASCII code for the 9th character
ASCII code for the 10th character
ASCII code for the 11th character
ASCII code for the 12th character
.
Sign
1st
char-
acter
2nd
char-
acter
12th
char-
acter
Integer value ignoring decimal point
+1
BIN 32 bits
2D
H
( )31
H
(1)
32
H
(2)33
H
(3)
b8
b7
b0
34
H
(4)35
H
(5)
2E
H
(.)36
H
(6)
37
H
(7)38
H
(8)
.
+1
00
H
10
3
1234
5
678
+1
+1
Total number of digits
Number of digits
in decimal fraction
12
3
4
5678
S
D1
D2
S
S
S
S
S
S
D2
D1
D1
D1
+4
+3
+2
+1
+5
S
S
S
S
S
S
b15
D2
D2
b8 b7 b0b15
654 3 . 21
Ignored
12
2
Total number of digits
Number of digits
in decimal fraction
BIN data
0 000
5
4 321
Ignored
11
8
.
Sign
65
4
3
21
5 4 321
Total number of digits
Number of digits
in decimal fraction
BIN data

Table of Contents

Related product manuals