Npeaks function – Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual
Page 128
![background image](/manuals/581102/128/background.png)
FactoryTalk EnergyMetrix Software
128
Example
The following script returns the time stamp of the real demand power minimum that
occurred during the Summer season, on working days, during the hours of 10:00 a.m. to
4:00 p.m.:
dim dtMins(3) [as DateTime]
dtMins = NLowestTimestamps(ValueType.RealPowerDemand,
SeasonType.Summer, DayType.WorkingDay, 10, 16, 3)
NPeaks Function
The NPeaks function returns the N largest instances of the selected value logged between
the report start and end dates, and during the periods defined by the SeasonType,
DayType, TimeOfUseType (or StartHour and EndHour) arguments. The NPeaks function
is generally used for rate-of-change values such as demand real and reactive power (kW,
kVAR). It returns a Double array of N elements.
Usage
Quantity = NPeaks(ValueType.enumValue, N)
Quantity = NPeaks(ValueType.enumValue, SeasonType.enumValue, N)
Quantity = NPeaks(ValueType.enumValue, SeasonType.enumValue,
DayType.enumValue, N)
Quantity = NPeaks(ValueType.enumValue, DayType.enumValue, N)
Quantity = NPeaks(ValueType.enumValue, startHour, endHour, N)
Quantity = NPeaks(ValueType.enumValue, TimeOfUseType.enumValue,
N)
Quantity = NPeaks(ValueType.enumValue, SeasonType.enumValue,
DayType.enumValue, startHour, endHour, N)
Quantity = NPeaks(ValueType.enumValue, SeasonType.enumValue,
DayType.enumValue, TimeOfUseType.enumValue, N)
Quantity = NPeaks(ValueType.enumValue, DayType.enumValue,
TimeOfUseType.enumValue, N)
Comments
N is an integer representing the number of peak values to be returned.
The startHour and endHour arguments are integers in the range of 1…24, where
24 = midnight.
Example
The following script calculates the 3 highest real demand power values that occurred
during the Summer season, on working days, during the hours of 10:00 am to 4:00 pm:
Dim dblDemandPeaks(3) [as Double]
dblDemandPeaks = NPeaks(ValueType.RealPowerDemand,
SeasonType.Summer, DayType.WorkingDay, 10, 16, 3)