mihorrocks

Casting ad-hoc PIACEPoint Objects

Discussion created by mihorrocks on Jul 29, 2011
Latest reply on Aug 24, 2011 by dtakara

I have created an ACE calculation that requires to cast outputs ad-hoc (i.e. not predefined as outputs in the original context definition in the wizard)

 

There can be one or more aliases defined in the configuration context that will be used as outputs.

 

I am having issues casting the PIACEPoint as a working output. The object appears to be created correctly, but no output is ever produced. There are no exceptions thrown.

 

A quick fix I am using the in meantime is to use the PISDK UpdateValue method in the PIAlias.Datasource property, but I wish to avoid using this so the data is correctly buffered to collectives. (I am using PISDK 1.3.8.388)

 

Here is an extract of my code. (It is worth noting that this code is running in an independant class that has not inherited PIACENetClassModule)

 

For Each DataLine In Me.ContentData

 

    If DataLine.Length > 0 Then
        Try

 

            PIAlias = Me.MyModule.PIAliases(DataLine.Split(",")(0))
            Value = CSng(DataLine.Split(",")(2))
            Quality = CInt(DataLine.Split(",")(3))

 

            PIACEPoint = New OSIsoft.PI.ACE.PIACEPoint(Me.MyContext, PIAlias.Name, TagAliasUsedType.TagAliasAsOutput)
            
PIACEPoint.ExeTime = Me.ExePITime.UTCSeconds

 

            Select Case Quality
                Case 0
                    PIACEPoint.Value = Value
                Case Else
                    PIACEPoint.Value = "Bad"
            End Select

 

            PIACEPoint.SendDataToPI = True

 

        Catch ex As Exception
            Me.AddError(ex)
        End Try
    End If

 

Next

Outcomes