Enabling Subscription-Based Status Calculation for Systems with Large Numbers of Assets
Systems with large numbers of assets that do not use KPIs can use a subscription-based status calculation for improved performance. Because this configuration stores status information in a value stream rather than in the relational database, the subscription-based status calculation does not support KPI calculation.
|
Any status information that has been stored in the database prior to enabling subscription-based status calculation is not migrated to the value stream.
|
For additional information on how subscription-based status calculation functions, see
Understanding Subscription-Based
Status Calculation.
Before Enabling Subscription-Based Calculation
Be aware that the subscription-based status calculation has been tested in the following scenario with no issues found:
• 15.5K assets
• 50 dynamic properties on each asset
• Average property update rate of once every 2.5 minutes
• On an individual asset, 14 properties from that asset are used in the calculation of 5 statuses
• InfluxDB is used with a single value stream for all assets
• Server specifications:
◦ ThingWorx server: 16 virtual CPUs and 64 GB of RAM
◦ Azure virtual machine: D16s v3
◦ Separate servers for InfluxDB and PostgreSQL
• No calculation of KPIs
• Not tested with file transfer and remote access
Enabling Subscription-Base Status Calculation
To enable subscription-based status calculation, complete the following steps:
2. Update the status manager that is configured for ThingWorx Apps.
a. In ThingWorx Composer, navigate to the launch point configuration Thing (PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion]).
b. Under
Configuration, click
to edit the
StatusManager entry in the
ManagerConfigurationSettings configuration table.
c. Change the Value from PTC.SCA.SCO.DefaultStatusManager to PTC.SCA.SCP.DefaultStatusManager.
d. Click Set.
e. Click Save to save the changes to the launch point configuration Thing.
3. Run the service to enable the alternate status calculation.
a. In ThingWorx Composer, navigate to the alternate status manager (PTC.SCA.SCP.DefaultStatusManager).
b. Under Services, execute the EnableScaledStatusCalcuation service. The service has completed successfully when "No results" displays in the service output pane.
4. Create a new asset-based equipment type to use for your assets.
b. On your new Thing Template, set an InfluxDB-based value stream. For more information, see
Value Streams in the
ThingWorx Help Center.
c. Create a new resource provider Thing based on the PTC.SCA.AssetResourceProviderTemplate Thing Template.
d. On your new resource provider, under
Services, click
to override the
CreateEquipmentInstance service.
e. In the script pane, remove the code that creates a value stream (lines 44 through 56).
f. Click Done, then click Save to save the updated service on your resource provider.
g. On the launch point configuration Thing (
PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion]), under
Configuration, click
Add on the
EquipmentTypeSettings configuration table to add your new equipment type. Specify the Thing Template created in 4a and the resource provider created in step 4c for the new equipment type. For more information, see
Defining Equipment Types.
h. Click Save to save the updated launch point configuration Thing.
5. Use the new equipment type to create your assets.
Understanding Subscription-Based Status Calculation
The default status calculation for ThingWorx Apps is scheduler-based. With the scheduler-based status calculation, the status for all equipment is calculated each minute, triggered by the status scheduler (PTC.Factory.StatusEvaluationScheduler). When subscription-based status calculation is enabled, the status calculation for a piece of equipment is instead triggered by a subscription:
• Each time there is a value change for any property on the piece of equipment that is used in a status expression.
• Each time an alert is triggered on that piece of equipment (if the HAS_ALERTS function is used in a status expression).
• Each time an alert is cleared on that piece of equipment (if the HAS_ALERTS function is used in a status expression).
• When a status expression is edited or the statuses are reordered on the Status page for the piece of equipment, and Save is clicked.
As a result, if a status expression includes a property from another piece of equipment, changes to that property value do not trigger status calculation for the current piece of equipment. For example, if the Running status expression for Pump1 includes a property from Compressor1, a change to the property value on Compressor1 does not trigger the status calculation for Pump1. When the status calculation for Pump1 is triggered, the property value from Compressor1 is included in the calculation.
The same situation applies to functions used in status expressions. Status expressions which include the HAS_ALERTS function are evaluated each time an alert is triggered or cleared for the current piece of equipment. If the HAS_ALERTS function is used to check for alerts on a separate piece of equipment, that check is only performed when the status calculation for the current piece of equipment is triggered. For example, the Warning status expression for Pump1 could include the following:
"HAS_ALERTS" AND "HAS_ALERTS:Asset_Compressor1"
When the status calculation for Pump1 is triggered (by either a property value change or an alert being triggered or cleared on Pump1) both Pump1 and Compressor1 are checked for alerts. However, if alerts are triggered or cleared on Compressor1, this does not trigger the status for Pump1 to be calculated.
The other functions (ARE_ALL_CHILDREN_RUNNING, IS_SCHEDULED, and IS_DATA_OK) are only evaluated when the status calculation for the current piece of equipment is triggered by a property change or an alert being triggered or cleared on the current piece of equipment.
| PTC does not recommend using the IS_DATA_OK function in status expressions with the subscription-based status calculation. |
When subscription-based status calculation is enabled, status calculation is triggered for a piece of equipment when you click Save after editing a status expression on the equipment’s Status page in > . If a status expression for a piece of equipment is edited within ThingWorx Composer, status calculation is not triggered for that equipment.