GetKpi Method
- Last UpdatedNov 06, 2025
- 4 minute read
'Declaration
Public Shared Function GetKpi( _
ByVal lineId As Integer, _
ByVal filterType As LineFilterType, _
ByVal filterDuration As Nullable(Of Integer), _
ByVal filterTimeUnit As LineFilterTimeUnit, _
ByVal filterStartOffset As Nullable(Of Integer), _
ByVal filterEndOffset As Nullable(Of Integer) _
) As DataSet
'Usage
Dim lineId As Integer
Dim filterType As LineFilterType
Dim filterDuration As Nullable(Of Integer)
Dim filterTimeUnit As LineFilterTimeUnit
Dim filterStartOffset As Nullable(Of Integer)
Dim filterEndOffset As Nullable(Of Integer)
Dim value As DataSet
value = Line.GetKpi(lineId, filterType, filterDuration, filterTimeUnit, filterStartOffset, filterEndOffset)
public static DataSet GetKpi(
int lineId,
LineFilterType filterType,
Nullable<int> filterDuration,
LineFilterTimeUnit filterTimeUnit,
Nullable<int> filterStartOffset,
Nullable<int> filterEndOffset
)
Parameters
- lineId
- Required. Holds the ID of the line.
- filterType
- Required. Holds a LineFilterType enumeration value that specifies the type of time period by which to filter the data. For more information, see the LineFilterType enumeration help topic for the FactMES.API.Core namespace.
- filterDuration
- Optional. Holds an integer value that specifies the value of N if filterType is LastNHours.
- filterTimeUnit
Required. Holds a LineFilterTimeUnit enumeration value that specifies the time unit for a custom filter if filterType is Custom. For more information, see the LineFilterTimeUnit enumeration help topic for the FactMES.API.Core namespace.
If filterType is not Custom, this parameter is ignored.
- filterStartOffset
- Optional. Holds an integer that specifies the start point of the time interval for which the events are to be filtered. See the Remarks section below for more information about how this parameter is used.
- filterEndOffset
- Optional. Holds an integer that specifies the end point of the time interval for which the events are to be filtered. See the Remarks section below for more information about how this parameter is used.
Return Value
Returns a DataSet that contains the Availability, Quality, Performance and OEE values for the line during the specified period of time.
The columns of the returned DataSet are described below.
|
Column Name |
Description |
|---|---|
|
target_util |
A floating point number that is the target utilization for the line. |
|
actual_util |
A floating point number that is the actual calculated utilization for the line based on the bottleneck entities. |
|
target_qual |
A floating point number that is the target quality for the line. |
|
actual_qual |
A floating point number that is the actual calculated quality for the entities on the line, with respect to the UOM of the standard item of the line. |
|
target_perf |
A floating point number that is the target performance for the line. |
|
actual_perf |
A floating point number that is the actual calculated performance for the line based on the bottleneck entities and production. |
|
target_oee |
A floating point number that is the target OEE for the line. |
|
actual_oee |
A floating point number that is the actual calculated OEE for the line based on the calculated utilization, quality, and performance. |
|
total_runtime |
An integer that is the total runtime for the bottleneck entities for the time period given. |
|
total_downtime |
An integer that is the total downtime for the bottleneck entities for the time period given. |
|
total_good |
A double that is the amount of good production made on the production entities of the line during the specified time period, in terms of the UOM of the line's standard item if defined. |
|
total_rejects |
A double that is the amount of rejected production made on the entities upstream from and including the production entities of the line during the specified time period, in terms of the UOM of the line's standard item if defined. |
The filter_start_offset and the filter_end_offset together define an interval that filters the data to be returned (that is, only data that falls within the interval will be returned). These offsets both go backwards from the current time; a value of 1 indicates the current time, a value of 2 indicates one time unit ago, etc.
The filter_start_offset must be greater (that is, further back in time) than the filter_end_offset. If the filter_end_offset is 0, it is ignored (that is, the end of the interval will be the current time). For example, if filter_time_unit is set to 2 (Day), filter_start_offset is set to 2, and filter_end_offset is set to 1, then only the data with an event time that occurred yesterday will be returned. If filter_time_unit is set to 1 (Shift), filter_start_offset is set to 1, and filter_end_offset is set to 0, then only the events that occurred during the current shift will be returned.
Note: Because this method queries historical tables and supports custom time periods, use caution when querying large time periods (greater than a day), as system performance can be adversely affected.