SQLTagsManager in Ignition 8.1, not finding sqlTagsManager.browse(tagPath) with return type Tag

Hi

I am not able to find the exact replica of sqlTagsManager.browse(tagPath) which has return type as Tag. where as tagProvider.browseAsync(tagPath, BrowseFilter.NONE) is returning Results , NodeDescription is not same as Tag. Can i able get TagProp.OPCItemPath, TagProp.Name from NodeDescription Attribute.

7.9 version changes below

SQLTagsManager sqlTagsManager = this.gatewayContext.getTagManager();
TagPath tagPath = TagPathParser.parseSafe("default", "/" + finalTagPathStr);
for (Tag tag : sqlTagsManager.browse(tagPath)) {
			if (tag.getAttribute(TagProp.Name).getValue().toString().equals(finalTagName)) {
				String tagOPCPath = tag.getAttribute(TagProp.OPCItemPath).getValue().toString();
				if (tagOPCPath != null && !tagOPCPath.trim().equals("")) {
					String[] tagOPCPathComponents = tagOPCPath.split(";");
					if (tagOPCPathComponents.length >= 2) {
						int siteIndex = tagOPCPathComponents[1].indexOf("_");
						if (siteIndex < 0) {
							siteIndex = tagOPCPathComponents[1].indexOf(" ");
						}
						String siteName = tagOPCPathComponents[1].substring(tagOPCPathComponents[1].indexOf("=") + 1,
								siteIndex);
//						String siteName = tagOPCPathComponents[1].substring(tagOPCPathComponents[1].indexOf("=") + 1,
//								tagOPCPathComponents[1].indexOf("_"));// tagPath.getPathComponent(0);
						String tagName = tagOPCPathComponents[1].substring(tagOPCPath.indexOf("="));
						TagVO tagVO = new TagVO();
						tagVO.setCommonTagName(tagName);
						tagVO.setSiteId(siteName);
						this.tagOpcPathMap.put(tagPathStr, tagVO);
					}
				}
			}
}

8.1 version of my changes

	GatewayTagManager sqlTagsManager = this.gatewayContext.getTagManager();
	Results<NodeDescription> results = tagProvider.browseAsync(tagPath, BrowseFilter.NONE).get(30, TimeUnit.SECONDS); 

Is there a reason why you couldn’t use direct reads to retrieve these attributes?

Example (with OPC tag at [default]OpenFileDescriptors):

import pprint
pp = pprint.PrettyPrinter(indent=2)
tag_path = '[default]OpenFileDescriptors'
fields = ['Name', 'OpcItemPath']
read_results = system.tag.readBlocking(
	['{0}.{1}'.format(tag_path, x) for x in fields]
)
results = dict(zip(fields, [x.value for x in read_results]))
pp.pprint(results)

EDIT: Now I see that you’re likely doing module development… Sorry! :laughing: :coffee: I’ll still leave the above in the event it helps somebody…