baggio2008 Posted December 9 Report Share Posted December 9 (edited) Hello everyone, It is possible to get the NodeID of a variable from an OPC UA server using OPC UA client toolkit? Thanks Edited December 9 by baggio2008 Quote Link to comment
LogMAN Posted December 9 Report Share Posted December 9 Given a parent node, using Forward Browse should give you a list of child nodes, including their node ID: https://www.ni.com/docs/en-US/bundle/labview-opc-ua-toolkit-api-ref/page/opcuavis/opcua_forward_browse.html Quote Link to comment
baggio2008 Posted December 10 Author Report Share Posted December 10 Thank you for the reply. The problem is that i have a list of some predefined PLC signals saved as csv-File that need to be forced on LabVIEW Frontpanel. To write and read that signals using OPC UA tool to/from PLC, i need to know for each signal read from the csv-File what is the node Id. The easy way to do so is to read the file and assign for each signal the corresponding NodeID. Perhaps there are others alternatives but at the moment it what im thiniking to do. I actually don't know how i can extra dynamically the nodid of signals and sign each with the corresponding signal name of the csv-File. Quote Link to comment
Rolf Kalbermatter Posted December 10 Report Share Posted December 10 On 12/9/2024 at 5:28 PM, baggio2008 said: Hello everyone, It is possible to get the NodeID of a variable from an OPC UA server using OPC UA client toolkit? Thanks How is that name created? Variables in OPC-UA are really only known by their node ID anyways. This can be a string node ID that gives you a name, but that is entirely depending on the server configuration as to what that string would be if any. There is no way that you can have some random string name and let the server answer you with what node ID that could be, since a node is simply known by its node ID and nothing else. So the real question is how did that string name in your spreadsheet file get generated? Is it the string part of a string type node ID with removed namespace part? Quote Link to comment
baggio2008 Posted December 10 Author Report Share Posted December 10 Hi Dear, the File contains a generated string part of the node ID. Based on that string i would like to get the node ID. Thank you. Quote Link to comment
Rolf Kalbermatter Posted December 10 Report Share Posted December 10 2 minutes ago, baggio2008 said: Hi Dear, the File contains a generated string part of the node ID. Based on that string i would like to get the node ID. Thank you. You can't automatically. There could be the same name in several namespaces. You will have to browse the various namespaces and search for that specific name. That can be done with the BrowseForward function programmatically. Or if you know in which namespace they all are, you can reconstruct the NodeID string of course yourself, something like ns=1;s=your_string_name or if it is an uri namespace: nsu=https://someserver/resource ;s=your_string_name Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.