Create a Calculation Formula Using a VBScript Code

About this task

This topic describes how to create a calculation formula by entering a VBScript code. You can also create a calculation formula using the Insert Function wizard.
Important: If a tag contains bad data quality, you cannot store its value through a calculation formula. For example, if your VBScript includes: Result = 7 Quality = 0, Historian does not store the 7, it stores 0.

Before you begin

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.

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. Enter the VB script in the editor.
    5. To test the function, select .
      A message appears, stating whether the syntax is correct.
    6. In the upper-left corner of the page, select Save.
      The calculation formula is created.
  2. 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 Triggers section, select Add.
      The Insert Function Wizard window appears.
    4. Under Select Function, in the Type field, select Add A Calculation Trigger.
    5. Under Tag Browse Criteria, enter the search criteria to find the tag.
      The search results appear in the Browse Results section.
    6. Select the tag that you want to add, and then select Insert.
    7. In the Calculation field, enter the calculation formula using the VBScript syntax.
    8. To verify that the syntax is correct, select Test.
      A message appears, stating whether the syntax is correct.