currentValue.value and previousValue.value not working


I have written a Value changed script for a memory tag in which i used below condition,
if ( previousValue.value != currentValue.value and currentValue.value == 1 ):
it worked for earlier days, now i found out that it is not working anymore. So i changed it as
vCheck =system.tag.readBlocking(“[.]DBDataStoreTriggerHr”)[0].value
if (vCheck== 1 ):

What might be the root cause of this issue.

Thanks in advance

what do you mean not working, is it causing an error or the logic not working?

I generally prefer to seperate it using more brackets to make sure the logic is what I want so:

if ((previousValue.value != currentValue.value) and (currentValue.value == 1)):

What error do you get in the gateway log?


Logic is not working. When i tried to print the previous or current value in the log. It is not printing at all.

I would try making some memory tags and writing values to those as a test, try changing the value and check those memory tags. If nothing changes then your script isn’t compiling, probably because of an error