OEE Aggregation

For a system configuration which uses more than one OEE Equipment Monitor, OEE Aggregation is a useful functionality which can be provided by adding Aggregator objects to the system. If OEE Aggregation is configured, these objects calculate aggregated values at the end of each aggregation period.

When OEE Aggregation is initially triggered, an OEE node will be created at each level of the equipment tree in the ISA-95 Equipment Model, starting at the Equipment nodes, up to the node where the aggregator was created.

The scope of the Aggregation is defined by OEE Monitor Configuration. Each selected scope will be represented as a corresponding aggregation node.

For example, if you have 2 OEE Equipment Monitor objects, one having 'Hour' as the aggregation scope, and the other one 'Day', you should be able to see an Hour aggregation node and a Day aggregation node under your site object.

The REQUESTAGGREGATION Lua Function

The AGGREGATION Lua function of the syslib.oee.helpers library is now deprecated and replaced by the REQUESTAGGREGATION function. For new implementations, the new function should be used instead.
Updating to the REQUESTAGGREGATION function is strongly recommended for existing implementations using the deprecated AGGREGATION function.

Alternatively, the OEE Aggregation calculation can be triggered by a special Lua function which is called by a script running in the console or on a Lua executing object.

local helper = require"syslib.oee.helpers":NEW()
helper:REQUESTAGGREGATION(aggObjPath, aggScope, sourceList, from, to, maxIntervals, greedy, force, step, timeout)
Parameter Type Function

aggr

SysLib.ObjSpec

ObjSpec of a top-level aggregator. Only a top-level aggregator can accept calculation requests.

scope

number

Aggregation scope flags from the TPMOEEIntegrationScope flag group e.g. syslib.model.flags.TPMOEEIntegrationScope.OEE_HOUR for hourly aggregation or syslib.model.flags.TPMOEEIntegrationScope.OEE_DAY for daily aggregation. If not specified, all scopes will be recalculated. This parameter does not affect the Integration Scope configuration in the Aggregation Options the OEE Equipment Monitors.

list

table

A list of monitors and sub-aggregators, if only specific monitors or sub-aggregators are to be affected

from

number

Timestamp of the start time from which aggregation should be calculated. If it is nil, the range will be determined by the parameters to and max

to

number

Timestamp of the end time up until which aggregation should be calculated. If it is nil, the range will be determined by the parameters from and max

max

number

Maximum amount of aggregation cycles (as defined in scope) to recalculate the history for. If it is nil, the range will be determined by the parameters from and to.

greedy

number

Defines the behavior of boundary conditions.
Options are:
        0 - not greedy (default),
        1 - greedy into the past
        2 - greedy into the future
        3 - greedy to both directions

force

boolean

Rewrites existing calculation data, use this flag to force production aggregations to be calculated

step

number

A specific interval for mongo caching, default is 1 hour, best used when equal to the smallest aggregation interval

timeout

number

Timeout, a new timeout is applied to each individual monitor and each individual integration scope

Example

local helper = require"syslib.oee.helpers":NEW()

local from = syslib.now() - 3600000 * 24 * 4
local to = syslib.now()
local maxIntervals = nil -- Set 2 out of 3 { from, to, maxIntervals }
local aggObjPath = "/MyEnterprise/OEE Aggregation"
local aggScope = nil -- set flags for specific scopes eg syslib.model.flags.TPMOEEIntegrationScope.OEE_HOUR | syslib.model.flags.TPMOEEIntegrationScope.OEE_DAY
local sourceList = nil -- set to list of monitors and sub aggregators is need be
local greedy = 1 -- Greedy into the past
local force = true -- Rewrites existing calculation data

helper:REQUESTAGGREGATION(aggObjPath, aggScope, sourceList, from, to, maxIntervals, greedy, force)