# Gateway script issue

**URL:** <https://forum.inductiveautomation.com/t/gateway-script-issue/10795>\
**Category:** Ignition\
**Created:** [November 16, 2015, 5:34pm UTC](https://forum.inductiveautomation.com/t/gateway-script-issue/10795 "2015-11-16T17:34:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qversa](https://avatars.discourse-cdn.com/v4/letter/q/35a633/32.png) [@qversa](https://forum.inductiveautomation.com/u/qversa)\
**Post date:** [November 16, 2015, 5:34pm UTC](https://forum.inductiveautomation.com/t/gateway-script-issue/10795/1 "2015-11-16T17:34:15Z")

</div>

This should be an easy one. I have the attached Gateway script running but it does not behave as I think it should. Most likely something simple I’m not seeing. I would like the tag, OneSecondFlasher, to toggle on/off every one second. Instead it just goes to true and stays there. I can set it to false in the tag browser and it goes back to true again but never goes false. What am I missing? Thanks.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ee9ea0828b8874d7466e382aa24bed139d89458d.jpg)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 16, 2015, 5:37pm UTC](https://forum.inductiveautomation.com/t/gateway-script-issue/10795/2 "2015-11-16T17:37:35Z")

</div>

system.tag.read returns a qualified value - try getting the value attribute from it before using it in your comparison.

---

<div class="post-metadata">

**Author:** ![qversa](https://avatars.discourse-cdn.com/v4/letter/q/35a633/32.png) [@qversa](https://forum.inductiveautomation.com/u/qversa)\
**Post date:** [November 16, 2015, 5:48pm UTC](https://forum.inductiveautomation.com/t/gateway-script-issue/10795/3 "2015-11-16T17:48:26Z")

</div>

Yup, an easy one. I edited the script (below) and it works. Thanks for the help!

qv = system.tag.read(“OneSecondFlasher”)  
boolOneSecondFlasher = qv.value  
if boolOneSecondFlasher == True:  
system.tag.write(“OneSecondFlasher”, 0)  
else:  
system.tag.write(“OneSecondFlasher”, 1)
