Operator Precedence - Universal Devices ISY-994i User Manual

Home automation
Hide thumbs Also See for ISY-994i:
Table of Contents

Advertisement

9.5.2 Operator Precedence

A program's If clause may contain more than one condition. Every condition (including
schedule conditions) begins with an operator, which is one of And or Or. The precedence of
these operators is:
• And
• Or
Therefore, an expression such as If A or B or C and D would be evaluated as If A or B or (C
and D).
The order of evaluation may be modified by use of And ( .. ) and Or ( .. ) parenthesis. Any
number of conditions may be placed between the parenthesis and will be evaluated in
precedence order. The entire parenthesized group then becomes a single And or Or
condition, to be evaluated in precedence order with other same-level conditions (including
other parenthesized groups). To change the above example to If (A or B or C) and D, use an
And ( .. ) parenthesis around A, B, and C, with D outside the parenthesis.
In the following example code of the above example:
If
Status 'Light 1' is On
Or Status 'Light 2' is On
Or Status 'Light 3' is On
And Control 'Switch 1' is switched On
Then
Set 'Light 4' On
Else
- No Actions - (To add one, press 'Action')
Light 4 will be turned on whenever Light 1 is on, or Light 2 is on, or Switch 1 is switched on
while Light 3 is on, which is likely not the intended result. To have Light 4 turn on
whenever Switch 1 is switched on and either Light 1 or Light 2 or Light 3 is on, add an And
( .. ) parenthesis:
Page | 178

Advertisement

Table of Contents
loading

Related Products for Universal Devices ISY-994i

Table of Contents