7 APPLICATION INSTRUCTION
7.6 Character string operation instruction
379
7
• 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 16-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 16-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 16-bit binary data, "20H" (space) is stored
between the sign and the numeric value. If the number of digits of the 16-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.
Error code
(SD0/SD8067)
Description
3401 The number of digits specified by (s1) is smaller than the number of digits plus 2 of the 16-bit binary data in the device specified by (s2).
(The additional 2 digits indicate the sign (+/-) and the decimal point.)
The total number of digits specified by (s1) is out of the valid range (2 to 8).
The number of digits in the decimal part specified by (s1)+1 is out of the valid range (0 to 5).
The relationship between the total number of digits specified by (s1) and the number of digits in the decimal part specified by (s1)+1 does
not satisfy the following.
(Total number of digits)-3 Number of digits in the decimal part
3406 The device areas storing the character string specified by (d) exceed the corresponding device range.
2820 The device range specified by (s1) exceeds the corresponding device range.
1234
2
6
12.34
Total number of digits
16-bit binary data
Number of digits of decimal part
Added automatically
Number of digits of decimal part
12
3
6
0.012
Total number of digits
Number of digits of decimal part
16-bit binary data
Added automatically
-123
1
8
12. 3
-
Total number of digits
Number of digits of decimal part
16-bit binary data
"20H (space)" is stored.