Best/Fastest way of browsing all tags?

For now the best way is browseTags() using the sort of manual recursion shown here, very rarely would you use the built in recursive parameter for browseTags IMO. I have a method that finds all tags inside UDTs in a tag provider that I explain a bit here. No code, sorry, but the general idea for speeding it up is there. Depending on the amount of tags/UDTs it could still take a while. Sounds like you have more than just UDTs you’re looking for which may not work as well with this method.

Besides making your own recursive function (from the first link) I’d suggest you do this on the gateway. Personally I have a boolean memory tag with a tag change script so that when its true, it runs the script, dumps to a dataset memory tag, then writes the boolean memory tag false again so its all done in the gateway. It’s much faster on the gateway usually and you could set a timer script to do this too so it runs in the middle of the night or something so it doesn’t tank your servers performance.

If you need to do this in the client, make sure you’re using a invokeAsynchronous/invokeLater structure so it doesn’t freeze everything while you do it.

This is all to just get the paths though. Once you do that you can use system.tag.readAll() and append the attributes to the path to find what you need (tag attributes = path.attribute so a tag at path Test/Tag would have the OPC Server attribute at Test/Tag.OPCServer). If you’re currently using just system.tag.read() for each and every new path you find, that will slow things down a ton. readAll() is much faster for the same amount of tags.

2 Likes