pylogix
pylogix copied to clipboard
Pylogix - compare a previously acquired tag list with the current one
Good morning everyone. I state that I am new to python programming and I would like to ask you for advice on how to compare a previously acquired tag list with the current one to check for any changes in the values. Thanks for your availability.
I used this code
def run_script():
int_ret = []
with PLC() as comm:
comm.IPAddress = 'xx.xx.xx.xx'
ret = comm.Read(list)
for r in ret:
print(r.Value)
int_ret.append(r.Value)
return int_ret
while True:
y = run_script()
print(y)