AnsweredAssumed Answered

Issues faced with PIServers collection initialization (AF SDK)

Question asked by amitpatil.vit on Feb 19, 2019
Latest reply on Feb 20, 2019 by amitpatil.vit

Hi All,

 

I have some experience in developing few custom applications using PI SDK and PI OLEDB (VB .Net, VBA macros etc). However, I was trying to get familiar with new AF SDK (version 4) for accessing data from PI data archive server (disclaimer: I am not a hardcore developer though:-) ).

 

I am facing few warnings related to named spaces and error for collection declaration in my basic program written to perform connection checks. Can someone suggest where exactly I am going wrong?

 

Errors/Warnings-

warning BC40056: Namespace or type specified in the Imports 'OSIsoft.AF.PI' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

error BC30002: Type 'OSIsoft.AF.PI.PIServers' is not defined.

 

Here is how my basic vb.net program looks like-

Imports OSIsoft.AF.PI 'named space

Public Class Form1

'Global variables

Dim g_PIServers As OSIsoft.AF.PI.PIServers 'Global declaration

Public Sub Test_PI_Server_Connection()

' Get the PIServers collection for the current user and default PIServer.

g_PIServers = New OSIsoft.AF.PI.PIServers 'Initializing instance of PIServers collection

Dim myPIServer As OSIsoft.AF.PI.PIServer

myPIServer = g_PIServers.DefaultPIServer

 

Dim piservername As String

piservername = myPIServer.Name

'Need to add connection method once server is detected

End Sub

End Class

 

I have installed AF client 2018 on my system and included the reference for OSIsoft.AFSDK in the project already.

 

.Net framework on my Win10 system:

-Amit

Outcomes