Query for PI interpolated data using a set sampling interval. Note that you must have version 1.3.1 or greater of PI SDK in order to use this option.


App As Application

Tags() As String

FilterExpression As String

Servers() As String

StartDate As Variant

Show As FilteredViewConstants

Users() As String

StopDate As Variant

GoodOnly As Boolean

Passwords() As String

Interval As String

MergeResults As Boolean

Return Value

Result As Spreadsheet

SVB Example

' References required

' PixxAddin 1.0 Type Library (1.0)

' PISDK 1.3 Type Library (1.0)

' PISDKCommon 1.0 Type Library (1.0)


Option Base 1

Const g_nTags = 5

Sub Main

Dim PiConn As PixxUI

Set PiConn = AddIns.AddIn("PixxAddin.PixxUI.1")


Dim aServers(g_nTags) As String

Dim aUsers(g_nTags) As String

Dim aPwds(g_nTags) As String


Dim nItem As Integer

For nItem = 1 To g_nTags


aServers(nItem) = "PISERVER"

aUsers(nItem) = "piadmin"

aPwds(nItem) = ""


Next nItem


Dim aTags(g_nTags) As String


aTags(1) = "BA:ACTIVE.1"

aTags(2) = "BA:TEMP.1"

aTags(3) = "BA:CONC.1"

aTags(4) = "BA:LEVEL.1"

aTags(5) = "BA:PHASE.1"


Dim s As Spreadsheet


On Error Resume Next


Set s = PiConn.PIInterpolatedDataItvl(Application,aServers,aUsers,aPwds,aTags,"y","t","1h","",btAuto,True,True)


If Err.Number <> 0 Then

MsgBox Err.Description

Exit Sub

End If


s.Visible = True


End Sub