I am trying to create a simple table from tag historian with a few tags to just look at temperature data. All tags are set to periodic sampling every minute, right now I am seeing this -
Where ideally I'd only see one row per minute. Right now I have data linked to tag history where I'm pulling it as stored for a specific time range and then applying this script to remove duplicate rows.
oldDataset = value
headers = system.dataset.getColumnHeaders(oldDataset)*
# convert to pyDataset, so the data is compatible with the set constructor
pyData = system.dataset.toPyDataSet(oldDataset)
# turn the lists into tuples so they are hashable
tuples = map(tuple, pyData)
# create a set from the list of tuples
pySet = set(tuples)
#convert set back into a list
newData = list(pySet)
#create an Ignition dataset from the headers and data without duplicates
newDataset = system.dataset.toDataSet(headers, newData)
return newDataset
I think the timestamps are causing the issues but when I look into the historian I see all tags I'm interested in are logged at the same time -
Any ideas to get what I am looking for? Or what is the cause of the duplicate rows?