Creating Alarm Type Custom Functions
Alarm expressions can be complex. You can create alarm type functions to store complex expressions for reuse within the expression editor. Hyper Alarm Server supports two custom function types that differ in how the function is implemented—you can define by expression text or invoke custom .NET Framework code. This procedure also includes adding a folder and subfolder for those defined functions and is recommended when creating multiple-type functions.
Creating an alarm type function:
- From Workbench Project Explorer, select the Alarms and Notifications > Hyper Alarm Server > Type Functions.
- Right-click on Type Functions and select Add Type Folder to create a parent folder.
Give the parent folder a unique name that helps identify any configured function within subfolders.
- Type the parent folder name in the Name text box.
- (Recommended) Describe the alarm type function in the Description text box.
- Click Apply.
- Right-click the parent folder and select Add Type Function to create a subfolder to store the alarm logic.
- Type a unique name for the subfolder function. The assigned name becomes the expression identifier.
- Complete the General tab information.
View functions
- Click the Parameters tab to configure parameters functions.
View steps
- Click the Expression tab to define the expression for the designated function type. Expressions differ depending on the function type. For example, you can use expression functions and .Net framework functions.
- When finished, click Apply or Apply & Close.
Once the Type Function is configured, the unique function name appears in the expression editor and becomes available to use for each alarm type.
View image
The configuration of a expression-based custom functions is similar to the standard alarm type expressions. Unlike expressions used when adding an new alarm type, the custom function uses the configured input parameters. A list of available parameters appears on the left-hand expression pane. Double-click the parameter to insert into expression text area. View image
To prevent circular function references, the evaluation engine limits the maximum number of nested functions calls to 20.