Skip to main content

system.mes.oee.getTopDowntimeByCount

Description

Retrieves the top availability reasons ranked by the number of occurrences for a specified location and time range.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getTopDowntimeByCount(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.

Each object has the following properties:

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 5 most frequent availability reasons for the last week
location = "Enterprise/Site/Area/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.DAYS.toMillis(7))

topReasons = system.mes.oee.getTopDowntimeByCount(
location,
startTime,
endTime,
5
)

print "Top 5 Availability Reasons by Count:"
for reason in topReasons:
print " - {}: {} occurrences, Total Duration: {:.2f} min".format(
reason['availabilityReasonName'],
reason['count'],
reason['duration'] / 60.0
)