Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual
Page 121

5
•
Visualize Energy Usage
121
You can also declare local or global variables (or constants) by using the Dim (or Const)
statement. Use the following syntax:
Dim MyVariable [As
Const MyVariable [As
You may use local variables to structure and simplify scripts that represent complex
charges. Local variables do not appear in the report output but can be used to calculate
Quantity, Unit, Charge, or Visible. Declare local variables in each line item script. Declare
global variables in the Global Variables tab.
Scripting Functions
The following pre-defined functions are for use in rate schedule scripting. Except as noted,
each function operates on logged values between the report start and end dates which
occur within the defined season, day and time-of-use periods.
There are special naming conventions for parameters and variables used in line item
scripts.
Scripting Function
Description
Calculates the average value of a tag
Calculates stepped or banded charges, for example, first 1000, next
2000 units of a tag
Used in Cost Allocation rate schedule to apportion a fixed or demand
charge
Retrieves a specific logged value from the database
Reads the units from the database for use in a report
Calculates the minimum value of a tag
Determines when a minimum value occurred
Calculates the 'n' lowest values of a tag
Determines when the 'n' minimum values occurred
Calculates the 'n' highest values of a tag
Determines when the 'n' maximum values occurred
Calculated the maximum value of a tag
Determines the date and time a peak occurred for a tag
Used to prorate demand and fixed monthly charges when report
period is less than a month
Used for calculating demand penalties for peaks which occur within a
defined period prior to the report period