Historical Data Issue

I have a bunch of historical tags we are pulling data from. Running into a strange issue.

I generate a custom to pull data from my database.
image

dataset = system.tag.queryTagHistory(paths=tagListCorrected, startDate=startTime, endDate=endTime, returnSize=size, aggregationMode="LastValue", returnFormat='Wide', timeout=60000)

When I look at my Historical Data using a trend object I can see the data. This is using

When I look at an hour of data.

When I pull a larger range the data shows up.

Any thoughts? The value didn't change for several days. Its like my queryTagHistory is spitting out a 0 when a tag doesn't change for a bit.

Make sure you have a Max Time between samples set. See: Configuring Tag History | Ignition User Manual

Set the Max Time to some value smaller than the smallest window you will query. If the smallest that you are looking for is an hour, then set it for 50 min.

2 Likes

What I have it set to (default). Will try your suggestion. Thanks.

With a 0 in Max Time Between Samples you will have this as per the manual: "By default, an "unlimited" amount of time can pass between records – if the value doesn't change, a new row is never inserted in the database"

Do note, this will increase your database usage. However, if just a couple of tags not but a noticeable amount. So there is a balance between database storage and usability at the end of the day.

I think this helped. Will check back after an hour.

Storage won't be an issue. This is for a company that will be providing data for 10+ years. So where it is being stored is really large.