SINT
Quick answer
SINT is an 8-bit signed PLC integer with the IEC range −128 to 127. Use it for genuinely small signed values and verify promotion, overflow and device mapping on the target runtime.
Key Takeaways
- SINT is an 8-bit signed PLC integer with the IEC range −128 to 127. Use it for genuinely small signed values and verify ...
- Beginner-level topic in Data Types & Variables
- Commonly used in: Signed 8-bit protocol and device fields, Small offsets and status codes
- Related to: USINT, INT, BYTE
Detailed Definition
SINT stores signed whole numbers in eight bits. Its negative range distinguishes it from USINT, while BYTE describes an eight-bit bit string rather than an arithmetic type. SINT is useful when a protocol, device or packed structure specifically requires an 8-bit signed field.
Do not assume a universal result when arithmetic leaves the SINT range. A compiler or runtime can reject, flag, truncate, wrap or otherwise handle an out-of-range result according to its rules and settings. Promote operands before arithmetic when the result can exceed the SINT range, then validate before narrowing back.
Technical reference
The width and IEC range are stable; runtime overflow handling and mixed-type promotion are not universal.
Reviewed against current primary documentation:
SINT PLC Data Type at a glance
- Type family
- Signed integer
- Width
- 8 bits (1 byte)
- Signedness
- Signed
- Range / values
- −128 to 127
- IEC-style literal
- SINT#-12
- Best fit
- A field that is explicitly defined as a signed 8-bit integer
Avoid this type when: Normal arithmetic can leave the −128 to 127 range.
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
Widen a signed offset before arithmetic
VAR
TemperatureOffset : SINT := SINT#-12;
OffsetForMath : INT;
END_VAR
OffsetForMath := SINT_TO_INT(TemperatureOffset);The wider destination preserves every SINT value. Conversion-function names and implicit-promotion rules must still be checked in the target IDE.
Boundary cases to test
These are mathematical boundaries, not promises about one runtime's failure mode.
| Input / operation | Mathematical result | Safe engineering action |
|---|---|---|
| 127 + 1 | 128, which is outside SINT range. | Promote to INT before addition or guard the upper boundary; verify runtime diagnostics. |
| −128 − 1 | −129, which is outside SINT range. | Promote or reject the operation before assigning the result to SINT. |
Conversion guidance
- Widen SINT to INT or DINT before calculations whose intermediate result can exceed eight bits.
- Range-check an INT or DINT before narrowing to SINT.
- Do not substitute BYTE when arithmetic signedness matters.
- Confirm how the target maps signed 8-bit fields over OPC UA, Modbus or a vendor protocol.
Before using this type
- 1Test −128, −127, 0, 126 and 127.
- 2Attempt both just-over and just-under-range values in a test project.
- 3Monitor overflow or math-status diagnostics during arithmetic.
- 4Verify protocol encoding with a negative sample value.
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 SINT?
SINT is an 8-bit signed PLC integer with the IEC range −128 to 127. Use it for genuinely small signed values and verify promotion, overflow and device mapping on the target runtime.
When should I use SINT?
SINT is particularly useful in scenarios such as Signed 8-bit protocol and device fields and Small offsets and status codes. Consider implementing it when you need reliable, efficient solutions for these types of applications.
What should I verify before using SINT?
Test −128, −127, 0, 126 and 127. Attempt both just-over and just-under-range values in a test project. Monitor overflow or math-status diagnostics during arithmetic. Verify protocol encoding with a negative sample value.
What are related concepts I should learn?
To fully understand SINT, you should also familiarize yourself with USINT, INT, and BYTE. These concepts work together in industrial automation systems.
Continue Learning
Ready to deepen your understanding of SINT? Here are some recommended resources:
Was this helpful?
Let us know if this glossary term helped you understand SINT 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