# Issues with the ValueChanged tag event

**URL:** <https://forum.inductiveautomation.com/t/issues-with-the-valuechanged-tag-event/18671>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 29, 2018, 5:25pm UTC](https://forum.inductiveautomation.com/t/issues-with-the-valuechanged-tag-event/18671 "2018-06-29T17:25:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [June 29, 2018, 5:25pm UTC](https://forum.inductiveautomation.com/t/issues-with-the-valuechanged-tag-event/18671/1 "2018-06-29T17:25:22Z")

</div>

I'm having issues getting my Valuechanged tag event to work correctly.The code I currently have for my ValueChanged event for my Set Temp Reached tag is:

> if initialChange:  
> return  
> if ((previousValue.value == 0) and currentValue.value == 1):  
> system.tag.write("[.]Time Set Temp Reached",system.date.now())  
> if ((previousValue.value) and not currentValue.value):  
> system.tag.write("[.]Time Set Temp Dropped",system.date.now())

However, my Time Set Temp Reached tag is not being written to while my Time Set Temp Dropped is being written to. I want my tag to write to Time Set Temp Reached when the real time temperature reaches a specified temperature and write to Time Set Temp Dropped when the temperature drops below that specified temperataure. This is the code I have for my Set Temp Reached tag:

> if ( {[.]realtime\_temp} \>= {[.]Set\_temp},  
> 1,  
> if ( ({[.]realtime\_temp}+2 \>= {[.]Set\_temp}) && ({[.]time left} \< {[.]Set\_time}) && {[.]time left} != 0,  
> 1,  
> 0))

---

<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:** [June 29, 2018, 5:53pm UTC](https://forum.inductiveautomation.com/t/issues-with-the-valuechanged-tag-event/18671/2 "2018-06-29T17:53:10Z")

</div>

I believe only the expression language supports relative tagpath shortcuts. In jython, you’ll have to spell out the tag paths.

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [July 2, 2018, 12:06pm UTC](https://forum.inductiveautomation.com/t/issues-with-the-valuechanged-tag-event/18671/3 "2018-07-02T12:06:17Z")

</div>

I just tried spelling out the tag paths but I still get the same result.
