INT_TO_REAL (Integer to Real Conversion)
Converts 16-bit integer to 32-bit floating-point real value.
The INT_TO_REAL function converts an integer value (INT, 16-bit signed) to a floating-point real value (REAL, 32-bit IEEE 754). This conversion is essential when integer values from counters, analog inputs (raw counts), or recipe parameters need to be used in floating-point calculations such as PID control, scaling, or engineering unit conversions. The conversion is always exact for INT values since REAL has sufficient precision to represent all INT values.
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN | INT | Integer value to convert (-32768 to 32767) |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | REAL | Floating-point equivalent |
Ladder Logic Example
// Ladder Logic - INT_TO_REAL (Analog Scaling) // // |----[INT_TO_REAL]----[DIV]----[MUL]----| // | IN: Analog_Raw Scale calculation | // | OUT: Raw_Real for engineering |
Structured Text Example
// Convert raw analog (0-27648) to engineering units Raw_Real := INT_TO_REAL(Analog_Raw); Temperature := (Raw_Real / 27648.0) * 100.0; // 0-27648 raw -> 0.0-100.0 degrees
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 CONVERT instruction or INT_TO_REAL in TIA Portal SCL.
Allen-Bradley (Studio 5000)
Implicit conversion in most cases, or use COP instruction.
CODESYS
Use INT_TO_REAL() function in ST. Automatic in some contexts.
Common Applications
- Analog input scaling
- Counter value in calculations
- Recipe parameter conversion
- PID input preparation
- HMI display formatting
Frequently Asked Questions
What is INT_TO_REAL (Integer to Real Conversion) in PLC programming?
Converts 16-bit integer to 32-bit floating-point real value. The INT_TO_REAL function converts an integer value (INT, 16-bit signed) to a floating-point real value (REAL, 32-bit IEEE 754). This conversion is essential when integer values from counters, analog inputs (raw counts), or recipe parameters need to be used in floating-point calculations such as PID control, scaling, or engineering unit conversions.
What are common applications of INT_TO_REAL (Integer to Real Conversion)?
INT_TO_REAL (Integer to Real Conversion) is commonly used for: Analog input scaling, Counter value in calculations, Recipe parameter conversion, PID input preparation, HMI display formatting.
How do I use INT_TO_REAL (Integer to Real Conversion) in different PLC platforms?
Siemens: Use CONVERT instruction or INT_TO_REAL in TIA Portal SCL. Allen-Bradley: Implicit conversion in most cases, or use COP instruction. CODESYS: Use INT_TO_REAL() function in ST. Automatic in some contexts.
Related Function Blocks
REAL_TO_INT (Real to Integer Conversion)
Converts 32-bit floating-point value to 16-bit integer with rounding.
View Reference →BOOL_TO_INT (Boolean to Integer Conversion)
Converts FALSE to 0 and TRUE to 1 for numeric operations.
View Reference →INT_TO_STRING (Integer to String Conversion)
Converts integer value to its decimal string representation for display or logging.
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