0

i trying write value with this example : opc ua client to server

But i have this error :

 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

someone can help me please

thank you so much

Christophe
  • 21
  • 1
  • 6

2 Answers2

2

I find \o/

this link help me : 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)

I hope my adventure can help others ;)

Christophe
  • 21
  • 1
  • 6
0

This is telling you the server is expecting a value with a different datatype than the one you wrote.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35