Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 463

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

Advertisement

Processing details
• These instructions convert the character strings stored in the device numbers specified by (s) and later to 32-bit binary
data, and store the number of digits in (d1) and converted binary data in the device specified by (d2). For conversion of
character strings to binary data, the data from the device number specified by (s) to the device number containing "00H" is
processed as character strings.
b15
∙∙∙
b8
b7
(s)
ASCII 1
(s)+1
ASCII 3
(s)+2
ASCII 5
(s)+3
ASCII 7
(s)+4
ASCII 9
(s)+5
ASCII 11
(s)+6
00H
Null character (end of string)
ASCII S: ASCII code (sign data)
ASCII : ASCII code (th character)
Ex.
When a string "-12345.678" (signed) is stored in the device specified by (s) or later
-
1
2
3
4
5
.
• The total number of characters of the character string stored in the device specified by (s) is 2 to 13.
• Of the character string stored in the device specified by (s), the number of characters in the decimal part is 0 to 10. Note,
however, that the number must not exceed the total number of digits minus 3.
• The range of numerical character strings that can be converted to binary is as follows. Numerical character strings
excluding signs and decimal points can be specified only within the range from 30H to 39H. (A value ignoring the decimal
point"-12345.6" for example becomes "-123456".)
• When a signed value ignoring the decimal point is specified: -2147483648 to 2147483647
• When an unsigned value ignoring the decimal point is specified: 0 to 4294967295
• For the sign, "20H" can be set to indicate a positive numerical value, or "2DH" can be set to indicate a negative numerical
value.
• "2EH" is set for the decimal point.
• The total number of digits stored in the device specified by (d1) includes all characters (including signs and decimal points)
that represent a numerical value. The number of digits in the decimal part to be stored in the device specified by (d1)+1
represents the decimal part after 2EH(.) For the 32-bit binary data to be stored in the device specified by (d2), the character
string is converted to binary data by ignoring the decimal point and stored.
∙∙∙
b0
ASCII S
ASCII 2
ASCII 4
- .
ASCII 6
ASCII 8
Sign
1st character
ASCII 10
ASCII 12
b15
∙∙∙
b8
b7
(s)
31H
(1)
2DH
(s)+1
33H
(3)
32H
(s)+2
(5)
35H
34H
(6)
(s)+3
36H
2EH
38H
(8)
37H
(s)+4
00H
(s)+5
(d1)
(d1)+1
b31
6
7
8
(d1)
(d1)+1
Number of digits in the decimal part
(d2)+1
Integer value ignoring the decimal point
∙∙∙
12th character
∙∙∙
b0
(-)
(2)
(3)
(.)
(7)
10
3
(d2)+1
∙∙∙
b16
b15
-12345678
6.6 Data Conversion Instructions
Total number of digits
(d2)
BIN32
(d2)
∙∙∙
b0
6 BASIC INSTRUCTIONS
6
461

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents