pylogix icon indicating copy to clipboard operation
pylogix copied to clipboard

Pylogix - compare a previously acquired tag list with the current one

Open horus61 opened this issue 10 months ago • 5 comments

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)

horus61 avatar Aug 23 '23 11:08 horus61