Skip to main content

system.mes.oee.getModeRecordsGroupedByMode

Description

Retrieves OEE mode records for a location and time period, grouped by mode type.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

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

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location path or ID to analyze.
startDateDateFalseThe start time for the analysis period.
endDateDateFalseThe end time for the analysis period.

Returns

A list of JSON representations of OeeModeRecordsGroupedByModeDTO objects, each representing the aggregated data for a specific mode.

Each object has the following properties:

NameTypeNullableDescriptionDefault Value
locationIdStringTrueIdentifier of the associated location where this mode was recordednull
codeIntegerTrueThe integer code associated with the modenull
nameStringTrueThe name of the mode, such as "Production", "Scheduled Downtime", etc.null
colorStringTrueThe color code for displaying this modenull
durationDoubleTrueThe total aggregated duration of this mode in secondsnull
countLongTrueThe number of occurrences of this modenull

Code Examples

from java.util import Date
from java.util.concurrent import TimeUnit

# Get mode records grouped by mode for the last day
location = "Enterprise/Site/Area/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.DAYS.toMillis(1))

groupedRecords = system.mes.oee.getModeRecordsGroupedByMode(location, startTime, endTime)

for group in groupedRecords:
print "Mode:", group['name'], "Total Duration (sec):", group['duration'], "Count:", group['count']