1824
25 TYPE CONVERSION FUNCTIONS
25.27 Converting INT to STRING
25.27 Converting INT to STRING
INT_TO_STRING(_E)
These functions convert a value from INT data type to STRING data type.
■Description, type, data type
■Operation processing
• These functions convert the value input to (s) from INT data type to STRING data type, and output the converted value from
(d).
• Input an INT 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 -123 is input
• When SM701 (Number of output characters selection) is off, 00H is stored at the end of the string (4th word).
Ladder, FBD/LD Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=INT_TO_STRING(s);
[With EN/ENO]
d:=INT_TO_STRING_E(EN,ENO,s);
Argument Description Type Data type
EN Execution condition (TRUE: Executed, FALSE: Not executed) Input variable BOOL
s (IN) Input Input variable INT
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable STRING(6)
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)
EN ENO
ds
(s)
(d)
00H
+0
+3
+2
+1
INT
STRING
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 (hundreds place)
When SM701 is off, 00H is stored.
(s)
(d)
00H
32H(2)33H(3)
-123
31H(1)
2DH(-) +0
+3
+2
+1
20H
20H
Lower byteUpper byte