# Script error on momentary button

**URL:** <https://forum.inductiveautomation.com/t/script-error-on-momentary-button/33652>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [April 3, 2020, 5:09am UTC](https://forum.inductiveautomation.com/t/script-error-on-momentary-button/33652 "2020-04-03T05:09:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrajatrcs](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@rrajatrcs](https://forum.inductiveautomation.com/u/rrajatrcs)\
**Post date:** [April 3, 2020, 5:09am UTC](https://forum.inductiveautomation.com/t/script-error-on-momentary-button/33652/1 "2020-04-03T05:09:28Z")

</div>

this is my script on my momentary button

system.tag.write(event.source.parent.SOV\_NO.Meta.TagPath+"/ManOpen",1)

it does high (i.e =1) my tag when i pressed my button but CANNOT put low (i.e =0) when i release button. as it is a momentary button it should be like " high on press and low on released" like positive pulse

---

<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:** [April 3, 2020, 11:19am UTC](https://forum.inductiveautomation.com/t/script-error-on-momentary-button/33652/2 "2020-04-03T11:19:45Z")

</div>

Duplicate post. Try to not do that. See answer over in the first topic:

> [@Script on momentory button](http://forum.inductiveautomation.com/t/script-on-momentory-button/33651/2):
>
> Don't use a script. The momentary button drives it's .controlValue property, which you are expected to bidirectionally bind to the tag you want to control. In your case, with an indirect binding incorporating that tagpath property. But beware, there are gotchas with momentary buttons in general, where you can lose the "off" operation. You generally need PLC code of some kind to mitigate this. See this topic and the linked topics within: [http://forum.inductiveautomation.com/t/hmi-momentary-…](http://forum.inductiveautomation.com/t/hmi-momentary-button-gets-stuck-with-n-o-bit-of-plc/21388/4)
