Structured Text Input
Tab=2 spaces | Ctrl+Enter=Convert | Click L## in messages to jump to line
Ready - press Convert or start typing
Instruction List
destination in orange
ST Syntax Reference
VAR Block (typed)
VAR
name
name
name
name
END_VAR
name
: BOOL;name
: INT := 0;name
: TON;name
: R_TRIG;END_VAR
BOOL -> R8681/R8682 (max 32)
INT -> R8683..R8688 (max 6)
TON -> R8028/R8029 (max 2)
Constants R8675-R8680: read-only!
Function Blocks
T1(IN:=bit, PT:=100);C1(CU:=bit, PV:=5);E1(CLK:=bit); R_TRIGF1(CLK:=bit); F_TRIGUse E1.Q in IF conditions
VAR_ALIAS
VAR_ALIAS
Name
Name
END_VAR_ALIAS
Name
:= R####.N; (bit)Name
:= R####; (register)END_VAR_ALIAS
Place before any program statements.
IF / ELSE / END_IF
IF cond THEN
statements;
ELSE (optional)
statements;
END_IF;
statements;
ELSE (optional)
statements;
END_IF;
Operators: AND OR NOT
OK: A AND B AND C
OK: A OR B OR C
NO: A AND B OR C (mixed)
Bit Statements
SET(R####.N);
RESET(R####.N);
R####.N := 1; (SET)
R####.N := 0; (RESET)
RESET(R####.N);
R####.N := 1; (SET)
R####.N := 0; (RESET)
Bit index must be 0..15
Register Math
Rc := Ra + Rb;
Rc := Ra - Rb;
Rc := Ra * Rb;
Rc := Ra / Rb;
Rb := Ra; (MOV)
CMP(Ra, Rb);
Rc := Ra - Rb;
Rc := Ra * Rb;
Rc := Ra / Rb;
Rb := Ra; (MOV)
CMP(Ra, Rb);
Destination shown in orange in IL.
Top-level: always executes.
Inside IF: conditional.
Constants (read-only)
R8675 = 0R8676 = 1R8678 = 10R8679 = 100R8680 = 1000
Cannot be write destination!
Literals 0,1,10,100,1000 auto-map.
Flags R8671
.0 Timer1 expired.1 Timer2 expired.2 LT (Pa < Pb after CMP).3 EQ (Pa = Pb).4 GT (Pa > Pb)
Key Registers
R4620 Digital inputsR4621 Digital outputsR4622 User outputR4625 Position lowR4096 Drive controlR8028 Timer1R8029 Timer2R8683..R8685 User registers
Gutter markers
! Error on this line
W Warning on this line
i Hint
Click L## tags to jump to line.
W Warning on this line
i Hint
Click L## tags to jump to line.
Limits
Max 128 instructions
Stack depth = 1
No FOR / WHILE / nested IF
No arithmetic in conditions
Stack depth = 1
No FOR / WHILE / nested IF
No arithmetic in conditions