# Tag Historian t\_stamp error and Easy Chart's Strange Behaviour

**URL:** <https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608>\
**Category:** Ignition\
**Tags:** ignition81, database\
**Created:** [January 26, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608 "2021-01-26T14:31:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 26, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/1 "2021-01-26T14:31:21Z")

</div>

Hello,

I have a strange behaviour in Easy Chart component and also the DB. A totally empty SQLite DB's connection is established in the Gateway and it's valid in the status. I am using only one OPC tag to insert its values to the database with Tag Historian. The deadband style is "Analog" and without having issues, I am able to insert the data to the SQLite.

- Sample Mode: Periodic
- Sample Rate: 1 sec

When I do binding the data (with SQL Query) I get the values to the table component but the t\_stamps seems incorrect, as you can see it below.

> Assuming that this timestamp is in **seconds** :  
> **GMT** : Tuesday, 20. May 2003 03:04:57  
> **Your time zone** : Tuesday, 20. May 2003 05:04:57 [GMT+02:00]  
> **Relative** : 18 years ago

However if I do open the sqlite db file with DB Browser for SQLite software to visualize, I do see the correct values in t\_stamp field, see below.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fe617f0f784c1e041b5097402f4e0784855b1de9.png)

This is a very strange behaviour that I couldn't figure out. The tag belongs to the default group btw.

My second struggle to show Historian data in the Easy Chart component. As it is in the manual and also in the inductiveuniversity videos, I drag and drop the tag which has the historical data, but whenever I move the datetime selector it's only showing the last value, but not the history of the tag. So the line is always straight, not showing any difference but a flat line with different values. For the historian data, also the chart is not autorefreshing itself.  
This is also same for realtime data.

Here is the screen shot of flat line:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/c/4c54d77d657c3732437491365a18bd001a9b0329.png)

I also tried to use DB pen in the Easy Chart customizer but there in the Time Column section it gives me error as t\_stamp is not a date.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cca0d018ebcf399aa86583063ea018a217ab934c.png)

The OS: Windows x64  
The Ignition version: 8.1.1  
Java Version: 11.0.7+10-LTS

Thank you.  
Best,  
Cihangir

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 26, 2021, 2:51pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/2 "2021-01-26T14:51:33Z")

</div>

Don’t use “DB” pens for tag historian data. Use Tag Historian pens.

---

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 26, 2021, 2:55pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/3 "2021-01-26T14:55:08Z")

</div>

I am using Tag Historian pen actually. Since I have the problem, I have tried the DB pen but no success.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 26, 2021, 3:03pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/4 "2021-01-26T15:03:17Z")

</div>

What is the time source for the OPC data? If the source’s clock is wrong, and it supplies the timestamp, you will get weird behavior.

---

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 26, 2021, 4:02pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/5 "2021-01-26T16:02:55Z")

</div>

I doubt about it, because in the .sqlite database file, I do see the correct timestamps. (please, check the screenshot below). Also while I am feeding the Easy Chart component with the tag historian of this tag, it shows the correct datetimes in the chart itself. But only showing the straight line of the last value. Only making the “Named Query” gives me wrong t\_stamp values, as it can be seen in the following ss. In the screenshot, you see on the right hand side, DB Visualization from another software and left hand side is the query that have been made within Designer.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58975290d1ab3528c5964065e5c3a9f0eaaa8a66.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 26, 2021, 4:56pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/6 "2021-01-26T16:56:21Z")

</div>

Is your DB connection actually using the SQLite driver & translator type?  
There was a bug (fixed well before 8.1.1) where SQLite’s lack of strict types caused precision loss in Java, so we special-case SQLite connections to pack values into long/double instead of int/float. What you’re experiencing _looks_ like that.

---

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 26, 2021, 5:02pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/7 "2021-01-26T17:02:15Z")

</div>

Actually I had 8.0.12 today and I have upgraded Ignition to the latest stable one.

Driver Type: Generic  
Default Translator: SQLITE

While I was checking the documentation for v8, I realised that the JDBC driver creates an empty SQLite database, if not exists in the given path. May this error because of the empty SQLite DB created by myself? I don’t think so, since I do not create any table, just raw sqlite file but I wanted to ask you 🙂

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/f/6fa96b90e0cd4d7872e3f85179da8379c2b85f8e.png)

Also in the documentation the file extension is “.db” but in my case I have named it as “.sqlite”. Might that be the problem?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 26, 2021, 5:18pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/8 "2021-01-26T17:18:24Z")

</div>

> [@caksoy](#):
>
> May this error because of the empty SQLite DB created by myself?

No, that shouldn't matter - a SQLite file is a SQLite file. Same for the file extension; we use .db as an entirely arbitrary convention.

I think the actual problem is that 'Generic' driver type; did you upgrade from an older version of Ignition? If I create a new DB connection using the SQLite type, it gets a SQLite driver type:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/7/876fec53252b7f4f06d7105a9357b02ae138070c.png)  
I'm not 100% on how the upgrade logic works, but (for testing) you could try disabling your current SQLite connection and making a new one - see if that uses the 'SQLite' driver type, and has the same issue when pointed to your existing file.

---

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 26, 2021, 5:24pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/9 "2021-01-26T17:24:28Z")

</div>

Actually, I checked the Databases ==\> Drivers subsection to reply your previous message. When I check the connection subsection in the Databases, there it shows as you have it.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0cbe13cf7fef9aec05ec0c4874ad97096e0310d7.png)

FYI, I have made the new connection with an empty sqlite, after upgrade. The old one, I just disconnected it.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 26, 2021, 6:03pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/10 "2021-01-26T18:03:00Z")

</div>

Hmm, I would say get in contact with support, at this point. It doesn’t look like anything obvious, but support should be able to help work through it.

---

<div class="post-metadata">

**Author:** ![caksoy](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@caksoy](https://forum.inductiveautomation.com/u/caksoy)\
**Post date:** [January 27, 2021, 4:07pm UTC](https://forum.inductiveautomation.com/t/tag-historian-t-stamp-error-and-easy-charts-strange-behaviour/42608/11 "2021-01-27T16:07:15Z")

</div>

I couldn’t get an answer from the support and I have tried it with postgreSQL. All working now without any problem. If anyone encounters this kind of problem, can try with another DB, such as postgreSQL.
