Scripting tag history and viewing

I found the storeTagHistory function while browsing the API today, which looks pretty perfect for what my task at hand.

I was able to get the storeTagHistory working, using the snippet below (note that my history provider is ‘Process’). I’m creating a virtual KPI folder with a history tag called TestKPI inside of it. My question is, are these ‘virtual’ tags actually retained inside the historian? And, if so, how do I get them to appear in a tag tree or something similar that a user could view? Or do I need to create actual tags for that (I would assume memory tags set to historize)?

def storeKPI(tagName, value,tagTime):
paths = [‘KPI/’+tagName]
values = [value]
quals = [192]
dates = [tagTime]
#Store the history with the variables declared above.
system.tag.storeTagHistory(“Process”,“madeUpProvider”, paths, values,quals, dates)

def printHistory(tagName,startTime=’’,endTime=’’):
newValues = system.tag.queryTagHistory(
paths=[’[Process]KPI/’+tagName],
aggregationMode=‘LastValue’,
returnFormat=‘Tall’,
startDate = startTime,
endDate = endTime
)
for row in range(newValues.rowCount):
print ‘%s:\t%s’%(newValues.getValueAt(row,3),newValues.getValueAt(row,1))

tagTime = system.date.now()
tagName = ‘TestKPI’
value = 1357
#storeKPI(tagName,value,tagTime)
#Need to wait after calling storeKPI or our result won’t show up.
printHistory(tagName)