What are DB tags?

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

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?)

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.

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 ?

Yes, how many times it went TRUE.

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.

1 Like

Could you please elaborate step wise how to proceed?