Creating Additional KPIs
Additional KPIs can be added, using the availability, OEE, quality ratio, and effectiveness KPI implementations as a model. Example for creating two additional KPIs are provided:
The high-level steps and best practices for creating an additional KPI are as follows:
1. Create a Thing Shape for your KPI, using the following naming convention: (<Prefix>.KPI) + <KPI_NAME> + ThingShape. For example, MY_CORP.KPI.MyKPIThingShape.
On the Thing Shape, add the following properties, as a minimum:
<KPI_Name>_currentValue, with Base Type=Number
<KPI_Name>_lastCalculatedTime, with Base Type=DateTime
<KPI_Name>_unitOfMeasure, with Base Type=String
Ensure that the Persistent checkbox is selected for each of these properties.
2. Implement the following services on your KPI Thing Shape, using the services on PTC.SCA.SCO.OEEThingShape as an example:
Get_<KPI_Name>_CurrentValue
Get_<KPI_Name>_ThresholdValues
Get_<KPI_Name>_Trend
<KPI_Name>_Calculate
Set_<KPI_Name>_CurrentValue
3. On the Thing Template of each equipment type for which this KPI is to be calculated, override the GetKPINames service to add the new KPI Thing Shape. See the GetKPINames service on the PTC.SCA.SCO.KPIElementThingShape for an example.
4. Declare the thresholds for the KPI in the KPI manager. The out-of-the-box KPI manager is the PTC.SCA.SCO.DefaultKPIManager.
a. On the KPI manager Thing, add a configuration table with the following values:
Table Name<KPI_Name>ThresholdValues
Data ShapePTC.SCA.SCO.KPIThresholdValues
Allow Multiple Rows—Ensure that this checkbox is selected.
b. Add at least one row to the new configuration table. Use the existing KPI threshold value configuration tables as an example.
5. If your <KPI_Name>_Calculate service depends on a new KPI element, define the KPI element on the Thing Shape created for your KPI in step 1:
a. Create a property for the KPI element with the appropriate Base Type for your KPI element, most commonly Number. Ensure that the Persistent checkbox is selected.
b. Create a new service named <property_name>_Calculate. Refer to the producedQuantity_PQ_Calculate service as an example.
c. On the Thing Template of each equipment type for which this KPI is to be calculated, override the GetKPIElementNames service. Add the new KPI Element property to the list of KPI elements.
Was this helpful?