Mitsubishi Electric MELSEC-Q/L Programming Manual page 87

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

• Both string type data in decimal form and exponential form can be converted to single-precision real type data.
Ex.
Decimal form
High-order byte
String 1st word
31
(1)
H
2nd word
33
(3)
H
3rd word
30
(0)
H
4th word
34
(4)
H
5th word
Ex.
Exponential form
High-order byte
String 1st word
31
(1)
H
2nd word
33
(3)
H
3rd word
30
(0)
H
4th word
34
(4)
H
5th word
2D
(-)
H
6th word
30
(0)
H
7th word
-
1
• As the number of significant figures of string type data is 6, the 7th and later digits excluding the sign, decimal point, and
exponent part are cut and converted.
Ex.
Decimal form
-
1
3
5
0
3
4 1 2 0 2 3
.
Cut
Ex.
Exponential form
-
1
.
3
5
0
3
4 1 2 E - 1 0
Cut
• When a sign is not specified or '2BH' (+) is specified for a sign in decimal form, string type data is converted as a positive
value. When '2DH' (-) is specified for a sign, string type data is converted as a negative value.
• When a sign is not specified or '2BH' (+) is specified for a sign of the exponent part in exponential form, string type data is
converted as a positive value. When '2DH' (-) is specified for a sign of the exponential part, string type data is converted as
a negative value.
s
Low-order byte
2D
(-)
H
2E
(.)
H
35
(5)
H
33
(3)
H
00
H
-
1
.
3
5
0
3
4
s
Low-order byte
2D
(-)
H
2E
(.)
H
35
(5)
H
33
(3)
H
45
(E)
H
31
(1)
H
00
H
.
3
5
0
3
4
E
- 1 0
-1.35034
Single-precision real type
-1.35034E-10
Single-precision real type
d
-1.35034
Single-precision real type
d
-1.35034E-10
Single-precision real type
5 APPLICATION FUNCTIONS
5.1 Type Conversion Functions
5
85

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents