Bit-oriented types: BOOL, BYTE, WORD and DWORD
BOOL represents TRUE or FALSE and is ideal for a sensor state, motor command, alarm flag or permissive condition.
BYTE contains 8 bits, WORD 16 bits and DWORD 32 bits. They are useful for bit fields, status words and masks. They are not floating-point types; select a numeric type when arithmetic meaning is required.
Integer types: INT, DINT and unsigned variants
INT is a signed 16-bit integer ranging from −32,768 to 32,767. DINT is a signed 32-bit integer with a wider range. They suit counts, step numbers and whole-number values when the process range is known.
Unsigned types such as UINT and UDINT represent zero and positive values only. They provide a larger positive range of the same bit width, but are unsuitable when negative values are possible.
Floating-point types: REAL and LREAL
REAL is a 32-bit floating-point type suited to measurements such as temperature, pressure, speed or percentage. LREAL uses 64 bits and offers greater precision where supported and justified.
Floating-point representation cannot exactly encode every decimal fraction. Use a suitable tolerance when comparing REAL values instead of relying on exact equality.
TIME and choosing the right type
TIME represents a duration in PLC logic, such as a motor start delay or a step timeout. Constants can be written as T#5s or T#1m_30s. A duration is different from a time of day or calendar date.
Start with the meaning of the variable: Boolean or numeric, integer or decimal, signed or unsigned, and what range is required. A pump state is BOOL, a part count may be INT/DINT, measured pressure is often REAL and a drive status word may be WORD.
Data conversion, overflow and scaling
Check the input and output types of PLC instructions. An INT may be sufficient for storing a whole number, while a calculation with fractional values may require conversion to REAL. Implicit or explicit conversion can introduce rounding, precision loss or range limitations. When exchanging values with an HMI or another PLC, data type and length must match and be documented on both sides.
Overflow occurs when a result exceeds the representable range of its data type. Validate input ranges, use suitable types for intermediate calculations and check or limit values before narrowing a type. For analog scaling, the raw value, engineering unit, sensor range and data type must all be consistent.
Key takeaways
- Use BOOL for logic, INT/DINT for integers and REAL for decimal measurements.
- WORD and DWORD are bit containers; do not confuse them with floating-point types.
- Choose types based on process range and whether negative or decimal values are required.
Need help applying this in a real project?
Explore Elecnic engineering services for Siemens PLC programming and troubleshooting, HMI/SCADA implementation, SINAMICS drive integration and commissioning support.
References and further reading
This is an original Elecnic article based on the technical references below. Always verify model-, firmware- and software-version-specific details in the official documentation for your equipment.

