# Tag History: Data logging

**URL:** <https://forum.inductiveautomation.com/t/tag-history-data-logging/110965>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 25, 2025, 10:04am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965 "2025-09-25T10:04:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [September 25, 2025, 10:04am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/1 "2025-09-25T10:04:48Z")

</div>

I am trying to log data every 10 seconds, but with a condition: the value should not fall within the deadband range. For example, if the current tag value is **5.0** and the deadband is set to **2** , I want the next value (after 10 seconds) to be logged **only** if it is **7 or above** or **3 or below**. In other words, changes within ±2 should not be logged.

I’ve tried configuring this using the tag history settings, but I haven’t been able to achieve the desired behavior. Could someone please suggest the correct procedure to implement this?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 25, 2025, 11:45am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/2 "2025-09-25T11:45:56Z")

</div>

Using the following settings should result in what I think you're trying to achieve:

- Deadband Style: Discrete
- Deadband Mode: Absolute
- Historical Deadband: 2.0
- Sample Mode Periodic
- Max Time Between Samples: 0
- Sample Rate: 10
- Sample Rate Units: Seconds

With these settings, every 10 seconds the system will evaluate the difference of the current value with the last recorded value, if the absolute value of that difference is greater than 2, the value will be stored.

Max Time Between Samples is set to 0, so that there is no recording based on time change.

Note that if value 1 is 5.0 and after 10 seconds the value changes to 8, that value will be recorded, if after 10 seconds the value is 8.0 ± 2.0 that value will be recorded. Resulting in the last three values being 5.0, 8.0, and 6.0. If instead what you are trying to achieve is a deadband around a _setpoint_ value, that will require a different setup.

---

<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:** [September 25, 2025, 1:00pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/3 "2025-09-25T13:00:12Z")

</div>

> [@lrose](#):
>
> that will require a different setup.

That is, not in Ignition's historian. That would be condition-based storage, not a deadband. Ignition's historian does not do condition-based storage at all.

---

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [September 25, 2025, 1:26pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/4 "2025-09-25T13:26:07Z")

</div>

Thank you for response, then how can I achieve this

---

<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:** [September 25, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/5 "2025-09-25T13:35:29Z")

</div>

Via SQL Bridge transaction group or by scripted DB inserts.

---

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [September 25, 2025, 2:01pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/6 "2025-09-25T14:01:26Z")

</div>

Hi, unfortunately we have not considered SQL Bridge Module in this project, is there any option in tag historian module only

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [September 25, 2025, 2:02pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/7 "2025-09-25T14:02:41Z")

</div>

> [@devaraj.v](#):
>
> is there any option in tag historian module only

No, but you can script it.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 25, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/8 "2025-09-25T14:05:32Z")

</div>

How would you guys script it? You need to keep track of the previously stored value in order to compare it. Write it to a custom tag prop?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [September 25, 2025, 2:15pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/9 "2025-09-25T14:15:53Z")

</div>

Well, the first write goes into the DB, so to me it makes sense to compare against that (read from the DB, compare to live).

I’m saying it’s possible, not that I’ve done it =)

---

<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:** [September 25, 2025, 2:19pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/10 "2025-09-25T14:19:09Z")

</div>

> [@nminchin](#):
>
> You need to keep track of the previously stored value in order to compare it.

No, the OP seems to want to compare to a fixed range. A tag value change event that checks the range, then fires an S&F Prep Update would be my preferred approach.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 25, 2025, 2:34pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/11 "2025-09-25T14:34:25Z")

</div>

Hmm, I interpreted it as being +/- the deadband for the last stored value.

> [@Matrix\_Engineering](#):
>
> read from the DB, compare to live

I certainly wouldn't be doing this in a tag change event, in case someone reads this and interprets it that way. Much faster to read a tag's value than a value via a SQL query though

---

<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:** [September 25, 2025, 2:44pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/12 "2025-09-25T14:44:26Z")

</div>

Hmm. Re-reading the OP, you may be right. The historian should do this naturally, if deadband style is discrete.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 25, 2025, 4:01pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/13 "2025-09-25T16:01:52Z")

