4 Replies Latest reply on Aug 24, 2011 2:56 PM by dtakara

    Casting ad-hoc PIACEPoint Objects


      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


      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


                  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
              End Try
          End If