
7 APPLICATION INSTRUCTION
7.6 Character string operation instruction
381
7
Processing details
• These instructions add a decimal point to the 32-bit binary data in the device specified by (s2) at the location specified by
(s1), convert the data to character string data, and store the converted data in the device areas specified by (d) and later.
• The total number of digits that can be specified by (s1) is 2 to 13.
• The number of digits in the decimal part that can be specified by (s1)+1 is 0 to 10. Note that the number of digits in the
decimal part must be smaller than or equal to the total number of digits minus 3.
• The converted character string data are stored in the device areas specified by (d) and later as shown below.
• As sign data, "20H" (space) is stored if the 32-bit binary data is positive, and "2DH" (-) is stored if the data is negative.
• If the number of digits in the decimal part is set to other than 0, "2EH" (.) is automatically stored at the position before the specified number of digits. If
the number of digits in the decimal part is 0, "2EH" (.) is not stored.
• If the specified number of digits in the decimal part is greater than the number of digits of the 32-bit binary data, 0(s) is automatically added and the data
is regarded as "0.
".
• If the total number of digits excluding the sign and the decimal point is greater than the number of digits of the 32-bit binary data, "20H" (space) is stored
between the sign and the numeric value. If the number of digits of the 32-bit binary data is greater, an error occurs.
• The value "00H" is automatically stored at the end of the converted character string.
• When the number of all digits is even, "0000H" is stored in the device after the last character. When the number of all digits is odd, "00H" is stored in the
upper byte (8 bits) of the device storing the final character.
(s1)+1
b15
b8 b7
b0
00H
(d)+4
(d)+3
(d)+6
(d)+5
(d)+2
(d)+1
(d)
(d)+4
(d)+3
(d)+2
(d)+1
(d)
(s1)
b15
b8 b7
b0
8
3
.
6 5 4
3 2 1
6
-
5 4 3 2 1
(s2)+1
(s2)
-
(s1)+1
(s1)
2DH (-)
34H (4)
36H (6)
35H (5)
2EH (.)
33H (3)
32H (2)
31H (1)
0000H
b0
b31
When -654.321 is specified in (s2)
b16 b15
(s2)+1
(s2)
.
Total number of digits
Number of digits of decimal part
"00H" is automatically stored at the end of the character string.
ASCII code for sign
Sign
32-bit binary data
high-order 16 bits
Low-order 16 bits
32-bit binary data
ASCII code in "(Value
specifying number of
all digits - 1)"th digit
ASCII code in "(Value
specifying number of
all digits - 3)"th digit
ASCII code in "(Value
specifying number of
all digits - 2)"th digit
ASCII code in "(Value
specifying number of
all digits - 5)"th digit
ASCII code in "(Value
specifying number of
all digits - 4)"th digit
ASCII code in "(Value
specifying number of
all digits - 7)"th digit
ASCII code in "(Value
specifying number of
all digits - 6)"th digit
ASCII code in "(Value
specifying number of
all digits - 9)"th digit
ASCII code in "(Value
specifying number of
all digits - 8)"th digit
ASCII code in "(Value
specifying number of
all digits - 11)"th digit
ASCII code in "(Value
specifying number of
all digits - 10)"th digit
ASCII code in "(Value
specifying number of
all digits - 12)"th digit
For specifying
number of all
digits
3
10
1 2 3 4 5 . 6 7 8
2 3 4 5 6
8
7
1
Total number of digits
Number of digits of decimal part
32-bit binary data
Number of digits of decimal part
Added automatically
10
13
0 . 0 0 0 0 0 5 4 3 2 1
5 4
3 2 1
Total number of digits
Number of digits of decimal part
32-bit binary data
Added automatically
2
13
5
-
4
3 2
0
1
5
-
4 3 2 . 1 0
Total number of digits
Number of digits of decimal part
32-bit binary data
"20H (space)" is stored.
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......