UM-0085-B09
DT80 Range User Manual
Page 84
RG
Some sample alarm conditions are shown below:
Condition
Alarm is true if
(2R(II)>51.5)
channel 2R value is greater than or equal to 51.5 ohms
(3+V(AV)<-200)
channel 3+V (averaged over schedule interval) is less than -200mV
((CALC=(&1TK+&2TK)/2)<50)
average of two thermocouple readings is < 50°C
(4ST==1)
today is Monday
(REFT<>-10,45)
temperature inside
DT80
is outside the range -10°C - +45°C
(T><9:00,17:30)
time is between 9am and 5:30pm
(32SV>10000)
10000 or more data records have been logged for schedule A
(1CV<2CV/2M)
1CV is less than 2CV, and has been for at least 2 minutes
(4DS==0)
digital input 4DS is low
(1CV(ND)>1)
1CV is greater than or equal to 1. Don't display this alarm.
Note:
by default the value of the channel that is tested in an alarm condition is neither logged nor returned. It will, however, be
displayed, unless you disable this using the
ND
or
W
options.
If you want to log or output the channel's value each time it is tested then include the
LM
(log measurement) option, e.g.
ALARM(1TK(LM)>35)"Hot"
Complex Conditions
As indicated above, only relatively simple condition tests can be included in an alarm command. There are two ways to
perform a more complex test.
Boolean Expressions
An arbitrarily complicated
boolean expression
can be constructed and assigned to a CV, which can in turn then be
tested in an alarm command. For example:
RA5S
1V 2V 3V 3CV
9CV=((&1V>2.2)AND(&1V/&2V<=0.9)AND(&3V>=(&1V+&2V)))OR(3CV=0.0)
ALARM(9CV>0.5)"Condition red"
Note:
the syntax for boolean expressions is quite different to that used in alarm conditions.
In the above example 9CV will get the value 1.0 if the expression evaluates to true, otherwise 0.0
You can also use the result of a boolean expression in an
arithmetic expression
, making use of the fact that the value
of the boolean expression is always 1.0 or 0.0. For example,
12CV=4CV*(1CV>2.5)+5CV*(1CV<2.5)
will set 12CV to the value of 4CV if 1CV is greater than 2.5, otherwise it will set it to the value of 5CV. In many cases,
however, using the selection operator would be simpler:
12CV=(1CV>2.5)?4CV:5CV
See
for more information about using expressions.
Combining Alarms
An alternative method of building up a complex alarm condition is to chain a number of consecutive alarm commands
together. They are combined using logical operators (
AND
,
OR
or
XOR
), which replace the
digitalAction
,
actionText
and
actionProcesses
of all except the last alarm. The actions associated with the combined test are attached to the last
alarm. Any alarm delay period is also associated with the last alarm.
For example, the combined alarm
ALARM(1*TK>100)OR
ALARM(1+TK>100)OR
ALARM(1-TK>100)AND
ALARM3(T>10:00:00)"Temp Error"{1DBO=12}
produces a single alarm output based on several temperature tests and a time test. The combined alarm becomes true
when any one of
1*TK
,
1+TK
or
1-TK
exceeds 100°C after 10:00:00 am. Notice that the alarm conditions are
evaluated sequentially ("left to right"); the three logical operators (
AND
,
OR
or
XOR
) all have equal precedence.
Note also that the type of alarm (single shot vs repeating) and the alarm number are solely determined by the last
channel in a chain of concatenated alarm channels e.g.
ALARM27(1CV>1)AND
ALARM5(2CV>4)"boo"
is exactly equivalent to
IF99(1CV>1)AND
ALARM5(2CV>4)"boo"
ie it's a single shot alarm with ID 5.