The two data types split the world between them. A DINT is a 32-bit signed integer: exact, fast, the natural type for counts — encoder pulses, raw ADC values, part totals — covering −2,147,483,648 to 2,147,483,647 with no fractions. A REAL is a 32-bit IEEE-754 float: it holds fractions and huge ranges, but stores only about 7 significant digits. Real programs constantly cross the boundary — a flow total in pulses needs dividing by pulses-per-litre, a raw analog count needs scaling to engineering units — and DINT_TO_REAL is that crossing, in the integer-to-float direction.
In Studio 5000 the conversion happens two ways. Implicitly: ladder instructions convert between numeric types whenever operands differ, so MOV Encoder_Counts Flow_REAL, or a DIV with a DINT input and a REAL destination, quietly performs the conversion — most AB programs never write the conversion explicitly at all. Explicitly: in Structured Text, DINT_TO_REAL(Encoder_Counts) makes the conversion visible, which is the style IEC 61131-3 platforms enforce — CODESYS and TIA Portal are strictly typed, and DINT_TO_REAL (TIA: DINT_TO_REAL conversion box, or CONVERT in LAD) is a standard-defined function, one member of the big TYPE_TO_TYPE conversion family.
The precision trap is the part worth reading twice. A REAL’s mantissa holds 24 bits, so every integer up to 16,777,216 (2²⁴) converts exactly — and beyond that, a REAL cannot represent every integer. Convert a DINT of 16,777,217 and you get 16,777,216.0; at a billion, the gaps between representable floats are 64 wide. A totalizer that accumulates in REAL (or converts a large DINT total for display) stops counting individual events long before the DINT itself would overflow. The professional pattern: accumulate in DINT (or LINT), convert late, and if a running total must be fractional, use scaled-integer techniques or 64-bit floats where the platform offers them (LREAL).
The reverse direction — REAL_TO_DINT — has its own rule: rounding. Logix rounds to nearest with ties going to the even number (2.5 → 2, 3.5 → 4), IEC REAL_TO_DINT rounds to nearest, and truncation requires asking for it (TRUNC / TRN). Any conversion pair in a loop (DINT → REAL → math → DINT) should be audited for where the rounding happens — once per scan of accumulated rounding error is a genuine drift bug.