Inputting St Programs; Syntax Rules - Omron WS02-CXPC1-V9 - V9 Operation Manual

Table of Contents

Advertisement

Inputting ST Programs

5-3

Inputting ST Programs

5-3-1

Syntax Rules

Statement Delimiters
Comments
Spaces, Carriage Returns,
Tabs
138
• 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 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
(*comment*)
Note Nesting in comments is not possible, i.e.,
• 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,
Variable names:
Special characters:
Constants (numerical values):
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.
Example
(*this is the comment*)
(*(*this type of nesting is not supported*)*)
IT, NOT, OF, OR, REPEAT,
THEN, TO, UNTIL, WHILE,
XOR, TRUE, FALSE, ELSIF,
BY, EXIT, RETURN
Any text that is not a reserved
word will be recognized as a
variable name.
<=, >=, <>, :=, .., &, (*, *)
• Numerical value only for
decimal numbers
• 16# followed by numerical
value
numbers
• 2# followed by numerical
value for binary numbers
• 8# followed by numerical
value for octal numbers
Section 5-3
for
hexadecimal

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents