Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing variables to ABB IRC5 controller using set_value() function #1532

Open
Engeenur opened this issue Nov 30, 2023 · 4 comments
Open

Writing variables to ABB IRC5 controller using set_value() function #1532

Engeenur opened this issue Nov 30, 2023 · 4 comments

Comments

@Engeenur
Copy link

I am having problems with using the node.set_value() function. I keep getting a "The value supplied for the attribute is not of the same type as the attribute"s value."(BadTypeMismatch) error. I can change the variable value with the Softing OPC UA Client software.

I tried all sorts of things:
dv = 1.0
self.start_flag_node.set_value(dv)

dv = opcua.ua.DataValue(opcua.ua.Variant(3.0, opcua.ua.VariantType.Double))
dv.ServerTimestamp = None
dv.SourceTimestamp = None
self.start_flag_node.set_value(dv)

dv = opcua.ua.Variant(3.0, opcua.ua.VariantType.Double)
self.start_flag_node.set_value(dv)

and probably some others.

No matter what I do I still get the same error. The DataType of variable that the Softing OPC UA Client detects this node to have is a Double (i=11).

@schroeder-
Copy link
Contributor

Are you using asyncua or python opcua? Because from the module names it looks you are using the old library.

If you are using python opcua try first to switch to asyncua with either async oder use the syncwrapper.

@schroeder-
Copy link
Contributor

schroeder- commented Nov 30, 2023

Also this is the easiest solution works only asyncua:

dv = 1.0
self.start_flag_node.set_value(ua.Double(dv))

@Engeenur
Copy link
Author

@schroeder- thank you. I am still using the old library. Do you know if i have to make a new certificate for my python client if i'm going to use the new one?

@schroeder- schroeder- transferred this issue from FreeOpcUa/opcua-asyncio Nov 30, 2023
@schroeder-
Copy link
Contributor

schroeder- commented Nov 30, 2023

The certificate can be the same, on both libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants