# Now(0) always return time in Tag expression

**URL:** <https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037>\
**Category:** Ignition\
**Created:** [July 31, 2019, 10:45am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037 "2019-07-31T10:45:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [July 31, 2019, 10:45am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/1 "2019-07-31T10:45:27Z")

</div>

Hi  
I define a tag expression with now(0) as expression.  
The problem is the value of tag in update in every second with current time. When I set now(0) it should mean it only run only once. why my tag value update every second?  
Even i try to use change scan class to 10 s but it always updated every second.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 31, 2019, 11:58am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/2 "2019-07-31T11:58:05Z")

</div>

I can’t imagine it would be useful as a gateway tag. Did you try it as a client tag?

---

<div class="post-metadata">

**Author:** ![Kevin.Collins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.collins/32/13497_2.png) [@Kevin.Collins](https://forum.inductiveautomation.com/u/Kevin.Collins)\
**Post date:** [July 31, 2019, 12:10pm UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/3 "2019-07-31T12:10:19Z")

</div>

I believe the poll rate of the `now()` expression tag only is meaningful within Vision scripts (not tags, in tags it follows the execution mode or scan class). **EDIT:** Also possibly Client Tags, @JordanCClark might be right on that.

I just tested this behavior under 8.0.2 with a tag configured with execution mode of “Tag Group” (so that it respects the configured Tag Group/Scan Class).

 ![25%20AM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5095d99207d02648224ec556d855d605406b7adc.png)

It was updating once per second as expected with the _Default_ scan class. However, changing the scan class from _Default_ to _Slow_ (a Direct scan class I created with 10000ms rate) did not result in a change in update times. **Only when I copied, deleted, and re-pasted the tag did it start to update at the expected 10000ms rate**. This might be an issue in 8.0.2.

I also tested this under 7.9.12 with a similar tag configuration and changing the scan class and applying the changes to the tag had the expected results (tag updated per the configured scan class).

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 31, 2019, 1:11pm UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/4 "2019-07-31T13:11:44Z")

</div>

It sounds like the tags scan class/tag group is overriding the now(0) .  
There is similar behavior when using runScript() in tags.

snippet:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/197e60b735d07726a3393bd802757447fa3a84cc.png)  
link: [runScript()](https://docs.inductiveautomation.com/display/DOC80/runScript)

I would look into using a different scan class/tag group for that tag(s) to suit your needs.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [August 1, 2019, 4:00am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/5 "2019-08-01T04:00:32Z")

</div>

> [@code\_skin](#):
>
> the

The scanclass triggler the now() if I use tag in gateway. Even with now(10000). Hope IA fix this bug.

---

<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:** [August 1, 2019, 10:53am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/6 "2019-08-01T10:53:59Z")

</div>

Not a bug. Documented behavior. Same for runScript in a tag expression. There’s new functionality (that I haven’t used yet) in v8 that addresses this.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 1, 2019, 12:04pm UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/7 "2019-08-01T12:04:48Z")

</div>

What would the use case be for using now(0) in the gateway?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [August 1, 2019, 3:32pm UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/8 "2019-08-01T15:32:37Z")

</div>

I just try to create a timer event in tag change event with now(1000) for every second but it didn’t work so try now(0) to see if scan class really trigger the tag change event.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [August 2, 2019, 12:13am UTC](https://forum.inductiveautomation.com/t/now-0-always-return-time-in-tag-expression/27037/9 "2019-08-02T00:13:35Z")

</div>

![eventDriven](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cb8bd2883d07e45ae7cc2270f7e108cbd5602b04.png)  
If the only driving factor in your expression is the `now()` function then setting the Execution Mode to Event Driven should make the expression in the tag poll at the rate set in the `now()` function.
