How to Traverse ABB’s Native Tag Name Properties

In the article about mapping the tag names to the GUID, I’ve provide some partial solution about how to get the properties of each tag name.

The drawback of this solution is that it requires working on PPA explorer and hex editor application. The explorer is used to activates certain faceplate and the editor will be used to view the resulting *.sub file.

Accessing the tag names properties proves to be rather elusive, because at first I thought I can first accessed it using the IAfwStructureServer interface described earlier. After utilizing some of the methods inside this interface, I realized that it is only acted as directory or structure browsing, just as DIR command on DOS command prompt.

The only differences between DIR command and ABB’s structure browsing is that in the later, it is not providing the leaf traversing, i.e. the objects below the directory structure.

Take T13UE059 tag name for example, by using opcguid.exe, it will retrieve the path of Root/Network 41/T10PS04/Extended Process Objects/MB300 Motor/T13UE059. But there are no way to retrieve leaf node below T13UE059.

It turns out that to retrieve leaf nodes below the end of directory object is by using the Object – Aspect concept in the ABB terminology, which means that T13UE059 is some kind of object and to access the leaf nodes, i.e. the properties, I have to gets the “Aspect” of this object.

But before I can access the aspect of the object, I have to get instance pointer to the object. This is done by calling GetObject method of IAfwObjectManager interface described earlier in my previous post. This method accepts the GUID of the object and gives interface pointer to IAfwObject. As you can see, the GUID is retrieved via OPCGUID.EXE utility.

Next, to traverse available aspects to the object, I can use enumeration class by calling EnumerateAspects method. It is by using this enumeration class that I can get access to aspect object through IAfwAspect.

Successful access to IAfwAspect is not enough, because there is still one more step to retrieve the properties. If you pay close attention to my post about tag name to GUID mapping, you can see that to access OPC value of certain tag names requires formatting the tag name in the form of A:B:C. (separated by colons).

The A part is object, B part is aspect, and the last, i.e. C part is the property.

To retrieve the C part, I can use QueryAspectInterface method inside retrieved aspect object (i.e. instance of IAfwAspect object), by passing the IAfwSubscribeInfo. This method will gives IUnknown instance on one of its parameter, so I have to perform QueryInterface of unknown class to get a hand of actual instance IAfwSubscribeInfo class.

To get the number of available properties, I can use SubPropCount of this class (i.e. IAfwSubscribeInfo), and for each loop of the element count, I can use either GetNameOfId or GetPropertyInfo method to list out each complete properties for the object.

I’ve create the utility called OPCPATH.EXE to provide working prototype using the above concept, so that now I can view properties of any tag names without resorting to PPA explorer and clumsy hex editor 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: