When I configure a Tag History binding in Perspective with a historical time range that has a fixed end date, the result set unexpectedly includes an additional row. This row represents the current timestamp and the values that are currently on the tag. However, this is problematic because the current timestamp falls outside the specified historical range.
Here's an example using the AsStored query mode. As a workaround I could either add a filter on the quality code to remove any rows with quality code 200, or always remove the last row. Although that doesn't change the fact that the binding is returning data which falls outside of the requested range.
Another thing to note for this particular example, is that we don't have a historized value for today (21/11/2023) yet. I'm working with a tag for which values are entered manually and stored in the historian using
system.tag.storeTagHistory(...). That means these are discrete values, not a continuous signal, and I only want to work with the values that are actually in the database.
Combine this with the issue above, and we run into problems again when using a Periodic (1 day) historical query, where the range includes today (21/11/2023):
While the timestamp of the last row is located in the requested time range, it's values are not what I expected. Since there is no value in the database for today, I would have expected
0, similar to the values for 18/11/2023 and 19/11/2023, which don't have a value either.
In this case I can't use the earlier workaround either of removing the rows with quality code 200, since the row for yesterday also has that quality code. Nor can I simply remove the last row, because it is possible that a value exists for today in the database, in which case I do want to show it.
I know Ignition is mostly tailored for working with continuous signals, but these behaviors don't feel like they are correct. Anybody who can help with this?
I've already looked through the forum and found multiple similar reports, unfortunately none of them had any replies: