What is Structured Text?
Structured Text (ST) is a high-level text-based PLC language similar to Pascal or C. Learn the basics and run ST programs in the rungs.dev browser-based simulator.
Basic ST Syntax
Statement structure, semicolons, expressions, and basic syntax rules for Structured Text in rungs.dev — the foundation every ST program in the simulator follows.
Variables and Assignment
Declare and assign values to variables in Structured Text on rungs.dev. Learn naming rules, := assignment semantics, and how variables map to PLC tags during execution.
Arithmetic and Comparison Operators
Reference for arithmetic and comparison operators in Structured Text on rungs.dev, including built-in math functions and DINT/REAL rounding rules.
Logical Operators
Logical operators AND, OR, XOR, and NOT combine BOOL expressions in Structured Text on rungs.dev to build expressive multi-condition IF and CASE statements.
IF...THEN...ELSE Statements
IF…THEN…ELSE statements drive conditional logic in Structured Text on rungs.dev. Learn syntax, ELSIF chains, and patterns for evaluating BOOL conditions every scan.
CASE Statements
CASE statements in Structured Text on rungs.dev select one branch from many based on a numeric expression — tidier than long IF…ELSIF chains for state machines.
Loop Statements
Reference for FOR…DO, WHILE…DO, REPEAT…UNTIL, EXIT, and CONTINUE loop statements in Structured Text on rungs.dev — syntax, semantics, and examples.
Comments and Documentation
Document Structured Text in rungs.dev with single-line and multi-line comments. Learn syntax, conventions, and patterns that make PLC programs maintainable.
Instructions
4 items
Simple Examples and Patterns
Reusable Structured Text patterns and worked examples in rungs.dev — motor start/stop, latching, edge detection, scaling, and other common PLC programming tasks.