Section 2 Expressions - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

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

SECTION 2 Expressions

15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents