Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual

Page 121

Advertising
background image

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 <Type>] [= <value>]

Const MyVariable [As <Type>] = <value>

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

Average Function

Calculates the average value of a tag

Band Function

Calculates stepped or banded charges, for example, first 1000, next
2000 units of a tag

CostAllocateCharge
Function

Used in Cost Allocation rate schedule to apportion a fixed or demand
charge

GetData Function

Retrieves a specific logged value from the database

GetUnit Function

Reads the units from the database for use in a report

Lowest Function

Calculates the minimum value of a tag

LowestTimestamp
Function

Determines when a minimum value occurred

NLowest Function

Calculates the 'n' lowest values of a tag

NLowestTimestamps
Function

Determines when the 'n' minimum values occurred

NPeaks Function

Calculates the 'n' highest values of a tag

NPeakTimestamps
Function

Determines when the 'n' maximum values occurred

Peak Function

Calculated the maximum value of a tag

PeakTimestamp Function

Determines the date and time a peak occurred for a tag

ProRateMonthlyCharge
Function

Used to prorate demand and fixed monthly charges when report
period is less than a month

Ratchet Function

Used for calculating demand penalties for peaks which occur within a
defined period prior to the report period

Advertising