OMRON
CHAPTER 4 – CX-Supervisor Script Language
Revision 2.0
Page 29
Remarks:
Argument Type
Description
@AliasName
string
The string name of the alias
Alias definition
string
This is a string representing the actual text or expression of the
expanded alias.
‘ comment
string
This is an optional 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 = 60 ' sets duration
Aliases may also be used to create a complicated expression such as
@HYPOTENUSE
sqrt(Opposite * Op Adjacent * Adjacent)
'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.
Содержание CX-SUPERVISOR - SCRIPT REFERENCE REV2.0
Страница 2: ...CX Supervisor Script Language Software Revision 2 0...
Страница 3: ......
Страница 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...
Страница 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...
Страница 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...
Страница 13: ......
Страница 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...
Страница 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...
Страница 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...
Страница 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...