Skip to main content

system.mes.oee.getDowntimeStatistics

Calculates comprehensive downtime statistics for a specific location within a date range.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

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

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe ULID or path of the location to calculate statistics for.
startDateDateFalseThe start date for the calculation period.
endDateDateTrueThe end date for the calculation period. Defaults to current time.

Returns

A JSON representation of an OeeDowntimeStatisticsDTO object containing comprehensive downtime statistics.

NameTypeNullableDescriptionDefault Value
locationIdStringFalseIdentifier of the associated location where this OEE record was capturednull
locationPathStringTruePath of the location where this OEE record was capturednull
startDateInstantFalseStart date and time of the OEE recordInstant.now()
endDateInstantTrueEnd date and time of the OEE recordnull
totalDurationSecDoubleFalseTotal duration of the OEE record in seconds0.0
downtimeTotalDurationSecDoubleFalseTotal downtime duration of the OEE record in seconds0.0
downtimeEventAverageDurationSecDoubleFalseAverage Duration in seconds for downtime events on the machine0.0
downtimeEventCountIntegerFalseDowntime Event Count during this record period0
downtimePercentDoubleFalsePercent of time of the total duration that the machine was in downtime state0.0
meanTimeBetweenFailuresSecDoubleFalseThe Mean Time Between Failures (MTBF) in seconds0.0
meanTimeToRepairSecDoubleFalseThe Mean Time To Repair (MTTR) in seconds0.0
starvedTotalDurationSecDoubleFalseTotal starved duration of the OEE record in seconds0.0
starvedEventAverageDurationSecDoubleFalseAverage Duration in seconds for starved events on the machine0.0
starvedEventCountIntegerFalseStarved Event Count during this record period0
starvedPercentDoubleFalsePercent of time of the total duration that the machine was in starved state0.0
blockedTotalDurationSecDoubleFalseTotal blocked duration of the OEE record in seconds0.0
blockedEventAverageDurationSecDoubleFalseAverage Duration in seconds for blocked events on the machine0.0
blockedEventCountIntegerFalseBlocked Event Count during this record period0
blockedPercentDoubleFalsePercent of time of the total duration that the machine was in blocked state0.0

Code Examples

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

# Calculate downtime statistics for the last 24 hours
locationPath = "Enterprise/Site/Area/Line1"
endDate = Date()
startDate = Date(endDate.getTime() - TimeUnit.HOURS.toMillis(24))

downtimeStats = system.mes.oee.getDowntimeStatistics(locationPath, startDate, endDate)

print "Downtime Events:", downtimeStats['downtimeEventCount']
print "MTBF (sec):", downtimeStats['meanTimeBetweenFailuresSec']
print "MTTR (sec):", downtimeStats['meanTimeToRepairSec']