# Tag Change Monitoring Script

**URL:** <https://forum.inductiveautomation.com/t/tag-change-monitoring-script/11744>\
**Category:** Ignition\
**Created:** [May 30, 2016, 10:26am UTC](https://forum.inductiveautomation.com/t/tag-change-monitoring-script/11744 "2016-05-30T10:26:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raikberg](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@raikberg](https://forum.inductiveautomation.com/u/raikberg)\
**Post date:** [May 30, 2016, 10:26am UTC](https://forum.inductiveautomation.com/t/tag-change-monitoring-script/11744/1 "2016-05-30T10:26:26Z")

</div>

Hello World 😆

I have Boolean Tag from a PLC which is set to True and our SCADA / Ignition needs to set it back to False. I am not very familiar with python scripting yet, may some of you can help.  
It is like a handshake between the PLC and the Gateway.

I created this gateway event script ( tag change) and it is triggered when the value has changed

[quote]value = system.tag.read(“SPS08/VISU/08\_Lebensbit\_SRV1”).value

if value == True :  
system.tag.writetotag (value, False)  
[/quote]

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [June 9, 2016, 10:44pm UTC](https://forum.inductiveautomation.com/t/tag-change-monitoring-script/11744/2 "2016-06-09T22:44:39Z")

</div>

This would be the way to do it

`if not initialChange:
    tagPath = "[default]SPS08/VISU/08_Lebensbit_SRV1"
    value = system.tag.read(tagPath).value
    if value == 1:
        system.tag.write(tagPath, 0)`

You need to include the provider name in the tagpath since this is a gateway script. Also, in your script you created a variable of “value”. You cant pass “value” into your tag.write because that variable returns the value of the tag in your tag read.
