【问题标题】:Write a value with opc ua Python用opc ua Python写一个值
【发布时间】:2020-07-22 16:12:25
【问题描述】:

我尝试用这个例子写值: opc ua client to server

但我有这个错误:

 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

谁能帮帮我

非常感谢

【问题讨论】:

    标签: python-3.x opc


    【解决方案1】:

    我找到\o/

    此链接帮助我:https://github.com/FreeOpcUa/opcua-asyncio/issues/30

    dv = ua.DataValue(ua.Variant(122, ua.VariantType.Int32))
    dv.ServerTimestamp = None
    dv.SourceTimestamp = None
    trou.set_value(dv)
    

    我希望我的冒险可以帮助其他人;)

    【讨论】:

      【解决方案2】:

      这告诉您服务器正在期待一个与您编写的数据类型不同的值。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-07-26
        • 2020-08-23
        • 2023-01-21
        • 2017-05-29
        • 2017-08-23
        相关资源
        最近更新 更多