Scrip propertychange when the tag changes from inactive to active

hello everyone
I have a tag that I want to fill with the information from a database, but only when a tag changes from inactive to active.

I’m thinking of creating it with the propertychange event.

but I don’t know how the structure should go to create the tag change comparison.

this is my tag


Forgive my confusion. Do you mean when the value goes from false to true, or when the tag goes from disabled to enabled?

the tag goes from disabled to enabled

Using a gateway tag change script you can use the newValue object. There is also event.getCurrentValue(), which gives rather the same thing rather the same thing, and event.getPreviousValue to get the values before it changed:

value, quality, t_stamp = newValue.value, newValue.quality, newValue.timestamp 

if not initialChange:

	if quality == 'Good':
	elif quality == 'Bad_Disabled':

I just don’t understand where the TAG change is going to be compared.

Look for the Tag Change section.