Вы находитесь на странице: 1из 23

Synergy with PI and SQL Server

Working Together

By: Rich Winslow

7/24/2017
Outline

Introduction
Data Types
Data Migration
Extraction Routine
Summary/Conclusion

7/24/2017
Introduction
PI and SQL server offer two distinct ways to
represent data to end-user:
Time-based
Event-based
Both representations are useful depending on:
How the data must be retrieved
Relationships between multiple data points.

7/24/2017
Introduction

Data needs to be stored to maximize data


retrieval efficiency.

Thus, certain event data captured by PI,


needs to be extracted and stored in a
relational database for efficient retrieval.

7/24/2017
Introduction
I will describe:
How to create a routine to migrate PI time series
data into event-based data in SQL Server.
Pitfalls in correlating multiple tags
How to get around some challenges in PI.

7/24/2017
Data Types
Time Series Event Based
Continuous Discrete
Not tied to other data Tied to other data
Trend view Table view
Queried by multiple indices
Merged with non-PI data

7/24/2017
Data Types
Time-based data in a time series database
Temperature, Pressure, Kettle level
Valve position, Motor state, Alarm state
Totalized volume

Event-based data in a relational database


Ingredient addition
End of roll or batch
Error condition
Downtime condition
7/24/2017
Data Types: Event Data
Ingredient Addition End of Roll / Batch
Date/Time Start Date/Time
Source unit End Date/Time
Destination unit Production Unit
Target quantity Product Id
Actual quantity SAP Process Order
Unit of measure #
Roll or Lot Id
Parent Roll or Lot
7/24/2017
Id
Data Types: Event Data
Downtime Event Error Condition
Start Time Start Date/Time
End Time End Date/Time
Product Id Category
Volume scrapped Error Description
Reason/Category
Operator Description

7/24/2017
Data Types: Event Data
Queries and Grouping by:
Product Id
Production Unit
Category
Merging with other data:
Product Family
Genealogy
Discrete Lab Results

7/24/2017
Data Migration

7/24/2017
Data Migration: Steps

1. Sign-up for PI Exceptions


2. Watch for PI Exceptions that declare an event:
End of an addition
Error condition
Start or end of a batch/roll, downtime
3. Find all associated PI data point values
4. Record the data in one or more database records
7/24/2017
Data Migration: Pitfalls
Watching for Event Trigger
Trigger is a string tag
Finding Associated Data
No definitive marking of the event
Not all recorded with the same timestamp
Delivery is delayed because of a network bridge
One data point has bad quality
Record data
Database is down or Network failure
7/24/2017
Data Migration: Time Shifts

7/24/2017
Extraction Routine: Design Criteria
Allow access to file system and databases
Event and/or time triggered calculations
Handle all data types (float, integer, string, etc)
Back-date new values
Run as a background routine (ex: NT service)
Configurable from database tables
Parallel executions (Division of work; isolation)
7/24/2017
Extraction Routine: Implementation

7/24/2017
Extraction Routine: Configuration
Calculation Name
Enabled/Disabled (Allow dynamic update)
PI Point used as the Event Trigger
List of PI Points used as input
Reset Request
Statistics: # of triggers, time between triggers
(To measure backlogs and efficiency)
7/24/2017
Extraction Routine: Startup
Open the database (but close every 2 hrs)
Read the configuration information into
memory
Read initial PI snapshot values explicitly
Sign-up of updates in PI
Go to sleep

7/24/2017
Extraction Routine: Execution
Wakeup on timer
Get all exceptions since we last looked
Scan exceptions for trigger values
or
Read the set of string values since the last
time
Execute event logic to record the data
Record the calculation statistics
7/24/2017
Go to sleep
Execution Routine: Enhancements

Calculation Catch-up
(Allow reading of archive data)
Sort exceptions by time before processing
(Handle with calculation interaction)

7/24/2017
Summary
Design logic to allow staggered timestamps
Store data for efficient data retrieval
Use an NT Service for automatic startup
Use multiple executables for production
facility isolation to help handle downtime
Load balance data extraction

7/24/2017
Conclusion
OSI has provided the methods to take
your data anywhere you need to go:
File system, database
Command execution: Report generator
UDP message, FTP transmission
E-mail, Pager notification

7/24/2017
Questions?

Feel free to contact me at:

Voice Mail: 888-892-1946


E-Mail: richwinslow@citcom.net

7/24/2017

Вам также может понравиться