AnsweredAssumed Answered

Write values in a PI tag with Python

Question asked by Douglas_Lisboa on Mar 15, 2018
Latest reply on Apr 10, 2018 by 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.

Outcomes