I’m currently in 8.3.2. I want to use the system.historian.queryAggregatedPoints function for get the most recent tag value within each five minute interval. The interval part is fine using returnSize, but I’m finding that unwanted interpolation is being performed on my on-change historical tag values. For example, a set [0, 0, 100] gets interpolated to [0, 50, 100] when the tag never actually changed to value 50. How can I stop this interpolation so that each interval is truly the last value that was recorded prior to that time? I suspect fillModes may be related, but I haven’t been able to locate a list of the possible options for fillMode.
For reference, this is what my inputs currently look like for a 4 hour time frame:
I suspect the parameters are similar to the functions for the pre-8.3 historian(system.tag.queryTagHistory). It’s a guess. In that historian you would use “noInterpolation” to do what you’re trying to do but it appears to not be an option in the new one. What does your output look like with “excludeObservations” set to true?
excludeObservations doesn’t seem to be the answer - set to True, I get the same result for the same time frame (in this case its shifted by a minute, but you get the idea).
I don’t currently have an 8.3 system set up to test with. It looks like you might be able to use the depricated system.tag.queryTagHistory to view the new historian data with interpolation turned off. See if that works for you.
That looks a lot like interpolation. Just to be certain, I also added the Count column (which should indicate the number of non-interpolated data points in each row):
You might need to set “ignoreBadQuality”. I have seen situations where quality changes are viewed as tag changes which triggers a collection that you don’t want in your output.
intervalMintues will make it calculate a return size. That may be introducing the behavior you don’t want. Try removing that parameter from your call.
returnSize defaults to -1 which returns the values as they changed see if that’s what you’re looking for. If not, try sending a 0 for that parameter. That returns the “natural” number of values.
That’s all I have for the time being.
I’ll set up an 8.3 environment and look into it further if I get some time over the next couple weeks. Customers tend to want to see raw data with the historical logging so I want to look into how that behaves with the new 8.3 logging.
ignoreBadQuality doesn’t seem to do it either - and if I remove intervalMinutes, I’m back to just my raw tag values, which I really wanted grouped into 5 minutes spans (particularly for cases where there is more than one value in a 5 minute span - I wanted those to just display the last value in the span).
At this point I’m thinking I might have to manipulate the data into the desired shape without relying on the built-in aggregation tools, which isn’t ideal.
Thanks for taking the time to dig into this with me!