REAL type variables

REAL type variables (REAL, LREAL, or floating-point numbers) are defined by the IEEE 754 (IEEE 754/1985 Floating Point Number Format) standard. This is a fairly complex type that, despite its intimidating complexity, is well-suited for storing fractional numbers.

If you are interested in the definition of the type, please look it up on Wikipedia, for example, because I can't; I can't explain how this type works simply.

REAL type variables

TypeBitByteValue range DEC
REAL324-3.402823e+38 .. -1.175 495e-38 .. +1.175 495e-38 .. +3.402823e+38
LREAL648-1.7976931348623158e+308 .. -2.2250738585072014e-308 .. +2.2250738585072014e-308 .. +1.7976931348623158e+308

In practice, REAL is suitable for handling fractions and large values. Due to its nature, it is mainly used for processing and evaluating measurements. It is important to note that, because of its structure, if a very large value is stored in it and we try to increase or decrease it by, say, a very small value, nothing will happen; the stored value will not change. The type is inherently not suitable for handling exact counters, since it handles numbers “in order of magnitude.“ INT is more appropriate for counting functions.

More information: TIA Datatypes: S7 data types summary table