Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual page 42

Script language
Table of Contents

Advertisement

OMRON
Remarks:
Argument
@AliasName
Alias definition
' comment
The @ symbol at the beginning of each line initiates each alias command. For example, the text
string @SomePoint could be used to represent any sequence of characters in a script or expression –
e.g. it could be defined as:
@SomePoint = InArray[1]
or even
@SomePoint = Inarray[1] + Inarray[2] / 2
This is an easy way of identifying the individual members of array points. It can also be used to
associate names with numbers, for example,
@SecondsPerDay = 86400
Alias definitions are stored in a simple text file in the project directory, called <project name>.pre.
The format of the file consists of any number of lines such as:
@Test1 = InArray[12] * 10
i.e. an @ symbol followed by the name of the alias, then an equals sign (or space), followed by the
definition of the alias. Anything that follows the last apostrophe ( ' ) symbol on a line is interpreted
as a comment. Any line which does not start with the @ symbol is also assumed to be a comment.
Typical Examples
Declare boiler temperatures
@BoilerTemp1 = InArray[0] ' for boiler room 1
@BoilerTemp2 = InArray[1] ' for boiler room 2
@SecondsPerMinute
Aliases may also be used to create a complicated expression such as
@HYPOTENUSE
'Calculates length of Hypotenuse
This can be used in a script in the following way:
Opposite = 8.45
Adjacent = 9.756
length = @HYPOTENUSE
where Opposite, Adjacent and length are all REAL points.
Revision 2.0
CHAPTER 4 – CX-Supervisor Script Language
Type
string
The string name of the alias
string
This is a string representing the actual text or expression of the
expanded alias.
string
This is an optional comment.
= 60
' sets duration
sqrt(Opposite * Opposite + Adjacent * Adjacent)
Description
Page 29

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents