I would like to know if it's possible to get the names of the nodes in the device tree of my project.
So far I managed to get a list of nodes (of type INode) but I can't get their name out of this.
For example in my project I have the following architecture :
I used this to get the nodes of my project :
nodes := IoConfig_Globals.DeviceNodes;
And I correctly get an array with every node :
Now I want to get the names of the node in my program (the values highlighted in the previous picture) but I can't figure out how to do that.
I found this post that makes me think it was not possible in 2018, but is it possible in 2022 ?
I want to do that to be able to count how many ethercat masters are in the project and how many slaves do they have each.
I am facing a quite simmilar problem so I will try to look into it. Could you provide your latest functionality about knowing what type of node it was?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I feel like im getting somewhere, if we could get this whole variable into an array or something, then we could see the name of the devices as variables, even if we could get to that specific device by the name then we could extract the INode 16#xxxx value and compare it with all the nodes from IoConfig_Globals.DeviceNodes. Now we just need to figure out if we can put this whole variable into something more info in the image bellow.
Hello everyone,
I would like to know if it's possible to get the names of the nodes in the device tree of my project.
So far I managed to get a list of nodes (of type INode) but I can't get their name out of this.
For example in my project I have the following architecture :
I used this to get the nodes of my project :
nodes := IoConfig_Globals.DeviceNodes;
And I correctly get an array with every node :
Now I want to get the names of the node in my program (the values highlighted in the previous picture) but I can't figure out how to do that.
I found this post that makes me think it was not possible in 2018, but is it possible in 2022 ?
I want to do that to be able to count how many ethercat masters are in the project and how many slaves do they have each.
Thank you in advance,
BR
Last edit: paulpotat 2022-07-08
up
interesting topic, have you found a way to do it yet ?
Sadly, I did not :( I was able to get the type of the node (I could know that a node was a "Bus controller" for example), but not much more...
I am facing a quite simmilar problem so I will try to look into it. Could you provide your latest functionality about knowing what type of node it was?
closest I have come is this free Application Composer module.
https://content.helpme-codesys.com/en/CODESYS%20Application%20Composer/ac_device_diagnose_overview.html
I feel like im getting somewhere, if we could get this whole variable into an array or something, then we could see the name of the devices as variables, even if we could get to that specific device by the name then we could extract the INode 16#xxxx value and compare it with all the nodes from IoConfig_Globals.DeviceNodes. Now we just need to figure out if we can put this whole variable into something more info in the image bellow.