beautypg.com

Seasondaycount function – Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual

Page 133

background image

5

Visualize Energy Usage

133

Comments

Use the Ratchet function to calculate a demand penalty, in which a charge is based on the
peak demand in the previous six months, year or other period. For calculating peaks which
occur within the report period, use the

Peak Function

.

The endDate argument is optional. The function defaults to the report end date. If used,
endDate is a string in the format mm/dd/yyyy [hh:mm [am/pm]]. The best way to express
the date is to use the .NET DateTime object:

new DateTime(year, month, day, hour, minute, second)

The intervalInMonths argument is an integer which defines the ratchet demand period. it is
usually 6 or 12 depending on the utility tariff.

The startHour and endHour arguments are integers in the range of 1…24, where
24 = midnight.

Example

The following script calculates the peak real demand power that occurred during the year
ending at the report end date, during the Summer season, on working days, during the
user-defined 'On Peak' time-of-use period:

Quantity = Ratchet(ValueType.RealPowerDemand, SeasonType.Summer,
DayType.WorkingDay, TimeOfUseType.OnPeak, 12)

SeasonDayCount Function

The SeasonDayCount function returns the number of days within the current billing period
that are also in the specified Season. It returns an Integer value.

Usage

MyVariable = SeasonDayCount(SeasonType.enumValue)

Comments

This function is usually used in combination with the BillingPeriodDayCount input
variable. See the list of allowable

Enumeration Values for Functions

for enumerated

arguments.

Example

In this example, a contracted demand charge is apportioned between summer and non-
summer seasons which occur within the same billing period.

Dim SummerRate, NonSummerRate, ContractedDemand

Charge = (SeasonDayCount(SeasonType.NonSummer) /
BillingPeriodDayCount) * ContractedDemand * NonSummerRate +
(SeasonDayCount(SeasonType.Summer) / BillingPeriodDayCount) *
ContractedDemand * SummerRate