# Enable property change script

**URL:** <https://forum.inductiveautomation.com/t/enable-property-change-script/83317>\
**Category:** Ignition\
**Created:** [December 19, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/enable-property-change-script/83317 "2023-12-19T15:26:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammyjoe.gingras](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sammyjoe.gingras](https://forum.inductiveautomation.com/u/sammyjoe.gingras)\
**Post date:** [December 19, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/enable-property-change-script/83317/1 "2023-12-19T15:26:59Z")

</div>

Hi!  
Is there a way to automaticaly set a tag property ''enabled'' to false/true in condition of the state of an other external tag property?

As exemple: Ive got a tag 1111\_test and a tag 1111\_test\_com. I want to disable the communication of the 1111\_test (set enabled to false) if the 1111\_test\_com.value=false. If 1111\_test\_com.value=true, then the ''enabled'' porperty of 1111\_test will be set back at true.

Thank you

---

<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:** [December 19, 2023, 3:34pm UTC](https://forum.inductiveautomation.com/t/enable-property-change-script/83317/2 "2023-12-19T15:34:03Z")

</div>

With a value change tag event script, yes. (Not with a binding.)  
It would look like this:

```auto
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	system.tag.writeAsync(['[.]Test1111.enabled'], [currentValue.value])

```

{ I used a tag name that doesn't start with a digit. }

Of course, if this is a memory tag, and going to be written from a script, there's no reason you can't simply write to `Test1111.enabled` directly.

---

<div class="post-metadata">

**Author:** ![sammyjoe.gingras](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sammyjoe.gingras](https://forum.inductiveautomation.com/u/sammyjoe.gingras)\
**Post date:** [December 19, 2023, 4:10pm UTC](https://forum.inductiveautomation.com/t/enable-property-change-script/83317/3 "2023-12-19T16:10:23Z")

</div>

Thank you !
