Hi Snarf,
Another question is of you really need an Iv or can use an ordinary attribute of type Int32. The Iv is IO copied and thread safe when used in the plc, but often an Int32 attribute will do as well.
There are a number of functions to traverse the object tree. gdh_GetClassList() and gdh_GetNextObject() will find all objects of a specific class, and it seems that this could be suitable for you.
pwr_sClass_MyClass *p;
for (sts = gdh_GetClassList(pwr_cClass_MyClass, &oid); ODD(sts); sts = gdh_GetNextObject(oid, &oid)) {
sts = gdh_ObjidToPointer(oid, &p); // or gdh_RefObjectInfoAttrref()
...
}
If you want to search all objects from the top hierarchy you can use gdh_GetRootList(), gdh_GetChild() and gdh_GetNextSibling().
/Claes