YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

ComExeption was unhandled . :( Requested point does not exits on server Options · View
u030645
#1 Posted : Friday, September 02, 2011 12:39:21 PM
Rank: Newbie
Groups: Member

Joined: 8/30/2011
Posts: 2
Location: Belgium
Ive been testing some code , but there's a error message :(
ComExeption was unhandled .
Requested point does not exits on server .CSM_622_QIA_R9205.pv
Crying
I'm sure it exits .....

Some help please .... thx in advance


Module Module1
' Eerst Add reference PISDK.dll
Dim PIServer As PISDK.Server

Private Const PIServerName As String = "HERALD"
Private Const PIUserName As String = "pidemo"
Private Const PIUserPass As String = ""
'_____________________________________________________________________________________________________
Public Function ConnectToPI() As Boolean
Dim bRes As Boolean = False
Dim SDK As New PISDK.PISDK
Try
If PIServer Is Nothing Then PIServer = SDK.Servers(PIServerName)
Try
If Not PIServer.Connected Then PIServer.Open("UID=" & PIUserName & ";PWD=" & PIUserPass)
bRes = PIServer.Connected
Catch ex As Exception
bRes = False
End Try
Catch ex As Exception
bRes = False
End Try
Return bRes
End Function

Sub Main()
Dim startTime As String
Dim endtime As String
Dim duration As String

Dim pt As PISDK.PIPoint
Dim pData As PISDK.PIData
Dim ipid2 As PISDK.PIData
Dim Values As PISDK.PIValues
Dim tagname As String = ("CSM_622_QIA_R9205.PV")
Dim i As Integer

startTime = "28-jul-2011 12:00:00"
endtime = "28-jul-2011 14:00:00"
duration = "30m"

If ConnectToPI() = True Then
Console.WriteLine("U bent geconnecteerd met server " & PIServer.Name.ToString())

Else
Console.WriteLine("U bent niet geconnecteerd")
End If
Console.ReadLine()


pt = PIServer.PIPoints("CSM_622_QIA_R9205.pv") 'get tag pData = pt.Data
ipid2 = pData

Values = ipid2.InterpolatedValues(startTime, endtime, duration)

For i = 1 To Values.Count
Console.WriteLine((Values(i).TimeStamp.LocalDate), "dd-mm-yyyy hh:mm:ss", " ", Values(i).Value)
Next i
Console.ReadLine()
Values = Nothing
ipid2 = Nothing
pData = Nothing
pt = Nothing
PIServer = Nothing


End Sub
End Module
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
u030645
#2 Posted : Monday, September 05, 2011 4:18:54 PM
Rank: Newbie
Groups: Member

Joined: 8/30/2011
Posts: 2
Location: Belgium
problem solved .

it 's a trust connection so
If Not PIServer.Connected Then PIServer.Open("UID=" & PIUserName & ";PWD=" & PIUserPass)

must be
If Not PIServer.Connected Then PIServer.Open()

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.