3 Replies Latest reply on Apr 10, 2018 5:36 PM by Douglas_Lisboa

    Write values in a PI tag with Python

    Douglas_Lisboa

      Hello,

      We need to write some values from Excel in a PI Tag. Actually, the used code to test writing values seems like this:

      from win32com.client.dynamic import Dispatch
      sTime = "01/01/2018"
      PL = Dispatch("PISDK.PISDK")
      dServer = PL.Servers.DefaultServer
      sTagName = "SomeTag"
      testValue = '123400000000'
      dServer.PIPoints(sTagName).Data.UpdateValue(testValue, sTime)
      

      but console return the error:

      File "<COMObject <unknown>>", line 3, in UpdateValue
      TypeError: The Python instance can not be converted to a COM object
      

      The tag is working fine and bring values with another code. We have permissions to read/write too.

      Anyone knows a way to write these values?

      Thanks in advance.