The calculated channels feature is ment to calculate meaningful engineering values derived from raw sensor input values, however they could also be used for advanced alarming using multiple input conditions. Its common practice to raise an alarm (SMS or trigger a digital output) on exceeding of configured limits for a single input value (e.g. alarm to warn for reservoir overflow). By using calculated channels it is possible to alarm on a combination of input values.
Situation explained through an example
Assume an open water reservoir for irrigation purpose and you want to be warned when the water in the pond falls below a certain level or when the water level reaches the edge of the reservoir. But why ring any bells if the pond level is just falling below the warning level (due to vaporisation) while there is no demand for water or why alarm when water is just over a high limit (due to precipitation) while there is no forced supply.
To avoid unnecessary level alarms you could define a calculated channel with the following equation:
ALARMLEVEL = gt(:FLOWIN; 0; :LEVEL; gt(:FLOWOUT; 0; :LEVEL; LEVELOK))
- gt(a; b; c; d) is a function that returns the value c when a>b otherwise it returns d.
- :FLOWIN is the monitored supply flow or a digital switch indicating an open valve/floodgate
- :FLOWOUT is the monitored demand flow or a digital switch indicating an open valve/floodgate
- :LEVEL is the monitored level in the pond
- LEVELOK should be substituted by a level value that does not ring any bells, a pond level somewhere between low and high limit.
- ALARMLEVEL is the defined calculated channel, which will be set to the same value as :LEVEL when there is a supply (:FLOWIN > 0) or demand (:FLOWOUT > 0) flow, else it will return a level that does not ring any bells (LEVELOK value).
Instead of setting low/high limits to :LEVEL you should set the warning limits to the ALARMLEVEL channel.
For safety reasons you could still set low-low/high-high limits to :LEVEL.