Hello,
I am trying to query from one of the tags that we are tracking in the historian. We are looking to get the minimum value of the tag from a certain start date up to the current time. We are trying to do so using the queryTagCalculations function, using “Minimum” as the calculation.
However, it seems like the “Minimum” value coming from the function is not correct. Based on the data that I’ve been entering into the tag manually, the minimum value during the time span should be 250. However, the value that this function is returning is 300.
I am also able to confirm that this is not working by running the “Average” calculation as well. When I run that calculation on the same tag over the same time span, the average returned is below 300, which makes sense. But that must mean that at some point the tag had a value of < 300, which means that the “Minimum” being returned in the previous function is not correct.
Is there something we are doing incorrectly here? Please let us know what we need to do.
Input:
ds = system.tag.queryTagCalculations(paths=[equipmentSpeedPath], startDate=equipmentSpliceSignalTime, calculations=["Average"])
for row in range(ds.getRowCount()):
print 'Average:', ds.getValueAt(row, 1)
print ''
ds = system.tag.queryTagCalculations(paths=[equipmentSpeedPath], startDate=equipmentSpliceSignalTime, calculations=["Minimum"])
for row in range(ds.getRowCount()):
print 'Minimum:', ds.getValueAt(row, 1)
Output:
Average: 299.003904928
Minimum: 300