I had this code working in a previous version of CoDeSys to read variables from a GVL that were added to the Symbol configuration. The problem now is that when I get the _IBaseTreeNode_Parent, it returns a valid interface, but none of the methods or properties work.
If you monitor the _IBaseTreeNode in the watch window, it does show the correct child count. However, it fails at step 30, where the child count incorrectly returns zero. In the image, you can see that the watch window displays the correct value that the property should return.
I got this code working again. 3S/CoDeSys, your level of obfuscation and lack of documentation turns a simple task into a monumental complex challenge.
The issue was that at some point the IecVarAccessLibrary changed and no longer allowed using IBaseTreeNode to retrieve a child or the number of children. The attached code has been updated to use IIecVarAccess6.VarAccBrowseGetChildByIndex instead. The code was also cleaned up but is still a work in progress.
The current example only works one layer deep. This means native data types, arrays, and single-layer structures are supported. However, structure arrays and nested structures are not yet supported.
I had this code working in a previous version of CoDeSys to read variables from a GVL that were added to the Symbol configuration. The problem now is that when I get the _IBaseTreeNode_Parent, it returns a valid interface, but none of the methods or properties work.
If you monitor the _IBaseTreeNode in the watch window, it does show the correct child count. However, it fails at step 30, where the child count incorrectly returns zero. In the image, you can see that the watch window displays the correct value that the property should return.
Attached is the full project code.
I got this code working again. 3S/CoDeSys, your level of obfuscation and lack of documentation turns a simple task into a monumental complex challenge.
The issue was that at some point the IecVarAccessLibrary changed and no longer allowed using IBaseTreeNode to retrieve a child or the number of children. The attached code has been updated to use IIecVarAccess6.VarAccBrowseGetChildByIndex instead. The code was also cleaned up but is still a work in progress.
The current example only works one layer deep. This means native data types, arrays, and single-layer structures are supported. However, structure arrays and nested structures are not yet supported.
Last edit: jzhvymetal77 2025-08-25