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 Historian Administrator or the Web Admin console. Or, you can copy a tag using Historian Administrator or the Web Admin console.

Procedure

  1. Access Historian Administrator.
  2. Select Tags, select the tag for which you want to create a calculation formula, and then select Calculation.
  3. If you want to perform an unsolicited (also called event-based) calculation, add the trigger tags to the calculation:
    1. In the Calculation Triggers section, select Add.
      The Insert Function Wizard window appears.
    2. Under Select Function, in the Type field, select Add A Calculation Trigger.
    3. Under Tag Browse Criteria, enter the search criteria to find the tag.
      The search results appear in the Browse Results section.
    4. Select the tag that you want to add, and then select Insert.
  4. In the Calculation field, enter the calculation formula using the VBScript syntax.
    Tip: