Skip to main content

system.mes.oee.getAggregatedModeRecordsWithStatesBreakdown

Description

Retrieves aggregated OEE mode records, including a detailed breakdown of states for each mode. This function is useful for creating timeline-style charts that visualize both the operational mode and the specific states within that mode over a given period.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getAggregatedModeRecordsWithStatesBreakdown(locationIdOrPath, startDate, endDate)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe ID or path of the location to retrieve data for.
startDateDateFalseThe start date/time of the period to analyze.
endDateDateFalseThe end date/time of the period to analyze.

Returns

A list of JSON representations of OeeChartSegmentDTO objects, each representing a segment of time with mode and state information.

NameTypeNullableDescriptionDefault Value
nameStringTrueThe name of the chart segment (e.g., "Unscheduled Downtime" or "Running")null
codeIntegerTrueThe integer code associated with the Mode or Statenull
colorStringTrueThe color code for displaying this segmentnull
durationDoubleTrueThe total aggregated duration of this segment in secondsnull
durationPercentDoubleTrueThe percentage (0.0 to 1.0) of the total duration that this segment occupiesnull
typeStringTrueThe type of the original record, either "Mode" or "State"null
countLongTrueThe number of occurrences of this segmentnull

Code Examples

from java.util import Date

# Define the location and time range for the analysis
location = "Site/Area/Line 1"
# Example: last 8 hours
endDate = Date()
startDate = Date(end_date.getTime() - 8 * 3600 * 1000)

# Retrieve the aggregated data
aggregatedData = system.mes.oee.getAggregatedModeRecordsWithStatesBreakdown(
location,
startDate,
endDate
)

# Print the results
for segment in aggregatedData:
typeName = segment['type']
name = segment['name']
durationSeconds = segment['duration'] / 1000

print "Type: %s, Name: %s, Duration: %.2f seconds" % (typeName, name, durationSeconds)