SCL Data Types Reference: BOOL, INT, DINT, REAL, STRING, ARRAY, STRUCT
Complete SCL data type reference for Siemens TIA Portal. Elementary types (BOOL, INT, DINT, REAL, STRING), complex types (ARRAY, STRUCT, UDT), value ranges, and memory sizes.
SCL Data Types Reference
Elementary Data Types
| Data Type | Size | Value Range | Example |
|---|---|---|---|
| BOOL | 1 bit | TRUE / FALSE | #Start := TRUE; |
| BYTE | 8 bit | B#16#00 to B#16#FF | #Mask := B#16#0F; |
| WORD | 16 bit | W#16#0000 to W#16#FFFF | #Status := W#16#00FF; |
| DWORD | 32 bit | DW#16#0000_0000 to DW#16#FFFF_FFFF | #Raw := DW#16#0000_1234; |
| SINT | 8 bit | -128 to +127 | #Small := SINT#42; |
| USINT | 8 bit | 0 to 255 | #Byte_Val := USINT#200; |
| INT | 16 bit | -32,768 to +32,767 | #Counter := 100; |
| UINT | 16 bit | 0 to 65,535 | #Positive := UINT#50000; |
| DINT | 32 bit | -2,147,483,648 to +2,147,483,647 | #BigCount := DINT#100000; |
| UDINT | 32 bit | 0 to 4,294,967,295 | #Total := UDINT#3000000000; |
| REAL | 32 bit | ±1.18×10⁻³⁸ to ±3.40×10³⁸ (IEEE 754) | #Temp := 23.5; |
| LREAL | 64 bit | ±2.23×10⁻³⁰⁸ to ±1.79×10³⁰⁸ | #Precise := LREAL#3.14159265; |
| CHAR | 8 bit | 1 ASCII character | #Letter := 'A'; |
| WCHAR | 16 bit | 1 Unicode character | #Wide := WCHAR#"Ä"; |
Note: SINT, USINT, UINT, UDINT, LREAL, WCHAR are available on S7-1200 and S7-1500 only (not on S7-300/400).
String Types
| Data Type | Size | Description | Example |
|---|---|---|---|
| STRING[n] | n+2 bytes | ASCII string, max 254 chars | #Name : STRING[20] := 'Sensor_1'; |
| WSTRING[n] | 2n+4 bytes | Unicode string | #Text : WSTRING[50] := "Prüfung"; |
STRING internals: A STRING[10] occupies 12 bytes in memory. The first byte stores the maximum length (10), the second byte stores the current length, followed by the character data. Strings are NOT null-terminated like C strings.
Time and Date Types
| Data Type | Size | Format | Example |
|---|---|---|---|
| TIME | 32 bit | T#value | #Delay := T#5s; |
| S5TIME | 16 bit | S5T#value (BCD, legacy) | #OldTimer := S5T#10s; |
| DATE | 16 bit | D#YYYY-MM-DD | #Today := D#2026-03-22; |
| TIME_OF_DAY (TOD) | 32 bit | TOD#HH:MM:SS.sss | #Now := TOD#14:30:00; |
| DATE_AND_TIME (DT) | 64 bit | DT#YYYY-MM-DD-HH:MM:SS | #Timestamp := DT#2026-03-22-14:30:00; |
| LTIME | 64 bit | LT#value (nanoseconds) | #Precise := LT#1s500ms; (S7-1500 only) |
Complex Data Types
ARRAY
Fixed-size collection of elements of the same type:
VAR
#Temperatures : ARRAY[0..9] OF REAL; // 10 REAL values
#Names : ARRAY[1..5] OF STRING[20]; // 5 strings
#Matrix : ARRAY[0..2, 0..2] OF INT; // 3×3 matrix (up to 6 dimensions)
END_VAR
#Temperatures[0] := 23.5;
#Matrix[1, 2] := 42;
STRUCT
Groups different data types together:
VAR
#Motor : STRUCT
Running : BOOL;
Speed : INT;
Current : REAL;
Name : STRING[20];
END_STRUCT;
END_VAR
#Motor.Running := TRUE;
#Motor.Speed := 1500;
UDT (User-Defined Type / PLC Data Type)
Reusable type definition. Defined in "PLC data types" folder, then used in DBs and block interfaces:
// UDT definition (in PLC data types)
TYPE "Motor_Data"
Running : BOOL;
Speed : INT;
Current : REAL;
END_TYPE
// Usage in a DB
VAR
#Motor_1 : "Motor_Data";
#Motor_2 : "Motor_Data";
END_VAR
Type Conversions
Common conversion functions:
| From | To | Function |
|---|---|---|
| INT | DINT | INT_TO_DINT(x) |
| INT | REAL | INT_TO_REAL(x) |
| DINT | REAL | DINT_TO_REAL(x) |
| REAL | INT | REAL_TO_INT(x) — rounds |
| REAL | DINT | REAL_TO_DINT(x) |
Part of the SCL Reference. Maintained by PLCcheck.ai.
Convert Your AWL Code to SCL
PLCcheck Pro analyzes your S5/S7 AWL code and generates SCL equivalents automatically. Upload your program and see the conversion side by side.
Related Articles
S7-300 to S7-1500 Migration: Complete Guide
Step-by-step guide for migrating Siemens S7-300 PLC programs to S7-1500 using TIA Portal. Covers hardware mapping, software migration wizard, optimized data blocks, AWL→SCL conversion, and common pitfalls.
15 min read
migration-guideSTL/AWL Deprecation in S7-1500: Why You Must Convert to SCL
Why AWL/STL runs only in emulation mode on S7-1500, what that means for performance and maintainability, and how to convert your STL code to SCL. Includes conversion strategy and code examples.
10 min read
migration-guideS5 to S7 Migration: The Complete Guide (2026)
Step-by-step guide for migrating Siemens S5 PLC programs to S7-1500. Covers AWL→SCL conversion, timer mapping, address translation, and hardware selection.
18 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.