USINT
Quick answer
USINT is an 8-bit unsigned PLC integer with the IEC range 0 to 255. It supports non-negative arithmetic, unlike the BYTE bit-string type, but availability varies by controller family.
Key Takeaways
- USINT is an 8-bit unsigned PLC integer with the IEC range 0 to 255. It supports non-negative arithmetic, unlike the BYTE...
- Beginner-level topic in Data Types & Variables
- Commonly used in: Unsigned 8-bit protocol and device fields, Small indexes and sequence values
- Related to: SINT, BYTE, UINT
Detailed Definition
USINT stores a non-negative whole number in eight bits. It shares the 0-to-255 bit capacity of BYTE, but the intended interpretation is arithmetic rather than a raw bit string. It suits byte-sized counts, indexes and protocol fields whose specification is explicitly unsigned.
Unsigned does not mean overflow-safe. Subtracting from zero or incrementing 255 produces a mathematical result outside the USINT range. The controller may reject, flag, truncate or wrap an out-of-range result, so guard the boundary or use a wider intermediate type.
Technical reference
The IEC range is stable; controller-family support and underflow/overflow behavior must be verified.
Reviewed against current primary documentation:
USINT PLC Data Type at a glance
- Type family
- Unsigned integer
- Width
- 8 bits (1 byte)
- Signedness
- Unsigned
- Range / values
- 0 to 255
- IEC-style literal
- USINT#255
- Best fit
- A non-negative arithmetic field explicitly limited to eight bits
Avoid this type when: A value can become negative or exceed 255.
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 an 8-bit station index
VAR
StationIndex : USINT := USINT#0;
END_VAR
IF StationIndex < USINT#255 THEN
StationIndex := StationIndex + USINT#1;
END_IF;The comparison prevents an out-of-range increment. The real application should usually compare against the array or station limit, not merely the type maximum.
Boundary cases to test
These are mathematical boundaries, not promises about one runtime's failure mode.
| Input / operation | Mathematical result | Safe engineering action |
|---|---|---|
| 255 + 1 | 256, which is outside USINT range. | Guard, clamp or promote according to the application requirement before assignment. |
| 0 − 1 | −1, which an unsigned value cannot represent. | Use a signed intermediate or prevent the decrement at zero. |
Conversion guidance
- Widen to UINT or DINT before arithmetic with a result that can exceed 255.
- Check both lower and upper bounds before narrowing from INT, UINT or DINT.
- Use BYTE for masks and packed flags; use USINT when numeric intent matters.
- Check whether an older controller family supports USINT before using it in shared libraries.
Before using this type
- 1Test 0, 1, 254 and 255.
- 2Verify the required behavior when decrementing zero.
- 3Confirm support on every target controller family.
- 4Compare the transmitted byte with the protocol specification.
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.
- PLC variable naming and type families
CODESYS Development System — Distinguishes arithmetic integer types from WORD-family bit strings.
- 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.
Common Questions
What is USINT?
USINT is an 8-bit unsigned PLC integer with the IEC range 0 to 255. It supports non-negative arithmetic, unlike the BYTE bit-string type, but availability varies by controller family.
When should I use USINT?
USINT is particularly useful in scenarios such as Unsigned 8-bit protocol and device fields and Small indexes and sequence values. Consider implementing it when you need reliable, efficient solutions for these types of applications.
What should I verify before using USINT?
Test 0, 1, 254 and 255. Verify the required behavior when decrementing zero. Confirm support on every target controller family. Compare the transmitted byte with the protocol specification.
What are related concepts I should learn?
To fully understand USINT, you should also familiarize yourself with SINT, BYTE, and UINT. These concepts work together in industrial automation systems.
Continue Learning
Ready to deepen your understanding of USINT? Here are some recommended resources:
Was this helpful?
Let us know if this glossary term helped you understand USINT 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