Connection to PI Server and Update values in VB of PI Datalink 2014

Discussion created by Fran on Jun 12, 2014
Latest reply on Jun 27, 2014 by Gregor

I have a development in VB for PI Datalink 4.1.1 to connect to a PI Server and update some values. But it doesn't work in PI Datalink 2014.


This is the code:



Dim srv As Server
Dim PITag As PIPoint
Dim Inicio As Integer
Dim Fin As Integer
Set srv = Servers("")
If srv.Connected Then
    Call srv.Close
End If
Call srv.Open("UID=pimanual;PWD=PImanual")
Inicio = 6
Fin = 29
Set PITag = srv.PIPoints(CStr(Cells(6, 1).Text))
For I = Inicio To Fin
        Call PITag.Data.UpdateValue(Cells(I, 3).Text, Cells(I, 2).Text)
Next I

 The failure is in the UpdaValue instruction but I'm not sure that the pi server is connected properly in the open statement