This article discusses how to convert integer data to float and vice versa in an Omron PLC. In PLC programming, integer data is used to store whole number values without decimal points, and float (floating point) data is used to store decimal numbers that require higher precision, such as temperature or speed measurements. Integer data is usually represented as INT, DINT, or SINT, and float data is generally represented as REAL or LREAL. The main difference between the two lies in precision: Integers are used for whole numbers only, and floats are used for fractional numbers.
Program Objective

16-BIT TO FLOATING: FLT(452)
The FLT 452 instruction converts a 16-bit signed binary value (INT) into a 32-bit float (REAL). It has a value range of -32,768 to 32,767. This instruction requires 3 word memory allocations (1 word for the source data, 2 words for the converted data).
32-BIT TO FLOATING: FLTL(453)
The FLT 453 instruction converts a 32-bit signed binary value (DINT) into a 32-bit float (REAL). It has a value range of -2,147,483,648 to 2,147,483,647. This instruction requires 4 word memory allocations (2 words for the source data, 2 words for the converted data).
FLOATING TO 16-BIT: FIX(450)
The FIX 450 instruction converts a 32-bit float (REAL) value into a 16-bit signed binary value (INT). It has a value range of -32,768 to 32,767. This instruction requires 3 word memory allocations (2 words for the source data, 1 word for the converted data).
FLOATING TO 32-BIT: FIXL(451)
The FIXL 451 instruction converts a 32-bit float (REAL) value into a 32-bit signed binary value (DINT). It has a value range of -2,147,483,648 to 2,147,483,647. This instruction requires 4 word memory allocations (2 words for the source data, 2 words for the converted data).
In this program, each instruction will be used to convert values from integer to float and from float to integer. Each instruction has its own trigger, and the given values can be configured.
Integer to Float Conversion
Simulation Video
In the video below, we show the results of this simulation program.
IO Mapping Details
S.No. | Comment | Input (I) | Memory Word |
---|---|---|---|
1 | TRIGGER_FLT | 0.00 | Â |
2 | TRIGGER_FLTL | 0.01 | Â |
3 | TRIGGER_FIX | 0.02 | Â |
4 | TRIGGER_FIXL | 0.03 | Â |
5 | INT_16BIT_DATA1 | Â | D0 |
6 | DINT_32BIT_DATA2 | Â | D2 |
7 | FLOAT_32BIT_DATA3 | Â | D4 |
8 | FLOAT_32BIT_DATA4 | Â | D6 |
9 | FLOAT_32BIT_DATA1 | Â | D10 |
10 | FLOAT_32BIT_DATA2 | Â | D16 |
11 | INT_16BIT_DATA3 | Â | D20 |
12 | DINT_32BIT_DATA4 | Â | D26 |
Omron PLC Programming
RUNG 0 (SIGNED BINARY 16 BIT TO FLOAT 32 BIT)
In this Rung, if the TRIGGER_FLT (0.00) button is pressed, the FLT(452) instruction will convert the 16-bit Signed Binary Integer value in the memory word INT_16BIT_DATA1 (D0) to a 32-bit Floating-point value. The converted value will be placed in the memory word FLOAT_32BIT_DATA1(D10).
RUNG 1 (SIGNED BINARY 32 BIT TO FLOAT 32 BIT)
In this Rung, if the TRIGGER_FLTL (0.01) button is pressed, the FLTL(453) instruction will convert the 32-bit Double Signed Binary Integer value in the memory word DINT_32BIT_DATA2 (D2) to a 32-bit Floating-point value. The converted result value will be placed in the memory word FLOAT_32BIT_DATA2 (D16).
RUNG 2 (FLOAT 32 BIT TO SIGNED BINARY 16 BIT)
In this Rung, if the TRIGGER_FIX(0.02) button is pressed, the FIX(450) instruction will convert the 32-bit Floating-point value in the memory word FLOAT_32BIT_DATA3 (D4) to a 16-bit Signed Binary Integer value. The converted value will be placed in the memory word INT_16BIT_DATA3 (D20).
RUNG 3 (FLOAT 32 BIT TO SIGNED BINARY 32 BIT)
In this Rung, if the TRIGGER_FIXL(0.03) button is pressed, the FIXL(451) instruction will convert the 32-bit Floating-point value in the memory word FLOAT_32BIT_DATA4 (D6) to a 32-bit Signed Binary double-integer value. The converted value will be placed in the memory word DINT_32BIT_DATA4 (D26).
Read Next:
- How to Use Modbus Poll and Modbus Slave Software?
- STAR-DELTA Auto and Manual Program using XG5000
- How to Program PID Control in PLC with Structured Text?
- PLC Program 1 Button To Activate 4 Different Machines
- Data Types in PLC – Bit, Byte, Integer, Real, String