GetValue Method
- Last UpdatedNov 06, 2025
- 3 minute read
'Declaration
Public Shared Sub GetValue( _
ByVal sessionId As Integer, _
ByVal entId As Integer, _
ByVal KPIType As Integer, _
ByVal filterTimeUnit As Integer, _
ByVal filterStartTime As Integer, _
ByVal filterEndTime As Nullable(Of Integer), _
ByRef KPIValue As Double _
)
'Usage
Dim sessionId As Integer
Dim entId As Integer
Dim KPIType As Integer
Dim filterTimeUnit As Integer
Dim filterStartTime As Integer
Dim filterEndTime As Nullable(Of Integer)
Dim KPIValue As Double
OeeExec.GetValue(sessionId, entId, KPIType, filterTimeUnit, filterStartTime, filterEndTime, KPIValue)
public static void GetValue(
int sessionId,
int entId,
int KPIType,
int filterTimeUnit,
int filterStartTime,
Nullable<int> filterEndTime,
out double KPIValue
)
Parameters
- sessionId
- Optional. Holds the session ID and thus the user who is making this method call.
- entId
- Required. Holds the ID of the entity for which the KPI data is being retrieved.
- KPIType
Required. An enumeration that specifies the KPI type of value that is being calculated:
0 = OEE
1 = Quality
2 = Availability
3 = Performance
This parameter cannot be null.
- filterTimeUnit
Required. An enumeration that specifies the time unit for the start and end time filters:
0 = Hour
1 = Shift
2 = Day
3 = Week
4 = Month
5 = Year
- filterStartTime
- Required. Holds an integer that specifies the start of the filter period relative to now. The unit of time is specifed by the filterTimeUnit parameter. This parameter cannot be null.
- filterEndTime
- Required. Holds an integer that specifies the end of the filter period relative to now. The unit of time is specifed by the filterTimeUnit parameter.
- KPIValue
- Output. The returned current value of the specified KPI type.
This method returns the current value for the specified KPI type. If the filter time unit is hour, the results will include data for 0 or more entire hour periods, relative to the current time (now). However, for all other settings such as Shift, Day, Week, etc., the results will start at the beginning of the time unit specified by the filter start offset. And, the end time will be at the end of the time unit specified by the filter end offset.
The KPI types are calculated as follows:
OEE = Quality × Availability × Performance
Quality = Sum of Good Quantities ÷ (Sum of Good Quantities + Sum of Reject Quantities)
Availability = Total runtime ÷ (Total runtime + Total downtime)
Performance = CEIL((Total Good Quantities + Total Reject Quantities) ÷ Batch Size) ÷ (Total Runtime ÷ 3600)
The quality is calculated from the Item_Prod table by summing up the good and reject quantities from that table. The machine availability is calculated from the Util_History table by summing up the runtime and downtime durations. The performance is calculated based on the quantities in the Item_Prod table and the machine availability from the Util_History table.
The following conditions must be true for this method to succeed:
- The supplied values for the entId, KPIType, filterStartTim, and filterEntTiem parameters must not be null.
- The supplied values for the KPIType and FilterTimeUnit enumerations must be valid.
- The filter end time must be after the filter start time.