UDINT
Quick answer
UDINT is a 32-bit unsigned PLC integer with the IEC range 0 to 4,294,967,295. Use it for large non-negative values only after confirming controller support and boundary behavior.
Key Takeaways
- UDINT is a 32-bit unsigned PLC integer with the IEC range 0 to 4,294,967,295. Use it for large non-negative values only ...
- Beginner-level topic in Data Types & Variables
- Commonly used in: Large non-negative counters and totals, Unsigned 32-bit protocol fields
- Related to: UINT, DINT, ULINT
Detailed Definition
UDINT stores a non-negative whole number in 32 bits. It is the unsigned arithmetic counterpart to DINT; DWORD is the 32-bit bit-string type. UDINT can hold values above the signed DINT maximum, but it cannot represent a negative difference or underflow.
Do not infer universal wrap behavior at zero or 4,294,967,295. A controller can report, reject, truncate or otherwise handle an out-of-range result according to its compiler, runtime and diagnostics. Guard the boundaries, and verify availability because older controller generations may not expose unsigned elementary types.
Technical reference
The IEC range is stable; older-controller availability and underflow/overflow outcomes are platform-specific.
Reviewed against current primary documentation:
UDINT PLC Data Type at a glance
- Type family
- Unsigned integer
- Width
- 32 bits (4 bytes)
- Signedness
- Unsigned
- Range / values
- 0 to 4,294,967,295
- IEC-style literal
- UDINT#4294967295
- Best fit
- Large non-negative values and explicitly unsigned 32-bit fields
Avoid this type when: A calculation can be negative or exceed 4,294,967,295.
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
Guard a maximum-width production total
VAR
LifetimeCount : UDINT := UDINT#0;
END_VAR
IF LifetimeCount < UDINT#4294967295 THEN
LifetimeCount := LifetimeCount + UDINT#1;
END_IF;The guard prevents an out-of-range addition. A real system also needs a defined response at maximum, such as an alarm, rollover record or wider accumulator.
Boundary cases to test
These are mathematical boundaries, not promises about one runtime's failure mode.
| Input / operation | Mathematical result | Safe engineering action |
|---|---|---|
| 4,294,967,295 + 1 | 4,294,967,296, which is outside UDINT range. | Apply the documented rollover policy or promote before addition. |
| 0 − 1 | −1, which UDINT cannot represent. | Use a signed intermediate or reject the decrement before it executes. |
Conversion guidance
- Check that a UDINT is no greater than 2,147,483,647 before converting to DINT.
- Use ULINT or LREAL only after confirming support and precision requirements.
- Do not substitute DWORD when arithmetic is intended.
- Document rollover behavior for counters and timestamps instead of relying on the runtime default.
Before using this type
- 1Test 0, 1, 2,147,483,647, 2,147,483,648 and 4,294,967,295.
- 2Confirm support on every deployed controller generation.
- 3Exercise the specified rollover or maximum response.
- 4Verify signed/unsigned mapping at communications boundaries.
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 System — Published ranges, widths and warning about information loss in narrowing conversions.
- Typed literals
Beckhoff Automation — Documents TYPE#literal notation and compile-time loss checks in TwinCAT.
- Studio 5000 elementary data types
Rockwell Automation — Ranges, conversion behavior and controller-family support in current Logix documentation.
- S7-1200 system manual: data types
Siemens — S7-1200 integer widths, ranges and constant examples; verify the manual for the CPU and firmware in use.
Common Questions
What is UDINT?
UDINT is a 32-bit unsigned PLC integer with the IEC range 0 to 4,294,967,295. Use it for large non-negative values only after confirming controller support and boundary behavior.
When should I use UDINT?
UDINT is particularly useful in scenarios such as Large non-negative counters and totals and Unsigned 32-bit protocol fields. Consider implementing it when you need reliable, efficient solutions for these types of applications.
What should I verify before using UDINT?
Test 0, 1, 2,147,483,647, 2,147,483,648 and 4,294,967,295. Confirm support on every deployed controller generation. Exercise the specified rollover or maximum response. Verify signed/unsigned mapping at communications boundaries.
What are related concepts I should learn?
To fully understand UDINT, you should also familiarize yourself with UINT, DINT, and ULINT. These concepts work together in industrial automation systems.
Continue Learning
Ready to deepen your understanding of UDINT? Here are some recommended resources:
Was this helpful?
Let us know if this glossary term helped you understand UDINT better.
Your feedback helps us improve our glossary and create better content for the PLC programming community.
Quick Info
- Category
- Data Types & Variables
- Difficulty
- Beginner
- Tier
- Important
About Data Types & Variables
Data structures, variable types, and memory organization