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));Free · no signup to try
Run this block in your browser
Try the instruction on a live rung before you copy it into a project — nothing to install.
Try it in your browser — no signupOpens plcsimulationsoftware.com — same team
Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad
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 →Free · no signup to try
Wire this block up and run it
Drop the instruction into a rung, press Run and watch it execute in your browser — then adapt it to your vendor tool.
Try it in your browser — no signupOpens plcsimulationsoftware.com — same team
Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad