Mitsubishi MELSEC iQ-F FX5 series Programming Manual page 282

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

Processing details
• These instructions convert the character string in the device numbers specified by (s) and later to 32-bit binary data, and
store the number of digits in the device specified by (d1) and the binary data in the device specified by (d2). When
converting a character string into binary data, the data from the device number specified by (s) to a device number storing
"00H" is handled as a character string.
• The total number of digits stored in (d1) is the total number of characters (including the sign and decimal point) representing
the numeric value. The number of digits in the decimal part stored in (d1)+1 is the number of characters representing the
decimal part after 2EH (.). The 32-bit binary data stored in (d2) is binary value converted from a character string with the
decimal point ignored.
∙∙∙
b15
(s)
ASCII code for 1st character
(s)+1
ASCII code for 3rd character
(s)+2
ASCII code for the 5th character
(s)+3
ASCII code for the 7th character
(s)+4
ASCII code for the 9th character
(s)+5
ASCII code for the 11th character ASCII code for the 10th character
(s)+6
00H
Indicates the end of character string.
Ex.
When the character string "-12345.678" (signed) is specified by (s) and later
-
1
2
3
4
• The total number of characters of the character string specified by (s) is 2 to 13 characters.
• In the character string specified by (s), the number of characters that form the decimal part is 0 to 10 characters. However,
be sure to specify "Total number of digits - 3" or below.
• The range of the character string of the numeric value that can be converted to a binary value is -2147483648 to
2147483647 for a signed value with the decimal point ignored, and 0 to 4294967295 for an unsigned value. A character
string of a numeric value excluding the sign and decimal point can be specified only within the range of 30H to 39H. (Value
with the decimal point ignored ... "-12345.6" becomes "-123456".)
• When representing a positive numeric value, 20H is set in the sign, and when representing a negative numeric value, 2DH
is set.
• Set 2EH in the decimal point.
• When "20H (space)" or "30H (0)" exists between the sign and the first non-zero number in a character string specified by
(s), "20H" or "30H" is ignored during conversion to a binary value.
6 BASIC INSTRUCTIONS
280
6.5 Data Conversion Instructions
∙∙∙
b8
b7
b0
ASCII code for sign
ASCII code for 2nd character
ASCII code for the 4th character
ASCII code for the 6th character
ASCII code for the 8th character
ASCII code for the 12th character
b15
···
(s)
31H
(s)+1
33H
(s)+2
35H
(s)+3
36H
38H
(s)+4
(s)+5
(d1)
(d1)+1
5
.
6
7
8
- .
∙∙∙
Sign
2nd character
12th character
1st character
b8
b7
···
b0
(1)
2DH
(-)
(3)
32H
(2)
(5)
34H
(3)
(6)
(.)
2EH
(8)
37H
(7)
00H
10
3
(d2)+1
b31
···
b16
-12345678
Total number of digits
(d1)
Number of digits of
(d1)+1
the decimal part
(d2)+1
(d2)
Integer value in which the decimal point is ignored
32-bit binary data
(d2)
b15
···
b0

Advertisement

Table of Contents
loading

Table of Contents