Application.PISnapshotData
This property queries for PI snapshot data as it is added to the system.
SVB Example
Querying data from PI databases:
Option Base 1 Option Explicit Sub Main Dim ss As Spreadsheet Set ss = Application.PICompressedData("piserver","pidemo","""","BA:ACTIVE.1","9/16/2013 5:14:55 PM","9/17/2013 5:15:03 PM",3,"",0,True,False) ss.Visible = True 'Query for PI compressed data using a start date, direction, and number of points Dim ss2 As Spreadsheet Set ss2 = Application.PICompressedDataNP("piserver","pidemo","""","BA:ACTIVE.1","9/16/2013 5:18:34 PM",10,0,3,"",0,True,False) ss2.Visible = True 'Query for PI interpolated data using a date range and a number of observations Dim ss3As Spreadsheet Set ss3As = PIInterpolatedDataObs("piserver","pidemo","""","BA:ACTIVE.1","9/10/2013 5:20:34 PM","9/17/2013 5:20:34 PM",10,"",0,True) ss3As .Visible = True 'Query for PI summaries data using a date range and a number of observations Dim ss4 As Spreadsheet Set ss4 = Application.PISummariesDataObs("piserver","pidemo","""","BA:ACTIVE.1","9/15/2013 5:32:16 PM","9/17/2013 5:32:16 PM",50,5,2,True) ss4.Visible = True 'Query for PI snapshot data as it is added to the system Application.PISnapshotData("piserver","pidemo","""","BA:ACTIVE.1",1000,5,True) Wait 22 Dim ss5 As Spreadsheet Set ss5 = PIStopSnapshotData() ss5 .Visible = True End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.