I have a mouse over event that collects all the system history tags and fills a drop down with the found history tag names. I used the example in the docs for this. It works well, however, if I add historical tags, these new tags do not show up in the tag list until the gateway is restarted.
These new tags appear in the history database if I do a query with the Database Query Browser tool.
Is there any way to refresh the available history tags without restarting the gateway?
Copy of script below:
devices = [self.getSibling(“RadioGroup_PLC”).props.value]
tList = []
labels = []
outPut = []
for device in devices:
path=‘histprov:Historian:/drv:Ignition-nri-gw:default:/tag:’+device
browse = system.tag.browseHistoricalTags(path) #We call the function and place the BrowseResults
#that get returned into a variable called browse.
results = browse.getResults() #We can then call getResults() on the BrowseResults variable, and store that in a variable called results.
for result in results: #We can now loop through the results in a for loop.
theTag = result.getPath() #We then call .getPath() on the individual objects to get the Tag Path.
#create list of tags
tList.append(theTag)
#split off just the tag name for the label
for i in tList:
justTag = str(i).split("tag:")
labels.append(justTag[1])
#populate the selector with tags
#theTag is the entire path
#labels is the label
headers = ['value','label']
outPut = zip(tList,labels)
outPut.sort()
options2 = system.dataset.toDataSet(headers, outPut)
sortedOptions = system.dataset.sort(options2,"value")
#load the list into the TagSelector
self.getSibling("TagSelect").props.options= sortedOptions