Easy chart displaying data two hours in the past (Vision)

Hello All,

I have an issue with the data displayed in my easy charts. The historical tags that I select to be displayed show data that lie two hours in the past. In other words, my data is not realtime even though it is configured to be realtime.

I checked my PostgreSQL entries, and they are updated correctly, and with the correct timestamp. However when I convert the epoch time to “readable” time, it runs approx. 6 mins behind on my local time.

Any ideas what the issue(s) can be?

6 minutes and 2 hours have likely different causes.

The 6 minutes is probably caused by out-of-sync clocks. In 7.9 you can set the time source (https://docs.inductiveautomation.com/display/DOC79/Configuring+Tag+Historian#ConfiguringTagHistorian-TimestampSource). In 8.0, this option is gone AFAIK. So you should check the clock of the gateway and of the device to be sure.

The 2 hours difference is likely a timezone difference. Let me guess you’re currently in UTC+2. I don’t know on what system you’re running, but you should check the configured timezones of the gateway and the client.

1 Like

Thanks, your comment led me in the right direction…

I found the following…

My clients and gateway are running UTC+1, but my PostgreSQL server is running CEST. This PostgreSQL server is hosting other services as well, so I can not easily change the server time. Additionally the clients time zone are coming from our NTP server. I think this explains the 2hrs offset…

And to add to the confusion,

It only happens to tags stored in the default tables created by Ignition. If I store the same OPC tag in a custom table via Vision transaction groups, and I create a query tag it works fine…

I am on 8.0.7 and located in Hungary (Which has UTC offset+2)

I have found the following differences that have an effect on DB storage.

  1. When I enable historical logging on a tag, Ignition automatically creates timestamps and stores them as (epoch) BigInt.

  2. When I create a table via transaction groups, the accompanied timestamp is stored as Timestamp without timezone.

I experience issues only with data from option one. Is there a way to store timestamps as a different data format in the Ignition automatic generated tables?

I found my issue and will post the answer here, it might be useful for other users experiencing the same issue.

All tags set to History enabled “true” where the data source is OPC will use the OPC server time as timestamp in the Database. This means that if there are 10 devices without NTP server, and they have different times, these times will also be different in the common DB table generated by Ignition.

I can understand the logic in this, but it is also “misleading” since it can happen that your OPC server time lies in the future, in this case all graphs using this tag display false information. (Example: at 13:55 the tank level was not 90% full, but actually 98%) I assume there is no danger for realtime processing (controlling valves etc. since the realtime data is still accurate) But reports that query OPC tag data will also display wrong information.

Just my 2cts

You really should consider using timestamp with timezone in PostgreSQL, and fixing all of your other timezone problems. (You can alter the tables after the transaction group creates them, or even better, change the DB translater to always use timestamptz.)