Terminals Created by the Alarm InputTypes Scripts
The alarm sensing terminals of the Alarm Device are all user defined. These terminals are created by a set of Scripts in the Alarm/InputTypes Scripts directory.
The following group of Alarm/InputTypes Scripts take a common set of Script parameters:
alarm_id : the ID of the Alarm Device that the input is for. This is the string used as the "id" parameter when creating an Alarm Device.
input_name : the terminal name for this alarm input
value : the value that the input will check for. How the "value" parameter is checked depends on which Script is defining the input.
The Scripts in this group are:
Equal : generates an input terminal that looks for equality. If the "value" parameter is equal to the value on this terminal, it is an alarm condition.
NotEqual : generates an input terminal that looks for inequality. If the "value" parameter is not equal to the value on this terminal, it is an alarm condition.
GreaterThan : generates an input terminal that looks for greater than. If the value on this terminal is greater than the "value" parameter, it is an alarm condition.
GreaterThanEqual : generates an input terminal that looks for greater than or equal. If the value on this terminal is greater than or equal to the "value" parameter, it is an alarm condition.
LessThan : generates an input terminal that looks for less than. If the value on this terminal is less than the "value" parameter, it is an alarm condition.
LessThanEqual : generates an input terminal that looks for less than or equal. If the value on this terminal is less than or equal to the "value" parameter, it is an alarm condition.
The following Scripts in the Alarm/InputTypes Scripts directory take different Script parameters than this first group.
The Range Script has "alarm_id" and "input_name" parameters, but it takes two value parameters instead of one. It needs two value parameters, because it is defining a trigger condition over a range, and the range is defined by two values. The Range Script definition is as follows:
- Range : creates a pin which looks for a value within a range. If the value on a Range terminal is within its range, it is an alarm condition.
Its input parameters are:
alarm_id : the ID of the Alarm Device that the input is for. This is the string used as the "id" parameter when creating an Alarm Device.
input_name : the terminal name for a range input terminal
from_value : the starting value (non-inclusive) of a range.
to_value : the ending value (non-inclusive) of a range.
Note: the "from_value" and "to_value" values are non-inclusive. This means only the values between these values will trigger an alarm condition, but not the values themselves. To include these values in the range, see this example.
The Status Script only requires the "alarm_id" and "input_name" parameters. Here is the Status Script definition:
- Status : generates an input pin which shows up as a status input on the Alarm Device. It never generates an alarm, so it needs no "value" parameters.
Its input parameters are:
Multiply Defining an Alarm Input Terminal
More than one InputTypes Script can be run on the same terminal. When more than one InputTypes Script is run on a terminal, the terminal will look for any of the conditions defined by its Scripts (they will be logically OR'ed together). Using this technique, more complex alarm conditions, such as "between the range of 0 to 4 OR equal to 17", can be created.
Creating an Alarm Input Terminal with Multiple Definitions
The following Scripts create an input which triggers an Alarm Device with ID "my_alarm", when its "gte20_lte30" input is between 20 and 30, inclusive of 20 and 30.
Run the Range Script with the following parameters:
alarm_id: "my_alarm"
input_name: "gte20_lte30"
from_value: 20
to_value: 30
Run the Equal Script twice with 2 sets of parameters to make the range inclusive:
alarm_id: "my_alarm"
input_name: "gte20_lte30"
value: 20
alarm_id: "my_alarm"
input_name: "gte20_lte30"
value: 30
In this example, terminal "gte20_lte30" will generate an alarm when it sees a value between 20 and 30 (non-inclusive), or a value of 20, or a value of 30.
|