322
7 BASIC INSTRUCTIONS
7.5 Data Conversion Instructions
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.
Ex.
When the character string "-12345.678" (signed) is specified by (s) and later
• 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.
(s)
(s)+1
(s)+2
(s)+3
(s)+4
(s)+5
(s)+6
b15
b0
∙∙∙
∙∙∙
b7
b8
00H
- .
(d2)+1
(d2)
(d1)
(d1)+1
∙∙∙
ASCII 1
ASCII 3
ASCII 5
ASCII S
ASCII 2
ASCII 4
ASCII 7
ASCII 6
ASCII 9
ASCII 8
ASCII 11
ASCII 10
ASCII 12
Sign
1st character
2nd character
12th character
Indicates the end of character string.
Total number of digits
Integer value in which the decimal point is ignored
BIN32
Number of digits of
the decimal part
00H
10
3
-
4
2
3
.
5
1
8
6
7
-12345678
∙∙∙
31H
(1)
33H
(3)
35H
(5)
36H
(6)
38H
(8)
2DH
(-)
32H
(2)
34H
(3)
2EH
(.)
37H
(7)
b7
b0
∙∙∙
b15
b8
(s)
(s)+1
(s)+2
(s)+3
(s)+4
(s)+5
(d1)
(d1)+1
(d2)+1
(d2)
∙∙∙
b0
b15
∙∙∙
b16
b31
Содержание MELSEC iQ-F FX5
Страница 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Страница 2: ......
Страница 17: ...15 CONTENTS ...
Страница 24: ...22 MEMO ...
Страница 25: ...23 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW 2 PRECAUTIONS ON PROGRAMMING ...
Страница 126: ...124 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 132: ...130 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 140: ...138 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 191: ...7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions 189 7 Operation error There is no operation error ...
Страница 202: ...200 7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions Operation error There is no operation error ...
Страница 278: ...276 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 280: ...278 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 915: ...18 TYPE CONVERSION FUNCTIONS 18 13 Converting DWORD to WORD 913 18 Operation error There is no operation error ...
Страница 917: ...18 TYPE CONVERSION FUNCTIONS 18 14 Converting DWORD to INT 915 18 Operation error There is no operation error ...
Страница 932: ...930 18 TYPE CONVERSION FUNCTIONS 18 26 Converting DINT to WORD Operation error There is no operation error ...
Страница 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Страница 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Страница 1107: ...I 1105 MEMO ...
Страница 1111: ......