Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual

Page 120

Advertising
background image

FactoryTalk EnergyMetrix Software

120

Line Item Scripting

The billing report executes rate schedule line item scripts at report runtime. The scripts
define the quantities, units and charges shown in the billing report.

Functions

You create line item scripts by using Microsoft Visual Basic .NET. Pre-defined functions
assist you in calculating billing report charges, for example, total consumption, peak,
average, and ratcheted demand. Each function includes arguments that pass logged values
from the database, seasons, day types, time-of-use information and other variables to the
function.

Your script may also call functions in the .NET System.Math namespace. Refer to the
.NET Framework documentation from Microsoft for details on these functions.

Variables

Several pre-defined input and output variables may be used in the line item script.

Input variables have pre-set values which should not be modified in the script:

TotalCharges: Passes the sum of the charges in lower-numbered line items to the
script. Provided for sales tax calculations. Returns a Double value

RatePerUnit: This variable passes to the script the Rate per Unit value that you enter
when you create or edit the line item. Returns a Double value

BillingPeriodDayCount: Passes the number of days in the current billing period to the
script. Returns an Integer value

Output variables control the line item properties on the billing report:

Quantity: determines the value shown in the quantity column.

Unit: displays units in the line item, for example, kWh

Charge: the monetary value shown in the line item.

Visible: local Boolean variable that controls visibility of a line item. Default = True
(show)

SuppressGrandTotal: global Boolean variable that controls the visibility of the Total
Charge field. Default = False

SuppressGroupTotals: Global Boolean variable that controls the visibility of group
subtotals. Default = False

Save your script frequently. When you save a script, a validation
is performed and if errors exist the script will not be saved. To
save a script you must correct any script errors or temporarily
convert the offending script element to a remark. You can utilize
another application such as Notepad or a VBA editing window to
create and edit the script and then copy and paste the script
into the script field. Your user login will not time out while a
rate schedule page is in Edit mode.

Advertising