Rockwell Automation 9307 FactoryTalk EnergyMetrix User Manual

Page 220

Advertising
background image

FactoryTalk EnergyMetrix Software

220

Grid Example

This example populates a Grid object that lists real energy consumption and cost per
meter. The Grid object is configured with four columns, headed ‘Meter’, ‘Actual
Consumption’, units, and ‘Actual Cost’.

Sub Main()

'declarations omitted

...

'object creation and configuration omitted

...

For Each meter In Report.Meters

actualConsumption = meter.Total(ValueType.RealEnergyNet)

actualCost = meter.CostAllocate("Electric Billing Report",
"Electric Cost Allocation")

row = grid.AddRow()

row(0) = meter.Name

row(1) = actualConsumption

row(2) = Functions.GetUnit(ValueType.RealEnergyNet)

row(3) = actualCost

Next meter

Trend Chart Example

This example populates a TrendChart object configured to chart real energy consumption
by group per week. A separate trend line is plotted for each group.

Sub Main()

'declarations omitted

...

'object creation and configuration omitted

...

For Each group In Report.Groups

trendChart.SeriesLegend = group.Name 'assigns the Group name
to the data series

For Each week In Report.Weeks

consumption = group.Total(ValueType.RealEnergyNet _

week.StartDate, week.EndDate)

trendChart.AddData(week.EndDate, consumption) 'assigns data
for the current data series

Next week

trendChart.NextSeries() 'adds a new data series to the trend
chart

Next Group

The CostAllocate method of the Meter and Group objects
requires specific rate schedule configuration.

Advertising