Omron CX-PROGRAMMER V8.1 Operation Manual page 164

Function blocks/ structured text
Table of Contents

Advertisement

Inputting ST Programs
Upper and Lower Case
Prohibited Characters for
Variable Names
Operator Priority
STRING Data Type
• 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 separator is required.
IF@A>0THEN@X=10;
ELSE@
X:=0;
END_IF;
• Reserved words and variable names do not distinguish between upper
and lower case (either can be used).
• 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.
• Consider the operator priority in the structured text syntax, or enclose
operations requiring priority in parentheses.
Example: AND takes priority over OR. Therefore, in the example X OR Y
AND Z, priority will be given to Y AND Z.
• The following text strings are supported:
Strings with up to 255 alphanumeric characters
The text strings are not case sensitive.
• Text strings defined in the ST language are stored in PLC memory as fol-
lows:
Data for the Text String "123456"
n
31 32
n+1
33 34
n+2
35 36
n+3
00 00
• Place text strings inside signal quotation marks.
Notation
'A'
Indicates the text string "A" (ASCII 41).
' '
Indicates a text string containing a single space (ASCII 20).
''
Indicates an empty text string.
• Two hexadecimal digits following a dollar sign ($) are interpreted as hexa-
decimal values.
Notation
$02
The hexadecimal number 02 (start code)
$03
The hexadecimal number 03 (end code)
The null code (00) is stored
at the end of the text string.
Description
Description
Section 5-3
139

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents