system.mes.oee.calculateOeeByTimeInterval
Calculates OEE metrics broken down by time intervals for a specific location within a date range.
Permissions
This method requires the OEE.READ.CALCULATE permission.
Syntax
# Basic calculation with positional parameters
system.mes.oee.calculateOeeByTimeInterval(locationIdOrPath, startDate, endDate, interval, intervalTimeUnits=None)
# Extended calculation with keyword arguments
system.mes.oee.calculateOeeByTimeInterval(
locationIdOrPath=location,
startDate=start,
endDate=end,
interval=intervalValue,
intervalTimeUnits=timeUnits,
unitOfMeasureName=unit
)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
locationIdOrPath | String | False | The ULID or path of the location to calculate OEE for. |
startDate | Date | False | The start date for the calculation period. |
endDate | Date | False | The end date for the calculation period. |
interval | Integer | False | The time interval value for breaking down the calculations. |
intervalTimeUnits | String | True | Time units for interval ("MINUTES", "HOURS", "DAYS"). Default: "MINUTES" |
unitOfMeasureName | String | True | The unit of measure name for production calculations (keyword only). |
Returns
Returns a list of JSON objects representing OeeResultsDTO objects for each time interval.
Each object has the following properties:
| Name | Type | Nullable | Description | Default Value |
|---|---|---|---|---|
locationId | String | False | Identifier of the associated location where this OEE production record was captured | null |
locationPath | String | True | Path of the location where this OEE production record was captured | null |
startDate | Instant | False | Start date and time of the OEE production record | Instant.now() |
endDate | Instant | True | End date and time of the OEE production record | null |
totalDurationSec | Double | False | Total duration of the OEE production record in seconds | 0.0 |
scheduledDurationSec | Double | False | Duration in seconds that the machine was scheduled to run during this record period | 0.0 |
scheduledProductionModeEventCount | Integer | False | Total number of scheduled production mode events during this record period | 0 |
scheduledDowntimeDurationSec | Double | False | Duration in seconds that the machine was scheduled to be in downtime during this record period | 0.0 |
scheduledDowntimeModeEventCount | Integer | False | Total number of scheduled downtime mode events during this record period | 0 |
unscheduledDowntimeDurationSec | Double | False | Duration in seconds that the machine was in unscheduled downtime during this record period | 0.0 |
unscheduledDowntimeEventCount | Integer | False | Total number of unscheduled downtime mode events during this record period | 0 |
runningDurationSec | Double | False | Duration in seconds that the machine was actively running during this record period | 0.0 |
runningStateEventCount | Integer | False | Total number of running state events during this record period | 0 |
blockedDurationSec | Double | False | Duration in seconds that the machine was in BLOCKED state during this record period | 0.0 |
blockedStateEventCount | Integer | False | Total number of blocked state events during this record period | 0 |
starvedDurationSec | Double | False | Duration in seconds that the machine was in STARVED state during this record period | 0.0 |
starvedStateEventCount | Integer | False | Total number of starved state events during this record period | 0 |
idleDurationSec | Double | False | Duration in seconds that the machine was in IDLE state during this record period | 0.0 |
idleStateEventCount | Integer | False | Total number of idle state events during this record period | 0 |
downtimeDurationSec | Double | False | Duration in seconds that the machine was in DOWNTIME state during this record period | 0.0 |
downtimeStateEventCount | Integer | False | Total number of downtime state events during this record period | 0 |
productionCount | Double | False | Total number of units produced during this record period | 0.0 |
expectedProductionCount | Double | False | Expected number of units to be produced during this record period | 0.0 |
averageStandardRate | Double | False | Average Standard Rate for the time period. Calculated as per minute | 0.0 |
maximumStandardRate | Double | False | Maximum Standard Rate for the time period. Calculated as per minute | 0.0 |
wasteCount | Double | False | Total number of waste units recorded during this period | 0.0 |
goodCount | Double | False | Total number of good units recorded during this period | 0.0 |
productionCountUnitOfMeasureId | String | True | Identifier of the unit of measure for the production count | null |
productionCountUnitOfMeasureName | String | True | Name of the unit of measure for the production count | null |
productionCountUnitOfMeasureSymbol | String | True | Symbol of the unit of measure for the production count | null |
availability | Double | True | Availability metric (0.0 to 1.0) | 1.0 |
teep | Double | True | Total Effective Equipment Performance (TEEP) metric (0.0 to 1.0) | 1.0 |
performance | Double | True | Performance metric (0.0 to 1.0) | 1.0 |
quality | Double | True | Quality metric (0.0 to 1.0) | 1.0 |
oee | Double | True | Overall Equipment Effectiveness (OEE) metric (0.0 to 1.0) | 1.0 |
Code Examples
from java.util import Date
import system.date
# Calculate hourly OEE for the last 8 hours
locationPath = "Enterprise/Site/Area/Line1"
endDate = Date()
startDate = system.date.addHours(end_date, -8)
hourly_oee = system.mes.oee.calculateOeeByTimeInterval(
locationPath,
startDate,
endDate,
1,
"HOURS"
)
print "Hourly OEE Results:"
for interval in hourly_oee:
startTime = interval.get('startTime')
endTime = interval.get('endTime')
oeePct = interval.get('oeePercentage', 0)
print "Hour {} - {}: {}% OEE".format(startTime, endTime, oeePct)