Learn PLCs free
Type ConversionBeginnerIEC 61131-3

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

NameTypeDescription
ININTInteger value to convert (-32768 to 32767)

Outputs

NameTypeDescription
OUTREALFloating-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

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

S

Siemens (TIA Portal)

Use CONVERT instruction or INT_TO_REAL in TIA Portal SCL.

AB

Allen-Bradley (Studio 5000)

Implicit conversion in most cases, or use COP instruction.

C

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.

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.

20
Ready-Made Templates
LD + ST
Both Languages Included
$29
One-Time Purchase
Get Instant Access -- $29

Instant download - 30-day money-back guarantee - Use on unlimited projects

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →