25 TYPE CONVERSION FUNCTIONS
25.36 Converting DINT to STRING
1837
25
■Operation processing
• These functions convert the value input to (s) from DINT data type to STRING data type, and output the converted value
from (d).
• Input a DINT data type value to (s).
• As sign data, 20H (space) is stored if the input value is positive, and 2DH (-) is stored if the value is negative.
• If the number of digits in the input value is less than the number of significant digits, 20H (space) is stored for the upper
digit(s).
When the value -123456 is input
• When SM701 (Number of output characters selection) is off, 00H is stored at the end of the string (upper bytes of the 6th
word).
■Operation result
1. Function without EN/ENO
The operation processing is performed. The operation result is output from (d).
2. Function with EN/ENO
The execution conditions and operation results will be as follows.
*1 If the value FALSE is output from ENO, the output data from (d) will be undefined. Create a program so that the undefined value will not
be used in operations.
There is no operation error.
Execution condition Operation result
EN ENO (d)
TRUE (executed) TRUE Operation result output value
FALSE (not executed) FALSE
*1
Undefined value
(s)
(d)
00H
+0
+3
+4
+5
+2
+1
STRING
DINT
When SM701 is off, 00H is stored.
Lower byteUpper byte
ASCII code (sign data)
ASCII code
(ten-thousands place)
ASCII code (tens place)
ASCII code (ones place)
ASCII code
(thousands place)
ASCII code (millions place)
ASCII code
(hundred-thousands place)
ASCII code
(hundred-millions place)
ASCII code
(ten-millions place)
ASCII code (billions place)
ASCII code (hundreds place)
(s)
(d)
00H
32H(2)33H(3)
34H(4)
36H(6)
35H(5)
-123456
31H(1)
2DH(-) +0
+3
+4
+5
+2
+1
20H
20H
20H
20H
Lower byteUpper byte