Python 3.x 使用opc-ua-Python编写一个值
我尝试使用以下示例编写值: 但我有一个错误:Python 3.x 使用opc-ua-Python编写一个值,python-3.x,opc,Python 3.x,Opc,我尝试使用以下示例编写值: 但我有一个错误: Exception "unhandled opcua.ua.uaerrors._auto.BadTypeMismatch" "The value supplied for the attribute is not of the same type as the attribute"s value."(BadTypeMismatch) File: C:\Users\lari\AppData\Loca
Exception "unhandled opcua.ua.uaerrors._auto.BadTypeMismatch"
"The value supplied for the attribute is not of the same type as the attribute"s value."(BadTypeMismatch)
File: C:\Users\lari\AppData\Local\Programs\Python\Python38\lib\site-packages\opcua\ua\uatypes.py, Line: 218
有人能帮我吗
非常感谢这告诉您服务器期望的数据类型与您编写的数据类型不同。我发现\o/ 此链接帮助我: 我希望我的冒险能帮助别人;)
dv = ua.DataValue(ua.Variant(122, ua.VariantType.Int32))
dv.ServerTimestamp = None
dv.SourceTimestamp = None
trou.set_value(dv)