User Guide

Table Of Contents
Program Methodology—Logical Operators
Siemens Building Technologies, Inc. 1-17
Logical Operators
Both relational operators and logical operators compare two values
and produce a result that is called a condition. With logical operators,
there is a related action for each possible outcome of the condition. If
the condition is true, then a specific action is taken. If the condition is
false, then an alternate action is performed. For information on the
order in which logical operators are evaluated, see the Order of
Precedence section in this chapter.
The following example describes the function of the logical operator.
Example
You are reading the newspaper one morning and find that it is
going to be a beautiful day. You say to yourself, "If it gets
warmer than 80°F and I do not have to work, then I will go to the
beach."
You have just used a logical operator to define two conditions. Your
first condition is that the temperature must be greater than 80°F.
Your second condition tests if you have to work. Both conditions
must be true in order for you to go to the beach. If one condition is
not true, then you will not go to the beach.
PPCL supports the following logical operators:
And (.AND.)
Not And (.NAND.)
Or (.OR.)
Exclusive Or (.XOR.)
Each logical operator is described in more detail on the following
pages.
APOGEE PPCL User’s Manual
1-18 Siemens Building Technologies, Inc.
And (.AND.)
Unitary pre-APOGEE APOGEE BACnet
Syntax
if (cond1.AND.cond2) then...
cond1,
cond2
Defines a condition that is the result of a comparison
between two values.
Use
Used to compare two logical conditions.
If both conditions are true, the result of the comparison is true.
A single statement can incorporate a combined total of 16
relational and logical operators.
See Table 1-1 for a comparison of conditions used with the .AND.
logical operator:
Table1-1. Truth Table for .AND. Logical Operator.
Condition 1 False Condition 1 True
Condition 2 False
Result is False Result is False
Condition 2 True
Result is False Result is True
Example
200 IF (TIME.LT.19:00.AND.TIME.GT.5:00) THEN ON(LIGHTS)