Building Blocks > Solution-Specific Building Blocks > Operation KPI Building Block > Additional Automation Information (Operation KPI Building Block)
Additional Automation Information (Operation KPI Building Block)
Keep in mind the following information while working with data automation and the operation KPI building block.
Batch Processing
Every 5 minutes, a timer event for the PTC.OperationKPI.AutomationEventProcessor_TI timer entity is run, and each pacemaker's subscription on the event executes the main automation event processing service: ProcessPTCAutomationEvents. Multi-batch processing is then exercised until there are no more events to process for that pacemaker.
The batch processing happens for each pacemaker. The main operations that occur, in order, are:
1. Querying the value stream for event data that is not yet processed.
2. Processing the queried events in order of event type: job order, material master, target quantity, production, scrap, and then availability.
3. Buffering of scrap and production events to consolidate the written database entries.
4. Insertion of the processed production, scrap, and availability events into DPM database.
Buffering
During the batch processing, availability, scrap, and production events are buffered and organized in memory. Each entry falls into a specific index, built as described below, and each value processed will increment a count value in the entry for that specific index.
Scrap count events are grouped by machine code, job order ID, shift, and production block ID. When the shift is unknown, the value UNKNOWNSHIFT is used instead of the shift number.
Production count events are grouped by job order ID, shift, and production block. When the production block is unknown, the value UNKNOWNPB is used instead of the production block number.
Scheduled Property Data Purge
The PTC.OperationKPI.AutomationPurgeScheduler scheduler entity controls the purging of value stream data. Specify the amount of time to purge in the past with the dataAgeInHours property on the PTC.OperationKPI.AutomationPurgeScheduler entity.
Quality
Only incoming automated property values for a pacemaker with a quality of GOOD are written to the value stream. This is done by using a subscription to the data change event for each of the automated properties. This subscription calls the AddPTCValueStreamEntry service and verifies that the quality is GOOD before adding the property value to the value stream.
Disconnectivity
When the pacemaker is disconnected longer than the value of the PTCMaxTimeAllowedDisconnected property, data older than that time in minutes is ignored.
If the PTCEnableAutoSetMachineStatusToRunning property is set to true, and the entity has been disconnected longer than that maximum time specified by the PTCMaxTimeAllowedDisconnected property, the batch processing attempts to set the pacemaker to an availability status of Running if it was previously down before the disconnect. This happens as the final action of the batch processing, by calling the SetPTCMachineStatusToRunningIfDisconnectedMoreThanAllowed service, after all events have been processed.
* 
Setting a pacemaker to Running state means that an availability event with the corresponding running reason information is inserted into the DPM database.
The PTCLastTimeConnected property is used to represent the timestamp when a disconnectivity event last occurred, that is, when the isConnected property was set to false. This property is only updated when a disconnect event occurs.
PTC.MfgModel.WorkunitModelLogic_TS Thing Shape
The PTC.MfgModel.WorkunitModelLogic_TS Thing Shape in the manufacturing model building block also contains services and properties that are used by data automation.
The IsPTCAutomationWorkUnit service validates whether the work unit supports data automation.
The PTCDisconnectivitySupported property is a Boolean property used to indicate if remote devices are establishing a connection with ThingWorx, and if the pacemaker should be set back to a Running availability state using the SetPTCMachineStatusToRunningIfDisconnectedMoreThanAllowed service.
The IsPTCDisconnectivitySupported property is a Boolean property that is checked by the Production Dashboard. If the property value is true, then the system evaluates the device's connected status to determine when to pop-ups and messages similar to the following are displayed: Your system has disconnected from the data source. If the system is still disconnected after fifteen minutes, enter all production and loss events manually.
Automation Messages
Messages are automatically generated during normal automation processing and added to the PTCAutomationMessage infotable property for future reference. These messages are displayed by the Production Dashboard when a new message is added.
The PTCMaxNumberOfAutomationMessages property governs how many messages are stored in the PTCAutomationMessage property. The number of messages stored by default is 10.
Customizations
All services are written in JavaScript code with the intent that they can be customized to fit the specific needs of any given application.
There are a variety of configuration properties available that will fine tune the application. For more information, see Key Properties (Operation KPI Building Block).
Was this helpful?