-
Notifications
You must be signed in to change notification settings - Fork 356
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
How to get ua_class of DataType of specific NameSpace #506
Comments
ahah I knew that one would pop up one day. you cannot... |
but I just made a PR: #508 |
Very good man! Very fast. |
I was using 0.9.0, and when I checkout this commit many new things are coming I believe. With this version I get an exception on |
So, yesterday after finding the issue I have tried some dirty hacks to get to try this functionality. Basically I have made similar changes (commit 4fb0d26), catching same exceptions, but passing instead of raising, only to get through that failing DataType, which in my case seems to be the only one causing issues.
Just to be able to try your functionality to load a specific data type, but it didn't work for me. I get this:
But now I got a bit confused on how this is really supposed to work. The datatype I want to get is in fact a derived datatype from "My inf Model"; On the PLC I had to implement it flat (PLC datatypes can't inherit). Consider the image: In this case is the following code correct? This is the code the outputs the error above.
Thank you. |
you may get that issue if your server does not support spec 1.4. Can you check if your datatypes node have an attribute callled DataTypeDefinition? |
OK. If your server support spec 1.4 Then you can use the load_data-type_definition() (return nothing) and load_custom_struct() (rturn the struct). |
Running with load_type_definitions
Running with load_data_type_definitionsMoreover, I see something "strange". When I run the But for other DataType that same does not happen: But using a OPC UA client I do see them on the browser: log bellow:
EDIT: In this case, EDIT2:
This is far from ideal, but I couldn't see an easy way to fix this given the fact that the extensions on I have created a draft PR so you can see #517 It seems to me that the |
Hi all. First of all, great work keeping this up to date with that standard!
I am using asyncua (0.9.0) for a tester client for a PLC that implements an OPC UA server. I am developing my own inf model.
The PLC creates its own OPC UA DataTypes on its own Namespace. I have my own inf model also loaded into that PLC, so it also has my defined DataTypes.
I have a method that takes one argument of a custom structured DataType, lets say
LinearOutputDeviceConfigDataType
.In order to handle the method on the PLC I have to define a plc data type binary matching the OPC UA definition. The name that I give to the plc data type becomes a OPC UA DataType on the PLC's NameSpace. In my case I was giving the same name as on the Information Model I created. When from asyncua client I call the method giving as argument an object of the type get with
get_ua_class('LinearOutputDeviceConfigDataType')
apparently I am getting an instance of the DataType from the PLC's NameSpace, and it causes the PLC to reject the call.When I rename the PLC's data type to
LinearOutputDeviceConfigDT
this works.Consider the image bellow:
So, my question really is: is there a way of getting the ua_class of the specific Namespace? Or is there other way of getting the class of the input argument that makes sure that it is of the correct namespace?
Thank you so much for your help.
Regards,
Portela
The text was updated successfully, but these errors were encountered: