In this Expression I am Checking the Condition if it is true and the tag value is less than 1170 which is an offset value the counter will start from 1170 then 1171 and so on which is working but the quality of the tag is showing Error Expression Eval but different instance of these tag with same expression it's not showing the quality error so not sure what I am doing wrong.
Basically, I am trying to create a counter tag which will keep incrementing by 1 while condition is true and while false the counter will stop counting and resume counting again when the condition becomes true from where it is stopped.
appreciate any help on this
In the instance that has the expression eval error, what is the error the eval is actually getting? You may be able to get this by going to the Tag Diagnostics.
You might also provide at least a screenshot of thee UDT you are using with it's tags for the bad instance.
Trying to count within a single expression tag is doomed. There must be a circular reference to the tag's value, and that has race conditions even when using coalesce(). Use a separate expression tag to yield the count condition, and have script on that increment a memory tag.
Same expression I have added in another tag it is giving me Good Quality @pturmel
I have written condition in another tag that is S1STAT giving Boolean value on which I am running the expression in another tag, I have tried writing tag value change script on that count condition tag to increment the value, but it only increments once on value change, but it does not keep incrementing the value, if possible, can you share some examples
If so, use a third tag, memory tag of type datetime, to hold a timestamp when the boolean condition goes true. (Written from the condition tag's valueChange event.)