Instructions in ST

The programming language Structured Text (ST) is defined by the IEC 61131 standard. It includes the instructions:

:=   ;  --> Assignment
:= TRUE; --> Assignment to 1
:= FALSE; --> Assignment to 0

PROGRAM ...  END_PROGRAM
IF ...  THEN ...  ELSE ...  END_IF
FOR ...  END_FOR
WHILE ...  END_WHILE
REPEAT ... UNTIL ... END_REPEAT

Basic logic functions are:

AND        OR        XOR: eXclusive OR

and their complement are:

AND NOT       OR NOT       XOR NOT : eXclusive AND

Logic functions can be followed with parentheses:

AND(       OR(       XOR(
)          )         )

Comments can be added inside the symbols: (*…. *).

The programming language includes two types of variable; by default booleans, but also integers which are declared by:

VAR
X : INT;
END_VAR