![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241164.webp)
138
Inputting ST Programs
Section 5-3
5-3
Inputting ST Programs
5-3-1
Syntax Rules
Statement Delimiters
• Statements (assignment and control statements) must always end in a
semicolon (;). The statement cannot be completed by simply using a car-
riage return.
• Do not use a semicolon (;) as a delimiter within a statement such as fol-
lowing reserved words, values, or equations. Inserting a semicolon within
a statement, except at the end of a statement, will result in a syntax error.
Comments
• Comments are enclosed in parentheses and asterisks, i.e., (*
comment*
).
Any characters except parentheses and asterisks can be used within a
comment. Nesting within comments is not supported.
Notation
Example
(*
comment*
)
(*this is the comment*)
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.
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......