Gateway timer script to log folder of tags to SQL

EDIT: What specific version of Ignition are you using? That hasn’t been stated, yet.

getResults() should work regardless. Let’s start small and work our way up. This is a sample using my server, change to your tag path and see if we can print some values from the script console.

tagPath = '[default]Assembly/3425/Production'

# Browse for tags in a Folder
tags = system.tag.browse(tagPath, {'tagType' : 'AtomicTag'}).getResults()

# Initialize list of tags to read
tagReadList = []

# Add fullpath of each tag from the browse to the list 
for tag in tags:
	# fullpaths are objects so we must coerce them to strings.
	tagReadList.append(str(tag['fullPath']))

# Read the tags. Note that these are qualified values, not just the values.
qvalues = system.tag.readBlocking(tagReadList)

# Print the results. zip() lets us iterate through multiple lists at once.
for tagName, qvalue in zip(tagReadList, qvalues):
	value = qvalue.value
	t_stamp = qvalue.timestamp
	quality = qvalue.quality
	print tagName, value, t_stamp, quality

output

[default]Assembly/3425/Production/actual 696 Mon Jun 27 14:48:29 EDT 2022 Good
[default]Assembly/3425/Production/Efficiency 0.633879780769 Mon Jun 27 14:48:30 EDT 2022 Good
[default]Assembly/3425/Production/Efficiency 60 0.538461506367 Mon Jun 27 14:48:27 EDT 2022 Good
[default]Assembly/3425/Production/goal 1098 Mon Jun 27 14:48:13 EDT 2022 Good
[default]Assembly/3425/Production/total 769 Mon Jun 27 14:48:29 EDT 2022 Good
1 Like