I’m writing a code that reads data from an OPC server. This is a summary:
url = opc.tcpXXXXX
client = Client(url)
client.connect()
And then in a while loop I want to read data from the server for several days:
While True:
Data1 =client.get_node(“ns=4;i=3”)
Data1_Val = Data1.get_value()
#write it to sql table
time.sleep(120)
I’m reading 20 nodes the same way in the same while loop. At first, all works fine. But, after a while the script would still be running but without any data acquisition! What I mean is that after about 2 hours, I will no longer get data from the server.
What could possibly be the problem?
Thanks!