1 Reply Latest reply on Aug 16, 2017 8:25 AM by Eugene Lee

    update tag value From PI VBA to PI AF

    Madjid

      Dear,

       

      I have a case where i use vba to call calculation from an external software. the results will be displyed in PI processbook as a TEXTBOX. in order to create trending i have created new tags in PI AF to store data from the calculation.

      i am looking for a way to update this data whenever the calculation run.

       

      i have found in this forum an example below: (however this example valid only for PI DSK not PI AF)

       

      Sub updatevaluee()

      Dim myServer As Server

      Dim myPoint As PIPoint

      Dim myValue As Double

      Dim myTime As Variant

      'change "eammapi1" to your server name

      Set myServer = PISDK.Servers("eammapi1")

      'change "sinusoid" to your tag name

      Set myPoint = myServer.PIPoints("sinusiod")

      myValue = TextBox1.Value

      'I assume you want the value to just update with the current timestamp

      myTime = "*"

      myPoint.Data.updatevalue myValue, myTime

      'letting you know the operation completed

      MsgBox ("Point Updated")

      End Sub

       

      Appreciate your support and advise.

       

      Regards

       

      Madjid