system.tag.readAll error executing gateway function exception

v7.9.14

Same issue as in this post, but when calling readAll. The tagpaths I'm providing is the fullPath as taken from a browseTags that is run prior to the readAll call.

Instead of reading all 55000 tags that the browseTags function returns in one go, I tried also splitting it into various block sizes. I gradually decreased the block size as I noticed that it failed at a particular point each time. I got down to a block size of 5 where I thought I had narrowed it down to the block of 5 tags that it might have been failed on, then I reduced it to blocksize of 1, starting reading at the particular block, and it ran through and didn't fail on any of those 5 tags..

This is the code I have:

import java.lang.Exception
tags = system.tag.browseTags(recursive=1)

paths = [tag.fullPath for tag in tags]
opctag = [tag + '.OPCItemPath' for tag in paths]
opcItemPaths = []
blockSize = 5000
for i in range(len(opctag)/blockSize + 1):
	try:
		startIndex = i*blockSize
		endIndex = ((i*blockSize)+blockSize-1) if ((i*blockSize)+blockSize-1) < len(opctag) else len(opctag)
		tmp = system.tag.readAll(opctag[startIndex:endIndex])
		tmp = [tag.value for tag in tmp]
		opcItemPaths.extend(tmp)
	except Exception, e:
		print e
	except java.lang.Exception, e:
		print e

print len(opcItemPaths)
1 Like

hmm, adding in tagType = 'OPC' into the arguments fixed the issue. I should have had that in there previously, but still interested in why this would cause it to cause an exception? Shouldn’t this just produce a lot of bad quality returns?