Skip to main content

system.mes.oee.getTopDowntimeByDuration

Description

Retrieves the top availability reasons ranked by their total accumulated duration for a specified location and time range.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getTopDowntimeByDuration(locationIdOrPath, startDate, endDate, count)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location path or ID to analyze.
startDateDateFalseThe start time for the analysis period.
endDateDateFalseThe end time for the analysis period.
countIntegerFalseThe maximum number of reasons to return.

Returns

A list of JSON representations of OeeDowntimeByReasonDTO objects, each representing a availability reason and its aggregated data.

NameTypeNullableDescriptionDefault Value
availabilityReasonPathStringTruePath of the availability reasonnull
durationDoubleTrueDuration of downtime for this reason0.0
countLongTrueCount of downtime events for this reasonnull
durationPercentDoubleTruePercentage of total duration for this reason0.0
countPercentDoubleTruePercentage of total count for this reason0.0

Code Examples

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

# Get the top 3 availability reasons by duration for the last 24 hours
location = "Enterprise/Site/Area/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.DAYS.toMillis(1))

topReasons = system.mes.oee.getTopDowntimeByDuration(
location,
startTime,
endTime,
3
)

print "Top 3 Availability Reasons by Duration:"
for reason in topReasons:
print " - {}: {:.2f} hours, {} occurrences".format(
reason['availabilityReasonName'],
reason['duration'] / 3600.0,
reason['count']
)