EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Page 155

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
140
Structured Text (ST Language) Specifications Appendix B
Note: Nesting in comments is not possible, i.e., (*(*this type of nesting is not supported*)*)
Spaces, Carriage Returns, Tabs
Any number of spaces, carriage returns, and tabs, or combinations of these can be used anywhere within
statements. Therefore, use spaces, carriage returns, and tabs between reserved words and equations to
make them easier to read.
Spaces, carriage returns, and tabs cannot be used between the following tokens (the smallest meaningful
unit for compiling), in which case they are referred to as token separators.
Tokens: Reserved words, variable names, special characters, constants (numerical values)
Reserved words (upper or lower case):AND, CASE, DO, ELSE, FOR, IT, NOT, OF, OR, REPEAT,
THEN, TO, UNTIL, WHILE, XOR, TRUE, FALSE, ELSIF, BY,
EXIT, RETURN
Variable names: Any text that is not a reserved word will be recognized as a variable
name.
Special characters: <=, >=, <>, :=, .., &, (*, *)
Constants (numerical values): Numerical value only for decimal numbers
16# followed by numerical value for hexadecimal numbers
2# followed by numerical value for binary numbers
8# followed by numerical value for octal numbers
If a space, carriage return, or tab is used between any of the above tokens, the parts of the token on either
side will be treated as separate tokens. Therefore, make sure that spaces, carriage returns, or tabs are not
used within a single token.
Always use a space, carriage return, tab, or other token separator between reserved words and variable
names. Using token separators between other token combinations is optional.
In the following example, the box (@) indicates where a space, carriage return, tab, or other token separa-
tor is required.
IF@A>0THEN@X=10;
ELSE@
X:=0;
END_IF;
Upper and Lower Case
Reserved words and variable names do not distinguish between upper and lower case (either can be
used).
Prohibited Characters for Variable Names
The following characters enclosed in square brackets cannot be used in variable names.
[!], [“], [#], [$], [%], [&], [‘], [(],, [)], [-], [=], [^], [~], [\], [|], [@], [‘], [[], [{], [;], [+], [:], [*], []], [}], [,], [<], [.], [>], [/], [?]
The numbers 0 to 9 cannot be used as the first character of variable names.
An underscore cannot be followed immediately by another underscore in variable names.
Spaces cannot be used in variable names.
An error message will occur if any of these characters are used in this way.
Inputting Constants (Numerical Values)
Numerical values can be expressed in decimal, hexadecimal, octal, or binary, as shown in the following
examples.
Notation method Example (for the decimal value 12)
Decimal: Numerical value only 12
Hexadecimal: 16# followed by numerical value 16#C
Octal: 8# followed by numerical value 8#14
Binary: 2# followed by numerical value 2#1100

Table of Contents

Related product manuals