Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Get names of nodes in device tree

  • paulpotat

    paulpotat - 2022-07-08

    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,


    Last edit: paulpotat 2022-07-08
  • paulpotat

    paulpotat - 2023-02-09


  • vformanek - 2023-03-17

    interesting topic, have you found a way to do it yet ?

    • paulpotat

      paulpotat - 2023-03-17

      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...

      • vformanek - 2023-03-17

        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?

  • vformanek - 2023-03-17

    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.


Log in to post a comment.