IEC 61131-3 Data Types for PLC Programmers
Reference table of all IEC 61131-3 data types: BOOL, BYTE, WORD, DWORD, INT, DINT, REAL, LREAL, TIME, STRING, ARRAY, STRUCT, UDT. With bit widths, ranges, and Siemens S7 availability.
IEC 61131-3 Data Types for PLC Programmers
IEC 61131-3 defines a set of elementary and complex data types used across all five programming languages. This reference covers each type with its size, range, and availability on Siemens S7 platforms.
Elementary Data Types
Bit Types
| Type | Size | Range | Description | S7-300/400 | S7-1200/1500 |
|---|---|---|---|---|---|
| BOOL | 1 bit | TRUE / FALSE | Single binary value | ✅ | ✅ |
| BYTE | 8 bits | B#16#00 to B#16#FF | 8-bit unsigned | ✅ | ✅ |
| WORD | 16 bits | W#16#0000 to W#16#FFFF | 16-bit bit string | ✅ | ✅ |
| DWORD | 32 bits | DW#16#0000_0000 to DW#16#FFFF_FFFF | 32-bit bit string | ✅ | ✅ |
| LWORD | 64 bits | LW#16#0 to LW#16#FFFF_FFFF_FFFF_FFFF | 64-bit bit string | ❌ | ✅ |
Integer Types
| Type | Size | Range | Description | S7-300/400 | S7-1200/1500 |
|---|---|---|---|---|---|
| SINT | 8 bits | -128 to +127 | Short integer | ❌ | ✅ |
| INT | 16 bits | -32768 to +32767 | Integer | ✅ | ✅ |
| DINT | 32 bits | -2147483648 to +2147483647 | Double integer | ✅ | ✅ |
| LINT | 64 bits | -2^63 to +2^63-1 | Long integer | ❌ | ✅ |
| USINT | 8 bits | 0 to 255 | Unsigned short | ❌ | ✅ |
| UINT | 16 bits | 0 to 65535 | Unsigned integer | ❌ | ✅ |
| UDINT | 32 bits | 0 to 4294967295 | Unsigned double | ❌ | ✅ |
| ULINT | 64 bits | 0 to 2^64-1 | Unsigned long | ❌ | ✅ |
Floating-Point Types
| Type | Size | Range | Precision | S7-300/400 | S7-1200/1500 |
|---|---|---|---|---|---|
| REAL | 32 bits | ±3.4×10^38 | ~7 digits | ✅ | ✅ |
| LREAL | 64 bits | ±1.8×10^308 | ~15 digits | ❌ | ✅ |
Time and Date Types
| Type | Size | Format | Description | S7-300/400 | S7-1200/1500 |
|---|---|---|---|---|---|
| TIME | 32 bits | T#5m30s | Duration (ms resolution) | ✅ | ✅ |
| LTIME | 64 bits | LT#5m30s15ns | Duration (ns resolution) | ❌ | ✅ |
| DATE | 16 bits | D#2026-03-22 | Calendar date | ✅ | ✅ |
| TIME_OF_DAY (TOD) | 32 bits | TOD#14:30:00 | Time of day (ms) | ✅ | ✅ |
| DATE_AND_TIME (DT) | 64 bits | DT#2026-03-22-14:30:00 | Combined date+time | ✅ | ✅ |
| DTL | 12 bytes | — | Date+time+nanoseconds | ❌ | ✅ |
| S5TIME | 16 bits | S5T#2s | Legacy Siemens timer format (BCD) | ✅ | ✅ (compat.) |
Character Types
| Type | Size | Description | S7-300/400 | S7-1200/1500 |
|---|---|---|---|---|
| CHAR | 1 byte | Single ASCII character | ✅ | ✅ |
| WCHAR | 2 bytes | Unicode character | ❌ | ✅ |
| STRING | n+2 bytes | Variable-length string (max 254 chars) | ✅ | ✅ |
| WSTRING | 2n+4 bytes | Unicode string | ❌ | ✅ |
STRING stores the maximum length in byte 0 and the actual length in byte 1. The string data starts at byte 2. STRING[10] occupies 12 bytes.
Complex Data Types
| Type | Description | Use Case |
|---|---|---|
| ARRAY | Indexed collection of identical type elements | ARRAY[0..9] OF INT — 10 integers |
| STRUCT | Named collection of mixed type elements | Recipe parameters, sensor group |
| UDT | User-Defined Type — reusable STRUCT | Motor interface, valve control template |
Migration Note: S7-300/400 → S7-1500
Types marked ❌ for S7-300/400 are only available on S7-1200/1500. When migrating, you gain access to SINT, USINT, UINT, UDINT, LREAL, LINT, ULINT, LWORD, WCHAR, WSTRING, DTL, and LTIME. These enable more efficient programming but require code changes to use.
Analyze Your Code's Data Type Usage
PLCcheck Pro identifies data type mismatches, implicit conversions, and opportunities to use more efficient types after migration.
Upload code for data type analysis →
Part of the IEC 61131-3 Reference. Maintained by PLCcheck.ai. Not affiliated with Siemens AG or IEC.
Related Articles
PLC Memory Optimization: Reducing Data Block Usage
Practical techniques for reducing PLC memory usage on S7-300/400 where memory is limited. Covers DB optimization, marker cleanup, dead code removal, and string handling.
8 min read
migration-guideIEC 61131-3 Compliance: Making Your PLC Code Portable
How to write PLC code that is portable between different manufacturers. Covers IEC 61131-3 compliance levels, vendor-specific extensions to avoid, and practical portability strategies.
8 min read
plc-programmingHow to Create a PLC Variable/Tag Table from Scratch
Step-by-step guide for creating a PLC symbol table or tag table when no documentation exists. Covers I/O assignment, naming conventions, and tools for STEP 7 and TIA Portal.
10 min read
Analyze your PLC code with AI
PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.