Learn PLCs free
Data Types & VariablesBeginnerEssential
4 min read
Updated
Beginner

DINT

DINT

Quick answer

DINT is a 32-bit signed PLC integer with the IEC range −2,147,483,648 to 2,147,483,647. It suits large signed counts, but overflow, narrowing and REAL precision are runtime concerns.

Key Takeaways

  • DINT is a 32-bit signed PLC integer with the IEC range −2,147,483,648 to 2,147,483,647. It suits large signed counts, bu...
  • Beginner-level topic in Data Types & Variables
  • Commonly used in: Signed production totals and encoder positions, Whole-number calculations beyond INT range
  • Related to: INT, UDINT, LINT

Detailed Definition

DINT stores a signed whole number in 32 bits. Its sign and range distinguish it from UDINT, the unsigned numeric type, and DWORD, the 32-bit bit-string type. Choose DINT only after calculating the minimum and maximum input and intermediate values.

Arithmetic outside the DINT range has no portable outcome across PLC runtimes. Narrowing to INT can lose high-order information, while converting a large DINT to a 32-bit REAL can lose least-significant integer precision. Use explicit conversions, validate boundaries and prefer LREAL when exact large-integer-to-floating conversion matters.

Technical reference

The IEC range is stable; overflow handling, narrowing diagnostics and floating conversion behavior depend on the target.

Reviewed against current primary documentation:

DINT PLC Data Type at a glance

Type family
Signed integer
Width
32 bits (4 bytes)
Signedness
Signed
Range / values
−2,147,483,648 to 2,147,483,647
IEC-style literal
DINT#1000000
Best fit
Large signed whole-number values and intermediate arithmetic

Avoid this type when: A value needs more than 31 magnitude bits or exact fractions.

Vendor notation and support boundaries

IEC names help portability, but controller generations, compiler options and instruction signatures still differ.

CODESYS / TwinCAT

The IEC-style type and TYPE#literal form are available. The compiler can reject an out-of-range typed literal, but runtime arithmetic still needs boundary testing.

Siemens SIMATIC

S7-1200 documentation lists the IEC signed and unsigned integer widths used here. Confirm instruction support and conversion behavior for the exact CPU and TIA Portal version.

Rockwell Logix

Current documentation lists unsigned types on 5380/5580-class and newer controllers, while 5370/5570-class controllers list the signed integer family only. Check the controller family before choosing a portable tag type.

IEC-style Structured Text

Scale encoder counts with a wider floating type

VAR
  EncoderCounts : DINT;
  MmPerCount : LREAL := 0.0125;
  PositionMm : LREAL;
END_VAR

PositionMm := DINT_TO_LREAL(EncoderCounts) * MmPerCount;

Converting before multiplication preserves fractional output and gives more integer precision than a 32-bit REAL path. Confirm LREAL support and performance on the target.

Boundary cases to test

These are mathematical boundaries, not promises about one runtime's failure mode.

Input / operationMathematical resultSafe engineering action
2,147,483,647 + 12,147,483,648, which is outside DINT range.Guard the total or promote to a supported 64-bit integer before addition.
DINT 65,665 narrowed to INTThe source cannot be represented by INT.Range-check first; Rockwell documents truncation plus overflow, but other runtimes can differ.

Conversion guidance

  • Range-check before narrowing DINT to INT or SINT.
  • Use LREAL rather than REAL when large integer precision must be retained.
  • Do not substitute DWORD when numeric signed arithmetic is intended.
  • Use an explicit, tested conversion when moving between DINT and UDINT.

Before using this type

  1. 1Calculate input, intermediate and lifetime-total boundaries.
  2. 2Test both signed extremes and zero.
  3. 3Test narrowing conversions just inside and outside the destination range.
  4. 4Compare REAL and LREAL results at large DINT values if precision matters.

Primary technical sources

These sources support the type ranges and platform notes above. The project's controller, firmware and compiler documentation remains authoritative for execution.

  • Integer data types

    CODESYS Development SystemPublished ranges, widths and warning about information loss in narrowing conversions.

  • Typed literals

    Beckhoff AutomationDocuments TYPE#literal notation and compile-time loss checks in TwinCAT.

  • Studio 5000 elementary data types

    Rockwell AutomationRanges, conversion behavior and controller-family support in current Logix documentation.

  • S7-1200 system manual: data types

    SiemensS7-1200 integer widths, ranges and constant examples; verify the manual for the CPU and firmware in use.

Common Questions

What is DINT?

DINT is a 32-bit signed PLC integer with the IEC range −2,147,483,648 to 2,147,483,647. It suits large signed counts, but overflow, narrowing and REAL precision are runtime concerns.

When should I use DINT?

DINT is particularly useful in scenarios such as Signed production totals and encoder positions and Whole-number calculations beyond INT range. Consider implementing it when you need reliable, efficient solutions for these types of applications.

What should I verify before using DINT?

Calculate input, intermediate and lifetime-total boundaries. Test both signed extremes and zero. Test narrowing conversions just inside and outside the destination range. Compare REAL and LREAL results at large DINT values if precision matters.

What are related concepts I should learn?

To fully understand DINT, you should also familiarize yourself with INT, UDINT, and LINT. These concepts work together in industrial automation systems.

Was this helpful?

Let us know if this glossary term helped you understand DINT better.

Your feedback helps us improve our glossary and create better content for the PLC programming community.

Quick Info

Difficulty
Beginner
Tier
Essential

About Data Types & Variables

Data structures, variable types, and memory organization

Total Terms:30
Difficulty:Beginner to Intermediate

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch machine scenarios react. A 12-lesson curriculum across 8 PLC dialects — free account, no credit card.

Practice PLCs free →