</div>

> [@pturmel](#):
>
> The historian should do this naturally, if deadband style is discrete

I agree, which is why I added the last part of my response.

@devaraj.v Can you clarify if you are looking to store a value based on a deaband around some expected value, or just a deadband around the last recorded value.

---

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [September 26, 2025, 10:25am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/14 "2025-09-26T10:25:42Z")

</div>

I need to implement a deadband around the last recorded value to reduce the number of data logs to the database. For example, if the previously recorded value is 5.5 bar and the deadband is 0.5 bar, I will only log a new value (sampled every 10 seconds) if it is **≥ 6.0 bar or ≤ 5.0 bar**.

If the change in value is less than the deadband, the value should **not** be logged, even though sampling continues every 10 seconds. This helps avoid unnecessary database entries when the change is insignificant.

---

<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:** [September 26, 2025, 11:37am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/15 "2025-09-26T11:37:16Z")

</div>

The historian does this for you. Try using the settings in the first reply.

---

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [October 3, 2025, 7:13am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/16 "2025-10-03T07:13:40Z")

</div>

Figure:1

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

Problem 1: For some tags it is working fine. For example (Figure:2), if my tag value is 556 and the deadband is 0.05, the value gets logged whenever it changes by more than ±0.05 . But for some other tags(for example refer Figure:1), even though I use the same settings, the value logs as null every 10 seconds, which should not happen. Ideally, whenever we change the value, it should follow the deadband. However, if we don’t change the value, it should not log anything at all—instead of logging null.

Figure:2

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/2/7273eee0281f83d6eb997242df2f6fb5566514fc.png)

Problem 2: I changed my tag value to 556.06, but instead of showing the rounded value, it displays a long decimal like 556.059997558594. Is there any way to display the correct changed value?(Refer Figure 2)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [October 3, 2025, 10:06am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/17 "2025-10-03T10:06:42Z")

</div>

> [@devaraj.v](#):
>
> Problem 2: I changed my tag value to 556.06, but instead of showing the rounded value, it displays a long decimal like 556.059997558594. Is there any way to display the correct changed value?(Refer Figure 2)

Please do some research around how computers store decimals as floats. For example:

> **[IEEE Standard 754 Floating Point Numbers - GeeksforGeeks](https://www.geeksforgeeks.org/computer-organization-architecture/ieee-standard-754-floating-point-numbers/)**
>
> Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and...

Ignition is behaving in the industry standard way when it stores float values. There are many ways of dealing with this behaviour. The critical thing is that Ignition is storing this value correctly.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 3, 2025, 11:06am UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/18 "2025-10-03T11:06:12Z")

</div>

> [@devaraj.v](#):
>
> the value logs as null every 10 seconds, which should not happen. Ideally, whenever we change the value, it should follow the deadband. However, if we don’t change the value, it should not log anything at all—instead of logging null.

The value isn't logging as null, it's logging as 0. That you are showing the current value to be 5 and a logged value of 0, makes me think there is something else going on, like this being a different tag, or not truely an integer value.

Also, please show the history configuration for this tag, so we can see if maybe you've missed something, in the setup.

---

<div class="post-metadata">

**Author:** ![devaraj.v](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@devaraj.v](https://forum.inductiveautomation.com/u/devaraj.v)\
**Post date:** [October 3, 2025, 1:12pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/19 "2025-10-03T13:12:25Z")

</div>

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

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

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

**Hi Irose, please find the settings screenshot. We are logging the value as a double datatype**

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [October 3, 2025, 1:41pm UTC](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965/20 "2025-10-03T13:41:42Z")

</div>

I would recommend that you call into support and have them take a look. I don't think I've ever had a tag that logged as both an Integer and a Float.

[Next page](https://forum.inductiveautomation.com/t/tag-history-data-logging/110965.md?page=2)
