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

Script language
Table of Contents

Advertisement

OMRON
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
Revision 2.0
CHAPTER 2 - Expressions
Page 5

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents