# Script on momentory button

**URL:** <https://forum.inductiveautomation.com/t/script-on-momentory-button/33651>\
**Category:** Ignition\
**Created:** [April 3, 2020, 5:05am UTC](https://forum.inductiveautomation.com/t/script-on-momentory-button/33651 "2020-04-03T05:05:24Z")\
**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:05am UTC](https://forum.inductiveautomation.com/t/script-on-momentory-button/33651/1 "2020-04-03T05:05:24Z")

</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-on-momentory-button/33651/2 "2020-04-03T11:19:07Z")

</div>

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:

> [@HMI Momentary button Gets stuck with N/O Bit of PLC](http://forum.inductiveautomation.com/t/hmi-momentary-button-gets-stuck-with-n-o-bit-of-plc/21388/4):
>
> This thread, going back some years, is the most detailed discussion of the problem: Another thread on this issue – somewhat heated at points:
