DINT to String (DTOS)

The DTOS instruction produces the ASCII representation of a value.
The DTOS instruction converts the Source to a string of ASCII characters and places the result in the Destination.
Available Languages
Ladder Diagram
Ladder Diagram_DINT to String (DTOS)_v1
FactoryTalk Design Studio DSL - Ladder Diagram
DTOS(Source,Dest);
Operands
Ladder Diagram
Operand
Type
Format
Description
Notes
Source
SINT
INT
DINT
REAL
Tag
The tag that contains the value
If the Source is a REAL, the instruction converts it to a DINT value.
Destination
String type
Tag
The tag to store the integer value
String types are:
  • default STRING data type
  • any new string type you create
Affects Math Status Flags
No
Major/Minor Faults
Type
Code
Cause
Recovery Method
4
51
The LEN value of the string tag is greater than the DATA size of the string tag.
Check that no instruction is writing to the LEN member of the string type tag.
In the LEN value, enter the number of characters that the string contains.
4
52
The output string is larger than the destination.
Create a new string type that is large enough for the output string. Use the new string type as the data type for the destination.
See Index through arrays for operand-related faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
N/A
Rung-condition-in is false
N/A
Rung-condition-in is true
The instruction executes.
Postscan
N/A
Example
When temp_high is set, the DTOS instruction converts the value in msg_num to a string of ASCII characters and places the result in msg_num_ascii. Subsequent rungs insert or concatenate msg_num_ascii with other strings to produce a complete message for a display terminal.
Ladder Diagram
FTStudio-DTOS-LD-EX-V1
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.