Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 764

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Processing details
• These instructions convert the character string stored in the device number specified by (s) and later to single-precision real
number data, and store the converted real number in the device specified by (d).
• The specified character string can be converted to a single-precision real number in either decimal point or exponential
format.
b15
∙∙∙
(s)
ASCII code (1st character)
(s)+1
ASCII code (3rd character)
(s)+2
ASCII code (5th character)
(s)+3
ASCII code (7th character)
(s)+4
Null character (end of string)
• "20H" (space) that exists in the middle of the data is ignored.
• The character string can consist of up to 24 characters. "20H" (space) and "30H" (0) are counted as one character as well.
■Decimal point format
• When the character string in the device specified by (s) is in decimal point format, conversion is performed as shown below.
b15
∙∙∙
(s)
31H (1)
(s)+1
30H (0)
(s)+2
38H (8)
(s)+3
32H (2)
(s)+4
-
1
.
(1) Single-precision real number
• The character string in the device specified by (s) to be converted to a single-precision real number is converted by
assuming that the six digits excluding the sign, decimal point, and exponent are effective and the seventh and subsequent
digits are discarded.
b15
∙∙∙
(s)
20H (space)
(s)+1
31H (1)
(s)+2
33H (3)
(s)+3
31H (1)
(s)+4
36H (6)
(s)+5
31H (1)
(s)+6
00H
-
1 . 3 0 1 5 6 8 1 2
(1) Rounded down.
(2) Single-precision real number
7 APPLICATION INSTRUCTIONS
762
7.9 Real Number Instructions
b8
b7
∙∙∙
ASCII code (sign data)
ASCII code (2nd character)
ASCII code (4th character)
ASCII code (6th character)
00H
b8
b7
∙∙∙
b0
2DH (-)
2EH (.)
37H (7)
31H (1)
00H
0 7 8 1 2
b8
b7
∙∙∙
b0
2DH (-)
20H (space)
2EH (.)
30H (0)
35H (5)
38H (8)
32H (2)
(1)
b0
(d)+1
Single-precision real number
(d)+1
(d)
-
1
. 0
7
8
1 2
(1)
(d)+1
(d)
-
1
. 3
0
1 5
6
(2)
(d)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents