Structured Text (ST)
ST is a structured literal programming language. A ST program is a list of statements. Each statement describes an action and must end with a semicolon (";").
The presentation of the text has no meaning for a ST program. You can insert blank characters and line breaks where you want in the program text.
Comments
Comment texts can be entered anywhere in a ST program. Comment texts have no meaning for the execution of the program. A comment text must begin with "(*" or "/*" and end with "*)" or "*/". Comments can be entered on several lines (i.e. a comment text may include line breaks). Comment texts cannot be nested.
Expressions
Each statement describes an action and may include evaluation of complex expressions. An expression is evaluated:
- From the left to the right.
- According to the default priority order of operators.
- The default priority can be changed using parenthesis.
Arguments of an expression can be:
- Declared variables.
- Constant expressions.
- Function calls.
Statements
Below are available basic statements that can be entered in a ST program:
Below are the available conditional statements in ST language:
- IF / THEN / ELSE (simple binary switch).
- CASE (enumerated switch).
Below are the available statements for describing loops in ST language:
Helpful features
There are some features to simplify the programming:
- A click on the "(" keyboard button automatically inserts the ")" symbol, if the previous word is an instance or a function name. The caret is put between the brackets.
Hint: Function blocks and UDFBs cannot be used in ST Language without an instance name. If a word is located before a function block or a UDFB the feature is not available. - A click on the "[" keyboard button automatically inserts the "]" symbol. The caret is put between the two [].
Other topics in this chapter |
Structured Text (ST) |
IEC 61131-3 Automation platform > Programming - Reference guide > Programming languages - Overview > Structured Text (ST) |
Created with the Personal Edition of HelpNDoc: Streamline your documentation process with HelpNDoc's WinHelp HLP to CHM conversion feature