- 06 Feb 2024
- Print
- PDF
Build a Simple Formula
- Updated on 06 Feb 2024
- Print
- PDF
Purpose: Build a simple formula using the OV variable.
Task: Build a formula to convert degrees F to degrees C. Save the formula so it can be reused or modified later.
Steps:
Find a temperature tag in Tag Browser and drag it onto a new Trend.
Right-click on the tag in Tag Browser and choose Script Editor.
Change the Script Type to Formula.
Type a formula name in the Formula field. Type a Description if desired. Do not include spaces or special characters in the formula name.
Change the Data Type to Numeric.
In the script edit area, enter the code for the script utilizing the OV output variable. Type: “OV = (IV-32) *5/9”.
Click Run to see test results.
Click the Save Formula button on the Home tab.
Drag the scripted tag onto the Trend. Adjust the Plot Max from the default of “100” to see values. Notice the tag name now has a tag switch appended to it: “ /CALC=YOURNAME_DegFtoDegC”.