CHAPTER 4 – CX-Supervisor Script Language
OMRON
Page 26
Revision 2.0
result = 45 + 754 ‘add two numbers
Indirection within Script Commands and Expressions
It is possible to use text points directly or indirectly in place of literal string arguments within scripts
and expressions. For instance, each of the following commands has the same effect:
♦
Using a string literal;
PlayOLE(“ole_1”, 0)
♦
Using a textpoint directly;
textpoint = “ole_1”
PlayOLE(textpoint, 0)
♦
Using a textpoint indirectly via the ‘^’ notation.
text = “ole_1”
textpoint = “text”
PlayOLE(^textpoint, 0)
It is possible to use text points indirectly in place of point name arguments within script commands.
For instance, each of the following commands has the same effect:
♦
Using a point name directly;
verbnumber = 0
PlayOLE(“ole_1”, verbnumber)
♦
Using a textpoint indirectly via the ‘^’ notation.
verbnumber = 0
textpoint = “verbnumber”
PlayOLE(“ole_1”, ^textpoint)
An example using Indirection
The value of point indirection can be seen in a situation where it is necessary to dynamically change
the pointname that an object is linked to. In the following example a toggle button is configured to
control the Boolean state of one of four points:
♦
The four Boolean points to be controlled are called ‘motor1’, ‘motor2’, ‘motor3’ and ‘motor4’.
♦
The text point ‘textpoint’ is used to store the name of the Boolean point to be controlled.
♦
The text point ‘text’ is used to store the string value of the integer point ‘index’
♦
The integer point ‘index’ (which has a range 1-4) is used to dynamically change the point being
controlled.
♦
Access to any of the four Boolean points ‘motor1’, ‘motor2’, ‘motor3’, ‘motor4’ can be achieved
by applying indirection to ‘textpoint’ using the ‘^’ notation and changing the contents of
‘textpoint’.
Содержание 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...