Skip to main content

system.mes.oee.getModeRecordsFiltered

Get all OEE Mode records that match the provided filters such as location, date range, calculation types, codes, statuses, and duration/overrun duration ranges.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getModeRecordsFiltered(locationPath, startDate, endDate, calculationTypes=None, codes=None, stauses=None, minDurationSec=None, maxDurationSec=None, minOverrunDurationSec=None, maxOverrunDurationSec=None)

Parameters

ParameterTypeNullableDescription
locationPathStringFalseThe MES location path to search.
startDateDateFalseThe start date of the time range.
endDateDateFalseThe end date of the time range.
calculationTypesString[]TrueSet of different OEE Mode Calculation Types to filter by.
codesInteger[]TrueSet of different OEE Mode codes to filter by.
statusesString[]TrueSet of different statuses to filter by.
minDurationSecDoubleTrueMinimum duration in seconds to filter by.
maxDurationSecDoubleTrueMaximum duration in seconds to filter by.
minOverrunDurationSecDoubleTrueMinimum overrun duration in seconds to filter by.
maxOverrunDurationSecDoubleTrueMaximum overrun duration in seconds to filter by.

Returns

A list of JSON representations of OeeModeRecordDTO objects.

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 production 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

# Get all "Scheduled Downtime" mode records with "Idle" status longer than 1 minute from the last day
location = "Enterprise/Site/Area/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.DAYS.toMillis(1))

filteredRecords = system.mes.oee.getModeRecordsFiltered(
locationPath=location,
startDate=startTime,
endDate=endTime,
calculatedTypes=["Scheduled Downtime"], # Filter for scheduled downtime-related modes
statuses=["IDLE"], # Filer for IDLE status
minDurationSec=60 # Filter for modes lasting longer than a minute
)

for record in filtered_records:
print "Mode:", record['name'], "Duration (sec):", record['duration'] / 60.0