INT_TO_STRING (Integer to String Conversion)
Converts integer value to its decimal string representation for display or logging.
The INT_TO_STRING function converts an integer value to its string (text) representation. This is essential for displaying numeric values on HMI screens, constructing log messages, building communication strings, and creating formatted output. The resulting string contains the decimal representation of the number, including a leading minus sign for negative values.
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN | INT | Integer value to convert to text |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | STRING | String representation (e.g., 42 becomes '42') |
Structured Text Example
// Build status message
Count_String := INT_TO_STRING(Part_Count);
Status_Msg := CONCAT('Parts produced: ', Count_String);
// Build log entry
Log_Entry := CONCAT('Error code: ', INT_TO_STRING(Error_Code));20 Production-Ready Ladder Logic Templates
Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.
Platform-Specific Implementation
Siemens (TIA Portal)
Use VAL_STRG or INT_TO_STRING in TIA Portal SCL.
Allen-Bradley (Studio 5000)
Use DTOS (DINT to String) instruction in Studio 5000.
CODESYS
Use INT_TO_STRING() function in ST.
Common Applications
- HMI display formatting
- Log message construction
- Serial communication strings
- Report generation
- Alarm message building
Frequently Asked Questions
What is INT_TO_STRING (Integer to String Conversion) in PLC programming?
Converts integer value to its decimal string representation for display or logging. The INT_TO_STRING function converts an integer value to its string (text) representation. This is essential for displaying numeric values on HMI screens, constructing log messages, building communication strings, and creating formatted output.
What are common applications of INT_TO_STRING (Integer to String Conversion)?
INT_TO_STRING (Integer to String Conversion) is commonly used for: HMI display formatting, Log message construction, Serial communication strings, Report generation, Alarm message building.
How do I use INT_TO_STRING (Integer to String Conversion) in different PLC platforms?
Siemens: Use VAL_STRG or INT_TO_STRING in TIA Portal SCL. Allen-Bradley: Use DTOS (DINT to String) instruction in Studio 5000. CODESYS: Use INT_TO_STRING() function in ST.
Related Function Blocks
INT_TO_REAL (Integer to Real Conversion)
Converts 16-bit integer to 32-bit floating-point real value.
View Reference →BOOL_TO_INT (Boolean to Integer Conversion)
Converts FALSE to 0 and TRUE to 1 for numeric operations.
View Reference →REAL_TO_INT (Real to Integer Conversion)
Converts 32-bit floating-point value to 16-bit integer with rounding.
View Reference →ANY_TO_ANY (Universal Type Conversion)
General type conversion framework covering all IEC 61131-3 type conversion functions.
View Reference →Stop Writing Ladder Logic From Scratch
Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.
Instant download - 30-day money-back guarantee - Use on unlimited projects