Skip to main content

system.mes.oee.getAllOeeModeRecords

Retrieves all OEE mode records for a location within a specified time range.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

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

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID (ULID) or path to retrieve OEE records for.
startDateDateFalseThe start date/time for the query range.
endDateDateTrueThe end date/time for the query range. If null, uses current time.

Returns

A list of JSON representations of OeeModeRecordDTO objects, each representing a recorded instance of an OEE mode.

Each object has the following properties:

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Mode Recordnull
locationIdStringFalseIdentifier of the associated location where this mode was recordednull
locationNameStringTrueName of the associated locationnull
locationPathStringTruePath of the associated location where this mode was recordednull
codeIntegerFalseInteger mode numbernull
statusStatusFalseStatus of the OEE record (running, faulted, cancelled, complete etc.)UNKNOWN
startDateInstantFalseStart date and time of the mode recordInstant.now()
endDateInstantTrueEnd date and time of the mode recordnull
durationDoubleFalseTotal duration of the mode record in seconds0.0
overrunDurationSecDoubleFalseDuration in seconds that the machine has overrun its scheduled downtime0.0
nameStringFalseName of the modenull
calculationTypeOeeModeCalculationTypeFalseSpecifies how this mode should be factored into OEE calculationsSCHEDULED_PRODUCTION
colorStringFalseHex color code representing the mode visually"#000000"
expectedDurationDoubleTrueExpected duration of the mode in seconds0.0
notesStringTrueNotes associated with the OEE Mode Recordnull
enabledbooleanTrueIndicates whether the OEE Mode Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

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

# Define time range (last 24 hours)
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.HOURS.toMillis(24))

# Get all mode records for a production line
location = "Enterprise/Site/Area/Line1"
modeRecords = system.mes.oee.getAllOeeModeRecords(location, startTime, endTime)

for record in modeRecords:
print record['name'], record['duration']