Replies: 1 comment 2 replies
-
Be more careful when you try to reconstruct these NodeIds. Siemens puts actual quotes into the String identifier. e.g. NodeId nodeId = NodeId.parse("ns=3;s=\"DB100_BOOL\".\"xBool_0\"); or NodeId nodeId = new NodeId(3, "\"DB100_BOOL\".\"xBool_0\""); In general, though, you cannot rely on a NodeId having any relation to its position in the browse hierarchy. Some servers do use relatively predictable String-based NodeIds, but it's absolutely not a requirement. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am just getting started with OPC for an upcoming project and ran into some issues interacting with OPC.
I am most likely just missing some basic OPC knowledge, but I wasn't sure where to look for it, so any help or guidance is appreciated.
We have a Demo PLC in our office that I can browse using UaExpert:
![UaExpert-Structurepng](https://private-user-images.githubusercontent.com/187302257/392278115-60e0829b-6edc-4641-85be-4e28ad75870b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Nzg1MDQsIm5iZiI6MTczOTQ3ODIwNCwicGF0aCI6Ii8xODczMDIyNTcvMzkyMjc4MTE1LTYwZTA4MjliLTZlZGMtNDY0MS04NWJlLTRlMjhhZDc1ODcwYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QyMDIzMjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jZjc3MDViOTM0NGRkY2QyMDAxNGRlYTM0MzhhODBkMGVkODY3YzY5ZGEyNDY2ZWU3YjZmYmMwYjcwYzhhYmZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cbewBguOSLS7RIZD1PssIYSXRbZau7O8Bj5onjMmU9w)
And I wrote some code that allows me to browse children starting from "DataBlocksGlobal":
This generates the following oputput:
This allows me to read the actual values in xBool_0 for example.
When I try to browse the node directly however, I get the error Bad_NodeIdUnknown:
So my question is: How exactly is the path to a node build?
Beta Was this translation helpful? Give feedback.
All reactions