Put all tags in a table (Ignition Perspective)

A modified form of @lrose’ solution to be a bit more idiomatic to both Ignition and Python conventions:

paths = ['Ramp/Ramp0','Ramp/Ramp1']
properties = ['Name', 'Value', 'EngHigh','EngLow','EngUnit']

allTags = [
    path + '.' + prop
    for path in paths
    for prop in properties
]

tagValues = system.tag.readBlocking(allTags)

# https://stackoverflow.com/a/434328
def chunker(seq, size):
    return (seq[pos:pos + size] for pos in xrange(0, len(seq), size))

data = [
	[qv.value for qv in chunk]
	for chunk in chunker(tagValues, len(properties))
]

ds = system.dataset.toDataSet(properties, data)
print ds
1 Like