Skip to main content
Version: V2 (Ignition 8.1)

system.mes.oee.getCalculationRecordByLocationAndPeriodStart

Description

Returns the single pre-computed OEE calculation record matching the exact period start time for the given location and period type. Returns None if no record exists for that combination.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getCalculationRecordByLocationAndPeriodStart(locationIdOrPath, periodType, startDate)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseLocation ID (ULID) or path.
periodTypeStringFalsePeriod granularity: "HOUR", "DAY", "WEEK", "MONTH", or "SHIFT".
startDateDateFalseExact start_date of the record to retrieve.

Returns

A JSON representation of an OeeCalculationRecordDTO, or None if not found.

NameTypeNullableDescriptionDefault Value
idStringTrueThe ID of the record (ULID).null
locationIdStringFalseIdentifier of the associated location.null
locationPathStringTruePath of the associated location (display only).null
periodTypeStringFalsePeriod granularity: HOUR, DAY, WEEK, MONTH, or SHIFT.null
startDateInstantFalseStart of the period bucket (calendar-aligned).null
endDateInstantFalseEnd of the period bucket (calendar-aligned).null
calculatedDateInstantFalseWhen this record was computed.null
availabilityDoubleTrueAvailability metric (0.0 to 1.0).null
performanceDoubleTruePerformance metric (0.0 to 1.0).null
qualityDoubleTrueQuality metric (0.0 to 1.0).null
oeeDoubleTrueOverall Equipment Effectiveness metric (0.0 to 1.0).null
teepDoubleTrueTotal Effective Equipment Performance metric (0.0 to 1.0).null
totalDurationSecDoubleFalseTotal duration of the period in seconds.0.0
scheduledDurationSecDoubleFalseDuration scheduled for production in seconds.0.0
runningDurationSecDoubleFalseDuration the machine was actively running in seconds.0.0
downtimeDurationSecDoubleFalseDuration in downtime state in seconds.0.0
productionCountDoubleFalseTotal units produced during the period.0.0
goodCountDoubleFalseTotal good units recorded during the period.0.0
wasteCountDoubleFalseTotal waste units recorded during the period.0.0

Code Examples

import system.date
from java.util import Date

# Get the record for today's midnight hour boundary
location = "Enterprise/Site/Line1"
midnight = system.date.midnight(Date())

record = system.mes.oee.getCalculationRecordByLocationAndPeriodStart(location, "DAY", midnight)
if record is not None:
print "OEE for today:", record['oee']
else:
print "No record found for this period"