Tag Status Rollup

I must be missing something, this should be simple.

We have a UDT with an integer status tag calculated on the device. I currently have about 75 of those devices, but will end up with several hundred. The UDT also includes a parameter that categorizes the devices. What I’m trying to do is find the worst case status in each category. Pseudo code:

For each Instance in folder:
    category = Instance.parameter.category
    category_status = run some code here based on Instance.statustag.value

I can deal with all the code except for the “for each Instance…”, that part is throwing me for a loop. I figure there has to be a function or feature that allows me to find all the instances/tags in a folder and iterate through them.

Suggestions gratefully accepted.

You can use system.tag.browse.

This will go through each tag in “folder1”, you can filter the results to your liking.

paths = []
folder1tags = system.tag.browse(path = '[default]Folder1')
for folder1tag in folder1tags.getResults():
	paths.append(str("[default]Folder1/" + folder1tag['name']))
1 Like

system.tag.browse or system.tag.configure?

Edit: @josborn beat me to it.

1 Like