Eiko Willemsen

Start Notifications does not seem to work from SDK

Discussion created by Eiko Willemsen on Feb 5, 2014
Latest reply on Mar 31, 2014 by chayacrevanmartis



I try to start notifications from a number of elements using the SDK, see code.


IN PI System Explorer I see the Notificationstatus is getting enabled so it seems to be started.


But the started notification does not seem to be triggered when it should


If I do the same manual from the PI System Explorer it does work perfectly.


Is there something I do wrong?


I  use PI AF Client 2010 R3 and PI AFServer 2010 R3



 Public Function SetSPCStatus(ByRef parameterList As List(Of clsParameter), ByVal status As Analysis.AFStatus)
        Dim AFSystem As PISystem
        Dim dataBase As AFDatabase
        Dim selectedElement As AFElement = New AFElement()
        Dim notificationAddress As String = ""
        Dim errorstring As String = ""

        AFSystem = New PISystems().Item(ConfigurationManager.AppSettings("AFServerName"))
        dataBase = AFSystem.Databases(ConfigurationManager.AppSettings("AFDatabase"))
        For Each par In parameterList
            notificationAddress = GetAddressFromTag(dataBase.Name, par.NotificationPath)
            selectedElement = AFNotification.FindObject(notificationAddress)
            For Each item In selectedElement.GetNotifications(Nothing, Nothing, 100)
                item.SetStatus(status, errorstring)
                If Not String.IsNullOrEmpty(errorstring) Then
                    par.SaveError = errorstring
                    par.SaveStatus = False
                    par.SaveStatus = True
                End If

        Return Not parameterList.Any(Function(x) x.SaveStatus = False)
    End Function