# What are DB tags?

**URL:** <https://forum.inductiveautomation.com/t/what-are-db-tags/93432>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 19, 2024, 4:34am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432 "2024-07-19T04:34:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![VAISHNAVI\_BYWAR](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VAISHNAVI\_BYWAR](https://forum.inductiveautomation.com/u/VAISHNAVI_BYWAR)\
**Post date:** [July 19, 2024, 4:34am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/1 "2024-07-19T04:34:00Z")

</div>

How to create a DB tag to use in a script?

---

<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:** [July 19, 2024, 5:16am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/2 "2024-07-19T05:16:43Z")

</div>

You'll have to be more specific. What exaclty are you trying to accomplish?

(you create DB tags in much the same way as you would create any other tag, so I suspect the question you're asking is not the question you mean?)

---

<div class="post-metadata">

**Author:** ![VAISHNAVI\_BYWAR](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VAISHNAVI\_BYWAR](https://forum.inductiveautomation.com/u/VAISHNAVI_BYWAR)\
**Post date:** [July 22, 2024, 7:06am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/3 "2024-07-22T07:06:03Z")

</div>

Thanks for replying. So i have to create a counter for counting HIGH of a boolean type OPC tag and i tried finding an answer to that so one of the answers said i need to create a DB tag then use tag change and they also gave an script for that, i tried using it and instead of a DB tag, i made a query tag. I am very new to ignition, so, is DB tag same as query tag? or is it something else? I couldn't find an answer to that.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 22, 2024, 7:18am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/4 "2024-07-22T07:18:05Z")

</div>

Let's forget about any answer you've read for now, and explain the requirement in more details.

Do you want to find how many times a boolean tag toggled to true ? Or for how long is was true ?  
Is it in a specific time frame ? What kind of constraint do you have ?

---

<div class="post-metadata">

**Author:** ![VAISHNAVI\_BYWAR](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VAISHNAVI\_BYWAR](https://forum.inductiveautomation.com/u/VAISHNAVI_BYWAR)\
**Post date:** [July 22, 2024, 8:14am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/5 "2024-07-22T08:14:49Z")

</div>

Yes, how many times it went TRUE.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 22, 2024, 8:19am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/6 "2024-07-22T08:19:54Z")

</div>

Then the simplest solution would be to add a `valueChanged` script to the boolean tag, check if it's true, and increment a memory tag.

This may or may not be enough, depending on other requirements and constraints.

Note that if you're using the historian and this boolean tag is historized, you could just use the built-in functions to retrieve its history.

---

<div class="post-metadata">

**Author:** ![VAISHNAVI\_BYWAR](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VAISHNAVI\_BYWAR](https://forum.inductiveautomation.com/u/VAISHNAVI_BYWAR)\
**Post date:** [July 22, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/what-are-db-tags/93432/7 "2024-07-22T09:11:41Z")

</div>

Could you please elaborate step wise how to proceed?
