![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-script-reference-rev2-0/cx-supervisor-script-reference-rev2-0_reference-manual_744212018.webp)
OMRON
CHAPTER 2 - Expressions
Revision 2.0
Page 5
Refer to the
CX-Supervisor User Manual
for detailed dialog descriptions.
Note:
Boolean Expressions execute when the expression is TRUE so it can be said that every
Boolean expression has an inferred “== TRUE”. Sometimes Boolean expressions can be
difficult to read e.g. “bMyFlagPoint” or “BitMask & 0x80. It can help maintenance if this
“== TRUE” is explicitly specified e.g. “bMyFlagPoint == TRUE” or “BitMask & 0x80 ==
TRUE”.
Note:
When using Boolean operators (e.g. ==, !=, &&, ||, |) never mix tests for Boolean and non
Boolean operands. For example never use “bMyFlagPoint == 1” or “bMyFlagPoint == 0”.
Instead always test using the correct Boolean constant i.e. “TRUE” or “FALSE” for CX-
Supervisor scripts, or “True” and “False” when using VBScript.
Note:
On Condition scripts are only executed when the expression is TRUE. Sometimes this leads
to peculiar results, for example using $Second as it will be executed when $Second changes
to 59, and to 1 but
not
when it changes to 0. To execute a condition script any time a point
changes, force the expression to always evaluate to TRUE for example “$Second || TRUE”.
This works because the $Second forces the expression to be tested when the point changes,
but the || TRUE means the test will return TRUE regardless of the value of the point.
Note:
Use array points in On Condition expressions with caution. The expression “MyArray[3] ==
1” does not mean “execute every time the third element changes to 1”. It means execute
when
any
element of MyArray changes and the third element happens to be 1
Note:
Using an array point without any index is the same as specifying element 0 i.e. MyArray
actually means MyArray[0] == 1
Содержание 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...