Basic table from device status

I was able to get it to work using another thread I thread I found on here.

The other thread:UDT to power table

My final version:

The final script I created I placed under a timer gateway event script.

Open to feedback!

tagPath = '[default]PLC Status/All PLCs'
udtID = 'PLC Status/PLC Status'

keys = ["Parameters/DeviceName", "Key Switch Postion","Fault Status","Program State","Full Revision","PLC Connection"]
headers = ["Name", "Key Switch Postion","Fault Status","Program Status","Revision","Connection"]

    # Browse the tags. Filters on tagType to look only for UDT instances,
browse = system.tag.browse(path = tagPath, filter = {'tagType':'UdtInstance'})

    # Create tag names from browse results and keys.
tagsIn = [str(r['fullPath']) + '/' + key for r in browse.getResults() for key in keys if r['typeId'] == udtID]

    # Get tag values
values = [t.value for t in system.tag.readBlocking(tagsIn)]

    # Group the values by the number of keys
data = [values[i:i+len(keys)] for i in range(0, len(values)-(len(keys)-1), len(keys))]
dataset = system.dataset.toDataSet(headers, data)
system.tag.writeBlocking('[default]PLC Status/PLC Status', dataset)