IEC 61131-3 · Programmierung
Strukturierter Text ist die leistungsfähigste IEC 61131-3-Sprache. Sie liest sich wie Pascal oder C und ist ideal für komplexe Logik, Mathematik und Algorithmen.
Watch the video first, then work through the interactive exercises below. Each section builds on the previous one.
ST is one of five languages defined in IEC 61131-3. Unlike Ladder Logic (graphical) or Instruction List (assembly-like), ST is a high-level textual language — making it ideal for complex calculations, state machines, and reusable function blocks.
Both do the same thing — ST is more readable for complex logic.
In ST muss jede Variable mit einem Typ deklariert werden. Die häufigsten Typen sind BOOL, INT, DINT, REAL, STRING und TIME.
VAR
motor_drehzahl : REAL := 0.0;
laeuft : BOOL := FALSE;
zyklus_zaehler : DINT := 0;
END_VAR
Common Data Types
| Type | Size | Range / Example | Use case |
|---|---|---|---|
| BOOL | 1 bit | TRUE / FALSE | Digital signals, flags |
| INT | 16 bit | -32768 to 32767 | Counters, small values |
| DINT | 32 bit | ±2.1 billion | Large counters, positions |
| REAL | 32 bit | 3.14, -0.001 | Speeds, temperatures, ratios |
| STRING | variable | 'Conveyor A' | Labels, messages |
| TIME | 32 bit | T#500ms, T#2s | Timers, delays |
Deklarieren Sie eine Variable "temperatur" vom Typ REAL mit einem Anfangswert von 20.0
Test your knowledge before moving on.
Q1. What keyword ends an IF block in ST?
Q2. Which data type would you use for a motor speed of 1450.5 RPM?
Q3. What does the := operator do in ST?
Now that you understand ST fundamentals, here's where to go next: