-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cannot import nodes if the object node type has a parent variable node type. #246
Comments
Hi, thanks for the report, you are right, the objects are imported before the variables. I don't think that an object should be with a hierachical reference below a variable? |
Yes, I think the same thing, but the demo model is built on top of a certified UA_Server. And the demo model was created by UA. I think this can be trusted. Moreover, in the world of OPC - Unified Automation is of great importance. |
|
Ok, seems that for that use case it makes sense, but I don't know why this is a hierachical reference. Nevertheless we should think of how to handle this. First I do a topological sort without considering the nodeclass, but then I fall back to import the objects before the variables. |
open62541-nodeset-loader/src/Nodeset.c Line 261 in fd60349
|
So, I found an explonations...I think so))) https://reference.opcfoundation.org/Core/Part11/v104/docs/5 In this image we can see that the variable has a reference to an object (HA configuration) since it is an object node. |
As far as I understand, in this reference type we need to allow the variable to be imported before the object, maybe there could be some workaround, but I think the same situation might be in other weird reference types as well. What if we do post-processing of nodes whose parents were not found? Let's say, if a node was not added because the parent was not found - before moving on - mark this node or copy its link to another list (deferred list of nodes, second chance :))) What do you think about this solution? :) |
ok, this is another solution, we should give that a try. |
Of course, maybe my solution for some reason this will not be entirely correct, but I don’t see any problems with this yet, if the only problem is that there is no parent, in any case, even if the node really does not have a parent, the second chance will not work for such a node, otherwise it will be added. And we don't need to make any changes to the sorting itself. |
So, tomorrow I can try to prepare this solution, but if you do it earlier, please write to me in this issue. |
Would be cool if you could prepare a pull request, I will have no time before the weekend. |
Hi, 2.) lets try a limited amount of cycles (for example 10 times, but lets make it a constant). |
Hi.
But if you think it’s better without it, then I will do so. |
Hi, please make it without the compiler switch, it makes it harder to test. If someone has an error in the nodeset.xml, he should notice it (we should also log a warning, if the second chance is needed) and fix the xml. |
Hi! |
Want to ask if you know how to solve a problem using a local usage test (unit test)? undefined reference to I added the |
here is the way the CI builds it on ubuntu: It installs libcheck: and configures the build with cmake:
maybe you also need: |
Thanks!
This was the first thing I did. This is the last version of check: Maybe I'll compile it and try to install it manually. |
Hi! |
I found that using the newest "FindCheck.cmake" I can build the test without the link error. Can we try replacing FindCheck.cmake with a newer one? |
for sure, just open a PR with that |
Well, I tried updating FindCheck.cmake, but there was a problem with the GIT build. So I think it's better to keep the old one. |
Hi!
I have a problem importing some sequence of nodes from xml. This xml from the UA_Server model looks like this:
I exported this part of the nodes using my xml exporter and then tried to import.
The main problem is that nodesed-loader sorts the object by type and then adds it to the server. And this order, as far as I understand, is this:
First we import the Objects nodes and then the Variable nodes, but what if we have a reference like Objects --ref--> Variable (parent)? Because when object nodes try to be added to the server, the server cannot find the variables because they do not exist.
And we have an error:
Can we do anything about this?
The text was updated successfully, but these errors were encountered: