Enable property change script

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

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

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.

1 Like

Thank you !