We are currently working on a small add-in for Processbook and we've run into a minor problem. One of the things the add-in is responsible for is replacing the PI tags in the display with AF tags.
To facilitate that, we're using the following to handle a Value Symbol:
And the equivalent for the other symbols.
The problem is that "sometimes" that operation will fail and throw a COM Exception stating that the "Server name is invalid" or "Tag name is invalid". However, both are completely valid and the tag does end up in the symbol. When trying to edit the same symbol, it doesn't complain about the newly added tags either. It's not a particular symbol type that causes the error. It seems to be related to the "newness" of the AF Attribute though as adding the path of an old AF attribute generally doesn't cause the exception whereas adding one of an attribute that was created in the past couple minutes does.
So, why would that happen? Should the add-in wait for PB to verify the tag before trying to add another one?
This is the first time I've had a chance to work on a PB add-in so please excuse my ignorance. And thank you in advance.