5 Applied Functions
5.1 Type Conversion Functions
62
FXCPU Structured Programming Manual
(Application Functions)
5.1.14 DINT_TO_STR(_E)
Outline
This function converts double word [signed] data into string data, and outputs the data obtained by
conversion.
1. Format
*1.
Output variable
2. Set data
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
1) This function converts double word [signed] data stored in a device specified in
into string data, and
outputs the data obtained by conversion to a device specified in
.
2) In "Sign data", "20H (space)" is stored when the input value is positive, and "2DH (-)" is stored when the
input value is negative.
3) "20H (space)" is stored in high-order digits when the number of significant figures is small.
Example: When "-123456" is input
4) "00H" is automatically stored at the end (high-order byte of the 6th word) of the character string.
FX
3U(C)
FX
3G
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Function name
Expression in each language
Structured ladder
ST
DINT_TO_STR
DINT_TO_STR(_DINT);
Example:
Label 2:=
DINT_TO_STR(Label 1);
DINT_TO_STR_E
DINT_TO_STR_E(EN,_DINT,
Output label);
Example:
DINT_TO_STR_E(X000,
Label 1, Label 2);
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
_DINT (
)
Conversion source double word [signed] data
Double Word [signed]
Output
variable
ENO
Execution status
Bit
*1
(
)
String data after conversion
String
DINT_TO_STR
_DINT
*1
Label 1
Label 2
DINT_TO_STR_E
EN
ENO
*1
Label 2
X000
Label 1
_DINT
s
d
s
d
Double word [signed] data
ASCII code for billions place
High-order byte
ASCII code for ten-millions place ASCII code for hundred-millions place
ASCII code for millions place
ASCII code for hundred-thousands place
ASCII code for ten-thousands place
ASCII code for thousands place
ASCII code for hundreds place
ASCII code for tens place
ASCII code for ones place
00H
Sign data
Low-order byte
Automatically stored at the end of the character string
String
1st word
2nd word
3rd word
4th word
5th word
6th word
Double word [signed] data
20H (space)
High-order byte
20H (space)
20H (space)
20H (space)
31H (1)
32H (2)
33H (3)
34H (4)
35H (5)
36H (6)
00H
2DH (-)
Low-order byte
String
1st word
2nd word
3rd word
4th word
5th word
6th word
-123456