I have a gateway tag change script, I wanted to insure only executed once, it sends an email and I don’t want to spam the recipients if we have a network error. So I wrote it like this…
trigger = system.tag.read(“DoTask”)
if trigger.value == 1:
#tell the plc we are good system.tag.writeSynchronous("DoTask", 0) #check that everything worked trigger = system.tag.read("DoTask") if trigger.value == 0: #do the task
I figured this way I was guaranteeing to only send the message once and I could use the writeSynchonous since I was executing in a gateway script. The code executes, however it seems the writeSynchonous is not really synchronous. In the next read, my trigger.value still returns true.
Am I misunderstanding how this should work?