Get Tag metadata properties

Hello,

I’m currently occupied upgrading some modules from Ignition 7.9 to 8. Most of the modules need to retrieve values of tags on change and then get exported to different file formats. As we don’t want to export every tags, we need to filter them individually.

In the previous version of the modules (which I didn’t develop), tags where filtered with a value stored in their documentation (under Meta data properties) which was retrieved using:

Tag tag = manager.getTag(path);
String metadata = tag.getAttribute(TagProp.Documentation).getValue().toString();

Quick information about the old modules, they were all drivers (I just don’t know why) but now I decided to switch for just simpler modules using the GatewayHook. The problem is that the GatewayTagManager doesn’t have a function getTag(). So my question is: how can I retrieve these properties in a proper way?

I’m using the browse tags method showed in the docs to retrieve all my tags and then subscribe to them. I would like to get the documentation value at this point.

Thanks in advance for the help and have a great day!

Just read it. If all you need is the Documentation property, then all you have to do is issue a read.
Something like:

TagPath path = new BasicTagPath("", List.of("path", "to", "tag"), WellKnownTagProps.Documentation);
gatewayContext.getTagManager().getTagProvider("default").readAsync(List.of(path), SecurityContext.systemContext()).get().get(0);
1 Like

Hi @PGriffith, thanks for the quick answer !

Indeed, I tried to read the tag, but I was directly using the path I was finding by browsing the tag, not BasicTagPath nor WellKnownTagProps.Documentation.

This works like a charm ! Thanks a lot again for your help :slight_smile:

1 Like