Create a Calculation Formula Using the Pre-built Functions

About this task

This topic describes how to create a calculation formula using the pre-built functions. You can also create a calculation formula using a VBScript code.

For information on a list of the available types and associated functions, refer to Types of Functions Supported. For information on each pre-defined function, refer to Built-In Functions. In addition to the built-in functions, you can create your own customized functions.

Before you begin

  1. Create the tag that you want to use to store the calculation results. You can create the tag manually using Configuration Hub, Historian Administrator or the Web Admin console. Or, you can copy a tag.
  2. Access the advanced options of the collector, and then disable the On-line Tag Configuration Changes option using Historian Administrator. In Configuration Hub this property is available in Collector Options section. If you do so, each time you update a calculation formula, the collector does not reload tags.

Procedure

  1. To create a calculation formula using Configuration Hub:
    1. Access Configuration Hub.
    2. In the NAVIGATION section, under the Configuration Hub plugin for Historian, select Tags.
      A list of tags appears.
    3. Select a calculation tag, right-click or select more options, and then select Calculation.
      The calculation editor appears.
    4. In the CALCULATION section, remove Null (and retain the Result =).
    5. In the Calculation editor, place the cursor in the location where you want to insert the pre-built function.
    6. In the DETAILS section, under Pre-Built Functions, in the Function Type field, select a function type.
      Depending on the function type you have selected, a list of functions appears in the Function field.
    7. In the Function field, select a function.
      Based on the selected function, the related fields will be displayed.
    8. Enter values in the other fields that appear after selecting a function.
    9. In the Input Tag field, select , and then select the tag where applicable.
      The function preview appears below the calculation editor.
    10. Select Insert Function.
      The function is inserted at the cursor position.
    11. To test the function, select .
      A message appears, stating whether the syntax is correct.
    12. In the upper-left corner of the page, select Save.
      The calculation formula is created.
  2. If you want to create a calculation formula using Historian Administrator:
    1. Access Historian Administrator.
    2. Select Tags, select the tag for which you want to create a calculation formula, and then select Calculation.
    3. In the Calculation section, remove Null (retain Result =).
      Tip: Avoid selecting other tags until you save your changes or you will lose your code changes.
    4. Select Wizard.
      The Insert Function Wizard window appears.
    5. Under Select Function, select values in the available fields, and then select Insert.
    6. If you want to perform an unsolicited (also called event-based) calculation, in the Type field, select Add A Calculation Trigger. Search and select the tag that you want to add, and then select Insert.
      The calculation formula is created.
    7. To verify that the syntax is correct, select Test.
      A message appears, stating whether the syntax is correct.