Hi guys, right now I have a few Tag change event scripts being ran on the Gateway side the following is an example
from java.util import Calendar cal = Calendar.getInstance() value = system.tag.read("Press Lines/ChangeOver").value if value == 1: Path = "Press Lines/DateOn" system.tag.write(Path, cal.getTime()) if value == 0: Path = "Press Lines/DateOff" system.tag.write(Path, cal.getTime())
Basically I’m grabbing a t_stamp when the Boolean bit comes on and when it goes off. It works great my only issue is whenever I as anything new to the events or make a change that requires saving every even I have great ran again so most the time with since my Boolean is off the t_stamp gets grabbed again which I don’t want to happen. I basically only want the script that i made change to or added to be ran. I assume I need to work with a tag value change function? Something like only run the script if the value of the Boolean has changed right?
Can someone point me to the right direction? Thanks
I’m using v 7.8.2